[PowerPC] Fix fast-isel when compare is split from branch
authorHal Finkel <hfinkel@anl.gov>
Sat, 23 May 2015 12:18:10 +0000 (12:18 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sat, 23 May 2015 12:18:10 +0000 (12:18 +0000)
commit43a5aa62d467eecb5ab44d3d6aad9cb33da714c5
tree3749b1d39294ff248ad2cf5913acb75047738e7a
parentc1c3e6c7ecd9fdf3c901e0cfec62578c2ced0a53
[PowerPC] Fix fast-isel when compare is split from branch

When the compare feeding a branch was in a different BB from the branch, we'd
try to "regenerate" the compare in the block with the branch, possibly trying
to make use of values not available there. Copy a page from AArch64's play book
here to fix the problem (at least in terms of correctness).

Fixes PR23640.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238097 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCFastISel.cpp
test/CodeGen/PowerPC/fast-isel-icmp-split.ll [new file with mode: 0644]