@@ -14,7 +14,6 @@ mod peephole_opts;
1414mod simple_passes;
1515mod specializer;
1616mod spirt_passes;
17- mod structurizer;
1817mod zombies;
1918
2019use std:: borrow:: Cow ;
@@ -41,7 +40,6 @@ pub struct Options {
4140 pub early_report_zombies : bool ,
4241 pub infer_storage_classes : bool ,
4342 pub structurize : bool ,
44- pub spirt : bool ,
4543 pub spirt_passes : Vec < String > ,
4644
4745 pub emit_multiple_modules : bool ,
@@ -268,7 +266,7 @@ pub fn link(
268266 }
269267
270268 // NOTE(eddyb) with SPIR-T, we can do `mem2reg` before inlining, too!
271- if opts . spirt {
269+ {
272270 if opts. dce {
273271 let _timer = sess. timer ( "link_dce-before-inlining" ) ;
274272 dce:: dce ( & mut output) ;
@@ -322,13 +320,6 @@ pub fn link(
322320 dce:: dce ( & mut output) ;
323321 }
324322
325- let mut output = if opts. structurize && !opts. spirt {
326- let _timer = sess. timer ( "link_structurize" ) ;
327- structurizer:: structurize ( output)
328- } else {
329- output
330- } ;
331-
332323 {
333324 let _timer = sess. timer ( "link_block_ordering_pass_and_mem2reg-after-inlining" ) ;
334325 let mut pointer_to_pointee = FxHashMap :: default ( ) ;
@@ -368,7 +359,8 @@ pub fn link(
368359 }
369360 }
370361
371- if opts. spirt {
362+ // NOTE(eddyb) SPIR-T pipeline is entirely limited to this block.
363+ {
372364 let mut per_pass_module_for_dumping = vec ! [ ] ;
373365 let mut after_pass = |pass, module : & spirt:: Module | {
374366 if opts. dump_spirt_passes . is_some ( ) {
@@ -470,6 +462,11 @@ pub fn link(
470462 } ;
471463 }
472464
465+ // FIXME(eddyb) rewrite these passes to SPIR-T ones, so we don't have to
466+ // parse the output of `spirt::spv::lift` back into `rspirv` - also, for
467+ // multi-module, it's much simpler with SPIR-T, just replace `module.exports`
468+ // with a single-entry map, run `spirt::spv::lift` (or even `spirt::print`)
469+ // on `module`, then put back the full original `module.exports` map.
473470 {
474471 let _timer = sess. timer ( "peephole_opts" ) ;
475472 let types = peephole_opts:: collect_types ( & output) ;
0 commit comments