[PATCH] [GVN] Eliminate redundant loads whose addresses are dependent on the result of a select instruction.

Chad Rosier mcrosier at codeaurora.org
Thu Mar 12 12:34:23 PDT 2015


Revised patch with the following changes:
-Reworked the code so that we now use def-use and use-def, rather than iterate over all instructions in the block.
-Store can now feed the select.  I.e.,

  a = (load (gep ptr_a 0 0))
  store b (gep ptr_b 0 0))
  c = (load (gep (select (cond, ptr_a, ptr_b)) 0 0))
  -->
  a = (load (gep ptr_a, 0, 0))
  store b (gep ptr_b 0 0))
  c = (select (cond, a, b))

There were no correctness or performance regressions across spec2000, spec2006, and eembc on an A57 device.  The only benchmarks that hit this transform are spec2000/gcc, spec2000/vpr, and spec2006/dealII.  I saw a ~1% improvement in vpr, but that's basically noise. :o/

Also, adding Daniel B. to the reviews as he seems to be working in this area as of late.

All, please have a look.

Chad


http://reviews.llvm.org/D8120

Files:
  lib/Transforms/Scalar/GVN.cpp
  test/Transforms/GVN/load-gep-select.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8120.21867.patch
Type: text/x-patch
Size: 10227 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150312/418ee78f/attachment.bin>


More information about the llvm-commits mailing list