Skip to content

Commit 7e1f0be

Browse files
gbaraldiZentrik
andauthored
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]>
1 parent 32423a8 commit 7e1f0be

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/cgutils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,9 +4286,8 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
42864286
ovflw = ctx.builder.CreateICmpUGE(ctx.builder.CreateAdd(offset, mlen), ctx.builder.CreateNUWAdd(mlen, mlen));
42874287
}
42884288
#endif
4289-
//Is this change fine
42904289
boffset = ctx.builder.CreateMul(offset, elsz);
4291-
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
4290+
newdata = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
42924291
(void)boffset; // LLVM is very bad at handling GEP with types different from the load
42934292
if (bc) {
42944293
BasicBlock *failBB, *endBB;

0 commit comments

Comments
 (0)