summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/builder.rs
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2024-02-24 02:01:41 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2024-02-26 22:45:53 -0500
commit4724cd4dc4a4776ddedf3612180acfe172c16997 (patch)
tree0bebba409bf8faed1572d95c0e96e1faa7e84094 /compiler/rustc_codegen_llvm/src/builder.rs
parentbeed25be9a2a9e1e73ca79210da57d294c27f925 (diff)
downloadrust-4724cd4dc4a4776ddedf3612180acfe172c16997.tar.gz
rust-4724cd4dc4a4776ddedf3612180acfe172c16997.zip
introduce and use ptradd/inbounds_ptradd instead of gep
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/builder.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs
index 146fa591926..8ac7ae00b6d 100644
--- a/compiler/rustc_codegen_llvm/src/builder.rs
+++ b/compiler/rustc_codegen_llvm/src/builder.rs
@@ -603,11 +603,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
                 let llptr = if i == 0 {
                     place.llval
                 } else {
-                    self.inbounds_gep(
-                        self.type_i8(),
-                        place.llval,
-                        &[self.const_usize(b_offset.bytes())],
-                    )
+                    self.inbounds_ptradd(place.llval, self.const_usize(b_offset.bytes()))
                 };
                 let llty = place.layout.scalar_pair_element_llvm_type(self, i, false);
                 let load = self.load(llty, llptr, align);