[PATCH] D56242: Elevate instructions across if-else blocks for better constant propagation

Ayonam Ray via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 2 20:20:56 PST 2019


ayonam created this revision.
ayonam added reviewers: majnemer, lebedev.ri.
Herald added subscribers: mgorny, mehdi_amini.

This patch implements elevating instructions across basic blocks that can help in better constant propagation.  If there are values that are set to different constants in different blocks of an if-else statement, then elevating the dependent instructions to those blocks individually can help in constant propagation through the dependent instructions.  In the test case that has been added, it results in elimination of a few computations via constant folding.


https://reviews.llvm.org/D56242

Files:
  include/llvm/InitializePasses.h
  include/llvm/LinkAllPasses.h
  include/llvm/Transforms/Scalar.h
  include/llvm/Transforms/Scalar/Elevate.h
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/Scalar/CMakeLists.txt
  lib/Transforms/Scalar/Elevate.cpp
  lib/Transforms/Scalar/Scalar.cpp
  test/Transforms/Elevate/elevate-if-else.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56242.179993.patch
Type: text/x-patch
Size: 25489 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190103/8b24454c/attachment.bin>


More information about the llvm-commits mailing list