Skip to content

Commit 2bac7c1

Browse files
committed
Remove --no-spirt and the old structurizer.
1 parent 6589f07 commit 2bac7c1

File tree

6 files changed

+32
-582
lines changed

6 files changed

+32
-582
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2727
2828
-->
2929

30+
## [Unreleased]
31+
32+
### Removed 🔥
33+
- [PR#1052](https://github.com/EmbarkStudios/rust-gpu/pull/1052) removed `--no-spirt`,
34+
committing to SPIR-T as a mandatory part of the Rust-GPU compiler backend,
35+
to reduce the cost of maintenance, testing and further feature development
36+
* Note: if you were using `--no-spirt` to work around [`naga` issue #1977](https://github.com/gfx-rs/naga/issues/1977)
37+
(valid loops causing `The 'break' is used outside of a 'loop' or 'switch' context`),
38+
you may be able to `cargo update -p naga` to update to a fixed `naga` version
39+
(`0.11.1` for `wgpu 0.15`, `0.12.1` for `wgpu 0.16`, and any later versions)
40+
3041
## [0.7.0]
3142

3243
### Added ⭐

crates/rustc_codegen_spirv/src/codegen_cx/mod.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,6 @@ impl CodegenArgs {
342342
);
343343
opts.optflag("", "no-structurize", "disables CFG structurization");
344344

345-
opts.optflag(
346-
"",
347-
"no-spirt",
348-
"disable using SPIR-T for legalization (see also `docs/src/codegen-args.md`)",
349-
);
350345
opts.optmulti(
351346
"",
352347
"spirt-passes",
@@ -522,7 +517,6 @@ impl CodegenArgs {
522517
early_report_zombies: !matches.opt_present("no-early-report-zombies"),
523518
infer_storage_classes: !matches.opt_present("no-infer-storage-classes"),
524519
structurize: !matches.opt_present("no-structurize"),
525-
spirt: !matches.opt_present("no-spirt"),
526520
spirt_passes: matches
527521
.opt_strs("spirt-passes")
528522
.iter()

crates/rustc_codegen_spirv/src/linker/mod.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ mod peephole_opts;
1414
mod simple_passes;
1515
mod specializer;
1616
mod spirt_passes;
17-
mod structurizer;
1817
mod zombies;
1918

2019
use 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

Comments
 (0)