OSDN Git Service

After r147827 and r147902, it's now possible for unallocatable registers to be
authorEvan Cheng <evan.cheng@apple.com>
Sat, 14 Jan 2012 01:53:46 +0000 (01:53 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 14 Jan 2012 01:53:46 +0000 (01:53 +0000)
commitbfe8afaaec03795fe6c78daa9817e54c186a699d
tree2b94148a27276a4c8972152fc38401fe7656bcc8
parentd32d3b758f9ef682de35b7f567af36adf8666cfd
After r147827 and r147902, it's now possible for unallocatable registers to be
live across BBs before register allocation. This miscompiled 197.parser
when a cmp + b are optimized to a cbnz instruction even though the CPSR def
is live-in a successor.
        cbnz    r6, LBB89_12
...
LBB89_12:
        ble     LBB89_1

The fix consists of two parts. 1) Teach LiveVariables that some unallocatable
registers might be liveouts so don't mark their last use as kill if they are.
2) ARM constantpool island pass shouldn't form cbz / cbnz if the conditional
branch does not kill CPSR.

rdar://10676853

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148168 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/LiveVariables.cpp
lib/Target/ARM/ARMConstantIslandPass.cpp
test/CodeGen/Thumb2/2012-01-13-CBNZBug.ll [new file with mode: 0644]