Skip to content

Commit 8e4e86d

Browse files
committed
Test reverting "Change memory indexing to use the type as index instead of i8 (JuliaLang#57389)"
This reverts commit b9a8d46.
1 parent 0430aa7 commit 8e4e86d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/cgutils.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -4710,9 +4710,10 @@ static jl_cgval_t emit_memoryref(jl_codectx_t &ctx, const jl_cgval_t &ref, jl_cg
47104710
setName(ctx.emission_context, ovflw, "memoryref_ovflw");
47114711
}
47124712
#endif
4713-
Type *elty = isboxed ? ctx.types().T_prjlvalue : julia_type_to_llvm(ctx, jl_tparam1(ref.typ));
4714-
newdata = ctx.builder.CreateGEP(elty, data, offset);
4715-
setName(ctx.emission_context, newdata, "memoryref_data_offset");
4713+
boffset = ctx.builder.CreateMul(offset, elsz);
4714+
setName(ctx.emission_context, boffset, "memoryref_byteoffset");
4715+
newdata = ctx.builder.CreateGEP(getInt8Ty(ctx.builder.getContext()), data, boffset);
4716+
setName(ctx.emission_context, newdata, "memoryref_data_byteoffset");
47164717
(void)boffset; // LLVM is very bad at handling GEP with types different from the load
47174718
if (bc) {
47184719
BasicBlock *failBB, *endBB;

0 commit comments

Comments
 (0)