Enable folding patterns which load the value from non-zero offset:
i8 *a = ... i32 val = a[4] | (a[5] << 8) | (a[6] << 16) | (a[7] << 24)
>
i32 val = *((i32*)(a+4))
Paths
| Differential D29394
[DAGCombiner] Support non-zero offset in load combine ClosedPublic Authored by apilipenko on Feb 1 2017, 6:36 AM.
Details Summary Enable folding patterns which load the value from non-zero offset: i8 *a = ... i32 val = a[4] | (a[5] << 8) | (a[6] << 16) | (a[7] << 24) >i32 val = *((i32*)(a+4))
Diff Detail
Event Timelineboris.ulasevich added inline comments.
Comment Actions Please can you commit the new tests to trunk now with their current codegen and then update this patch to show the delta in codegen - I think this will answer @boris.ulasevich 's concerns. Comment Actions One minor
This revision is now accepted and ready to land.Feb 8 2017, 8:44 AM Closed by commit rL294582: [DAGCombiner] Support non-zero offset in load combine (authored by apilipenko). · Explain WhyFeb 9 2017, 4:17 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 87789 llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/test/CodeGen/AArch64/load-combine-big-endian.ll
llvm/trunk/test/CodeGen/AArch64/load-combine.ll
llvm/trunk/test/CodeGen/ARM/load-combine-big-endian.ll
llvm/trunk/test/CodeGen/ARM/load-combine.ll
llvm/trunk/test/CodeGen/X86/load-combine.ll
|