Skip to content

Commit

Permalink
codgen: make the Memory GEP an inbounds GEP (#55107)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
gbaraldi authored and KristofferC committed Aug 19, 2024
1 parent 00b6831 commit 28fcbff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4150,7 +4150,7 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
boffset = ctx.builder.CreateMul(offset, elsz);
#if 0 // TODO: if opaque-pointers?
newdata = emit_bitcast(ctx, data, getInt8PtrTy(ctx.builder.getContext()));
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), newdata, boffset);
newdata = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), newdata, boffset);
#else
Type *elty = isboxed ? ctx.types().T_prjlvalue : julia_type_to_llvm(ctx, jl_tparam1(ref.typ));
newdata = emit_bitcast(ctx, data, elty->getPointerTo(0));
Expand Down

0 comments on commit 28fcbff

Please sign in to comment.