[PATCH] D32476: [EarlyCSE] Remove guards with conditions known to be true

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 01:03:51 PDT 2017


mkazantsev created this revision.

If a condition is calculated only once, and there are multiple guards on this condition, we should be able
to remove all guards dominated by the first of them. This patch allows EarlyCSE to try to find the condition
of a guard among the known values, and if it is true, remove the guard. Otherwise we keep the guard and
mark its condition as 'true' for future consideration.


https://reviews.llvm.org/D32476

Files:
  lib/Transforms/Scalar/EarlyCSE.cpp
  test/Transforms/EarlyCSE/guards.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32476.96515.patch
Type: text/x-patch
Size: 10196 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170425/9962d0c3/attachment.bin>


More information about the llvm-commits mailing list