diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-05 03:43:54 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-02-13 21:26:48 -0800 |
| commit | 5e0c773e8000c56fa1c258b57b2b64e453a3f57a (patch) | |
| tree | d4b6a583ce1bab28830ab5837fa1e9c589b3a889 | |
| parent | 853ae3dd0c9acaa73ce2615e0bd922d2c45bfcbb (diff) | |
| download | rust-5e0c773e8000c56fa1c258b57b2b64e453a3f57a.tar.gz rust-5e0c773e8000c56fa1c258b57b2b64e453a3f57a.zip | |
Set both `nuw` and `nsw` in slice size calculation
There's an old note in the code to do this, and now that LLVM-C has an API for it, we might as well.
| -rw-r--r-- | src/builder.rs | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/src/builder.rs b/src/builder.rs index 1c3d6cc899a..b8e37b60480 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -665,6 +665,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { a + b } + // TODO(antoyo): should we also override the `unchecked_` versions? fn sub(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { self.gcc_sub(a, b) } @@ -832,31 +833,6 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { set_rvalue_location(self, self.gcc_not(a)) } - fn unchecked_sadd(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - set_rvalue_location(self, self.gcc_add(a, b)) - } - - fn unchecked_uadd(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - set_rvalue_location(self, self.gcc_add(a, b)) - } - - fn unchecked_ssub(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - set_rvalue_location(self, self.gcc_sub(a, b)) - } - - fn unchecked_usub(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - // TODO(antoyo): should generate poison value? - set_rvalue_location(self, self.gcc_sub(a, b)) - } - - fn unchecked_smul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - set_rvalue_location(self, self.gcc_mul(a, b)) - } - - fn unchecked_umul(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> { - set_rvalue_location(self, self.gcc_mul(a, b)) - } - fn fadd_fast(&mut self, lhs: RValue<'gcc>, rhs: RValue<'gcc>) -> RValue<'gcc> { // NOTE: it seems like we cannot enable fast-mode for a single operation in GCC. set_rvalue_location(self, lhs + rhs) |
