introduce and use ptradd/inbounds_ptradd instead of gep

This commit is contained in:
Erik Desjardins 2024-02-24 02:01:41 -05:00
parent beed25be9a
commit 4724cd4dc4
6 changed files with 27 additions and 38 deletions

View file

@ -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);