OSDN Git Service

[IfConversion] Remove kill flags from common instructions as well
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 6 Sep 2017 17:57:13 +0000 (17:57 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 6 Sep 2017 17:57:13 +0000 (17:57 +0000)
commit7e5553d4f2039d3ebec6a86771b2c7b13796184d
treea0b614376b3641c706db7b42fef6b1422d6a5552
parent02ac39c41756a6d249c1cb0dbbfe537581bac2da
[IfConversion] Remove kill flags from common instructions as well

When if-converting a diamond, two separate blocks will be placed back
to back to form a straight line code. To ensure correctness of the
liveness information, any registers that are live in the second block
should not be killed in the first block, even if they were in the
original code.
Additionally, when the two blocks share common instructions at the
beginning, these instructions will not be duplicated, but only placed
once, before both of the blocks. Since the function "isIdenticalTo"
(as used here) ignores kill flags, the common initial code in one
block may have a kill flag for a register that is live in the other
block.
Because the code that removes kill flags only runs for the non-common
parts of the predicated blocks, a kill flag mismatch in the common
code could still lead to a live register being killed prematurely.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312654 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/IfConversion.cpp
test/CodeGen/Hexagon/ifcvt-common-kill.mir [new file with mode: 0644]