File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -565,6 +565,11 @@ fn invoke_rustc(builder: &SpirvBuilder) -> Result<PathBuf, SpirvBuilderError> {
565565 // HACK(eddyb) we need this for `core::fmt::rt::Argument::new_*` calls
566566 // to *never* be inlined, so we can pattern-match the calls themselves.
567567 "-Zinline-mir=off" . to_string( ) ,
568+ // HACK(eddyb) similar to turning MIR inlining off, we also can't allow
569+ // optimizations that drastically impact (the quality of) codegen, and
570+ // GVN currently can lead to the memcpy-out-of-const-alloc-global-var
571+ // pattern, even for `ScalarPair` (e.g. `return None::<u32>;`).
572+ "-Zmir-enable-passes=-GVN" . to_string( ) ,
568573 ] ;
569574
570575 // Wrapper for `env::var` that appropriately informs Cargo of the dependency.
Original file line number Diff line number Diff line change @@ -345,6 +345,11 @@ fn rust_flags(codegen_backend_path: &Path) -> String {
345345 // HACK(eddyb) we need this for `core::fmt::rt::Argument::new_*` calls
346346 // to *never* be inlined, so we can pattern-match the calls themselves.
347347 "-Zinline-mir=off" ,
348+ // HACK(eddyb) similar to turning MIR inlining off, we also can't allow
349+ // optimizations that drastically impact (the quality of) codegen, and
350+ // GVN currently can lead to the memcpy-out-of-const-alloc-global-var
351+ // pattern, even for `ScalarPair` (e.g. `return None::<u32>;`).
352+ "-Zmir-enable-passes=-GVN" ,
348353 // NOTE(eddyb) flags copied from `spirv-builder` are all above this line.
349354 "-Cdebuginfo=2" ,
350355 "-Cembed-bitcode=no" ,
You can’t perform that action at this time.
0 commit comments