Skip to content

Commit 5645531

Browse files
Zentrikgiordano
authored andcommitted
Revert "Test reverting "Change memory indexing to use the type as index instead of i8 (JuliaLang#57389)""
This reverts commit 8e4e86d.
1 parent d33e81c commit 5645531

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/cgutils.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -4710,10 +4710,9 @@ 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-
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");
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");
47174716
(void)boffset; // LLVM is very bad at handling GEP with types different from the load
47184717
if (bc) {
47194718
BasicBlock *failBB, *endBB;

0 commit comments

Comments
 (0)