Skip to content

Commit

Permalink
Revert "codgen: make the Memory GEP an inbounds GEP (#55107)"
Browse files Browse the repository at this point in the history
This reverts commit 7e1f0be.
  • Loading branch information
gbaraldi authored Sep 2, 2024
1 parent 39f2ad1 commit 3d682bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4280,8 +4280,9 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
ovflw = ctx.builder.CreateICmpUGE(ctx.builder.CreateAdd(offset, mlen), ctx.builder.CreateNUWAdd(mlen, mlen));
}
#endif
//Is this change fine
boffset = ctx.builder.CreateMul(offset, elsz);
newdata = ctx.builder.CreateInBoundsGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
(void)boffset; // LLVM is very bad at handling GEP with types different from the load
if (bc) {
BasicBlock *failBB, *endBB;
Expand Down

0 comments on commit 3d682bd

Please sign in to comment.