[PATCH] D59317: [ARM] Search backwards for CMP when combining into CBZ

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 13 12:46:24 PDT 2019


dmgreen created this revision.
dmgreen added reviewers: efriedma, jmolloy, t.p.northover, samparker.
Herald added subscribers: hiraditya, kristof.beyls, javed.absar.
Herald added a project: LLVM.

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.

The test case is new, I have just shown the differences for clarity.


https://reviews.llvm.org/D59317

Files:
  llvm/lib/Target/ARM/ARMConstantIslandPass.cpp
  llvm/test/CodeGen/Thumb2/constant-islands-cbz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59317.190469.patch
Type: text/x-patch
Size: 4689 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190313/8b762c19/attachment.bin>


More information about the llvm-commits mailing list