Skip to content

Commit 111089e

Browse files
committed
Revert "Change memory indexing to use the type as index instead of i8 (#57389)"
This reverts commit b9a8d46.
1 parent f2a8e18 commit 111089e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cgutils.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4820,9 +4820,10 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
48204820
setName(ctx.emission_context, ovflw, "memoryref_ovflw");
48214821
}
48224822
#endif
4823-
Type *elty = isboxed ? ctx.types().T_prjlvalue : julia_type_to_llvm(ctx, jl_tparam1(ref.typ));
4824-
newdata = ctx.builder.CreateGEP(elty, data, offset);
4825-
setName(ctx.emission_context, newdata, "memoryref_data_offset");
4823+
boffset = ctx.builder.CreateMul(offset, elsz);
4824+
setName(ctx.emission_context, boffset, "memoryref_byteoffset");
4825+
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
4826+
setName(ctx.emission_context, newdata, "memoryref_data_byteoffset");
48264827
(void)boffset; // LLVM is very bad at handling GEP with types different from the load
48274828
if (bc) {
48284829
BasicBlock *failBB, *endBB;

0 commit comments

Comments
 (0)