Skip to content

Commit 28fcbff

Browse files
gbaraldiKristofferC
authored and
KristofferC
committed
codgen: make the Memory GEP an inbounds GEP (#55107)
The Julia memory model is always inbounds for GEP. This makes the code in #55090 look almost the same as it did before the change. Locally I wasn't able to reproduce the regression, but given it's vectorized code I suspect it is backend sensitive. Fixes #55090 Co-authored-by: Zentrik <[email protected]> (cherry picked from commit 7e1f0be)
1 parent 00b6831 commit 28fcbff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cgutils.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4150,7 +4150,7 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
41504150
boffset = ctx.builder.CreateMul(offset, elsz);
41514151
#if 0 // TODO: if opaque-pointers?
41524152
newdata = emit_bitcast(ctx, data, getInt8PtrTy(ctx.builder.getContext()));
4153-
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), newdata, boffset);
4153+
newdata = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), newdata, boffset);
41544154
#else
41554155
Type *elty = isboxed ? ctx.types().T_prjlvalue : julia_type_to_llvm(ctx, jl_tparam1(ref.typ));
41564156
newdata = emit_bitcast(ctx, data, elty->getPointerTo(0));

0 commit comments

Comments
 (0)