[PATCH] D29394: [DAGCombiner] Support non-zero offset in load combine

Artur Pilipenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 1 06:36:18 PST 2017


apilipenko created this revision.
Herald added a reviewer: javed.absar.

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))


https://reviews.llvm.org/D29394

Files:
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  test/CodeGen/AArch64/load-combine-big-endian.ll
  test/CodeGen/AArch64/load-combine.ll
  test/CodeGen/ARM/load-combine-big-endian.ll
  test/CodeGen/ARM/load-combine.ll
  test/CodeGen/X86/load-combine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29394.86624.patch
Type: text/x-patch
Size: 27211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170201/7b364341/attachment.bin>


More information about the llvm-commits mailing list