[PATCH] D92358: [AArch64][GlobalISel] Select Bcc when it's better than TB(N)Z

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 30 17:29:44 PST 2020


paquette created this revision.
paquette added a reviewer: aemerson.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls, rovka.
Herald added a project: LLVM.
paquette requested review of this revision.

Instead of falling back to selecting TB(N)Z when we fail to select an optimized compare against 0, select Bcc instead.

Also simplify selectCompareBranch a little while we're here, because the logic was kind of hard to follow.

At -O0, this is a 0.1% geomean code size improvement for CTMark.

A simple example of where this can kick in is here:
https://godbolt.org/z/4rra6P

In the example above, GlobalISel currently produces a subs, cset, and tbnz. SelectionDAG, on the other hand, just emits a compare and b.le.


https://reviews.llvm.org/D92358

Files:
  llvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp
  llvm/test/CodeGen/AArch64/GlobalISel/opt-and-tbnz-tbz.mir
  llvm/test/CodeGen/AArch64/GlobalISel/tbnz-slt.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92358.308508.patch
Type: text/x-patch
Size: 7187 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201201/052c2ebf/attachment.bin>


More information about the llvm-commits mailing list