OSDN Git Service

[ARM] Search backwards for CMP when combining into CBZ
authorDavid Green <david.green@arm.com>
Sun, 17 Mar 2019 16:11:22 +0000 (16:11 +0000)
committerDavid Green <david.green@arm.com>
Sun, 17 Mar 2019 16:11:22 +0000 (16:11 +0000)
commit301f1518084c2361aab194b6403de5aa4bfb941b
treeb2b261ea7f35d73c5a73b63475a7a1db7e0ddd7a
parent99f94bb32f3e8353a2a5e2606d11c4d953bd65ce
[ARM] Search backwards for CMP when combining into CBZ

The constant island pass currently only looks at the instruction immediately
before a branch for a CMP to fold into a CBZ/CBNZ. This extends it to search
backwards for the instruction that defines CPSR. We need to ensure that the
register is not overridden between the CMP and the branch.

Differential Revision: https://reviews.llvm.org/D59317

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356336 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMConstantIslandPass.cpp
test/CodeGen/Thumb2/constant-islands-cbz.ll
test/CodeGen/Thumb2/constant-islands-cbz.mir