[AArch64][GlobalISel] Emit TBNZ with G_BRCOND where the condition is SLT
authorJessica Paquette <jpaquette@apple.com>
Wed, 5 Feb 2020 21:54:00 +0000 (13:54 -0800)
committerJessica Paquette <jpaquette@apple.com>
Wed, 5 Feb 2020 23:23:54 +0000 (15:23 -0800)
commita3738414072900ace9cbbe209d0195a3443d1d54
treefda7d5ab711521b0894f811f7ba3f01c21f8c032
parent42c906bceffaadeb704f2629d21f33aece831bc6
[AArch64][GlobalISel] Emit TBNZ with G_BRCOND where the condition is SLT

When we have a G_ICMP which checks SLT, and the comparison is against 0, we
can emit a TBNZ instead of a CBZ.

This lets us fold in things into the branch, which can provide some code size
savings.

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

https://reviews.llvm.org/D74090
llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
llvm/test/CodeGen/AArch64/GlobalISel/tbnz-slt.mir [new file with mode: 0644]