OSDN Git Service

IfConversion: Rescan diamonds.
authorKyle Butt <kyle+llvm@iteratee.net>
Wed, 24 Aug 2016 21:34:24 +0000 (21:34 +0000)
committerKyle Butt <kyle+llvm@iteratee.net>
Wed, 24 Aug 2016 21:34:24 +0000 (21:34 +0000)
commitb711924e7abcbb9aee01de1337747c573906e3e7
tree2f76fda5b4e4cbd4da7730d02c1bbf0d8172d71d
parentb55d189bbcde15d708446215cb4410eec5f4c14d
IfConversion: Rescan diamonds.

The cost of predicating a diamond is only the instructions that are not shared
between the two branches. Additionally If a predicate clobbering instruction
occurs in the shared portion of the branches (e.g. a cond move), it may still
be possible to if convert the sub-cfg. This change handles these two facts by
rescanning the non-shared portion of a diamond sub-cfg to recalculate both the
predication cost and whether both blocks are pred-clobbering.

Fixed 2 bugs before recommitting. Branch instructions must be compared and found
identical before diamond conversion. Also, predicate-clobbering instructions in
the shared prefix disqualifies a potential diamond conversion. Includes tests
for both.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279670 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/IfConversion.cpp
test/CodeGen/ARM/indirectbr-3.ll
test/CodeGen/Thumb2/ifcvt-rescan-bug-2016-08-22.ll [new file with mode: 0644]