[PATCH] D74149: [AArch64][GlobalISel] Emit TBZ for SGT cond branches against -1

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 6 11:10:05 PST 2020


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: Petar.Avramovic, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.

When we have a G_BRCOND fed by a sgt compare against -1, we can just emit a TBZ.

This is similar to the code in `AArch64TargetLowering::LowerBR_CC`.

Also while we're here, properly scope the commutative constant check in `selectCompareBranch`, since it sometimes would call `getConstantVRegValWithLookThrough` twice.


https://reviews.llvm.org/D74149

Files:
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/tbz-sgt.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74149.242956.patch
Type: text/x-patch
Size: 6521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200206/6f97f237/attachment-0001.bin>


More information about the llvm-commits mailing list