From 3d682bd012cfff0c9802d1f774c28687fac37c9e Mon Sep 17 00:00:00 2001 From: Gabriel Baraldi Date: Mon, 2 Sep 2024 14:51:59 -0300 Subject: [PATCH] Revert "codgen: make the Memory GEP an inbounds GEP (#55107)" This reverts commit 7e1f0be207b5247a8303549f1aec2c73e79c403e. --- src/cgutils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cgutils.cpp b/src/cgutils.cpp index 2d2d2aed22069..a86d1d8941de1 100644 --- a/src/cgutils.cpp +++ b/src/cgutils.cpp @@ -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;