diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-14 20:25:43 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-19 11:36:52 -0800 |
| commit | 511bf307f03d7045f54a376d389ebdf9786e7a24 (patch) | |
| tree | 3a9452d197ec7dd77d01de89cffa35dc39b7e230 /compiler/rustc_codegen_gcc | |
| parent | ed49386d3aa3a445a9889707fd405df01723eced (diff) | |
| download | rust-511bf307f03d7045f54a376d389ebdf9786e7a24.tar.gz rust-511bf307f03d7045f54a376d389ebdf9786e7a24.zip | |
Emit `trunc nuw` for unchecked shifts and `to_immediate_scalar`
- For shifts this shrinks the IR by no longer needing an `assume` while still providing the UB information - Having this on the `i8`→`i1` truncations will hopefully help with some places that have to load `i8`s or pass those in LLVM structs without range information
Diffstat (limited to 'compiler/rustc_codegen_gcc')
| -rw-r--r-- | compiler/rustc_codegen_gcc/src/builder.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs index b8e37b60480..76846692459 100644 --- a/compiler/rustc_codegen_gcc/src/builder.rs +++ b/compiler/rustc_codegen_gcc/src/builder.rs @@ -1694,7 +1694,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { fn to_immediate_scalar(&mut self, val: Self::Value, scalar: abi::Scalar) -> Self::Value { if scalar.is_bool() { - return self.trunc(val, self.cx().type_i1()); + return self.unchecked_utrunc(val, self.cx().type_i1()); } val } |
