1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/CodeGenPrepare
David Green 99f589780c [CPG][ARM] Optimize towards branch on zero in codegenprepare
This adds a simple fold into codegenprepare that converts comparison of
branches towards comparison with zero if possible. For example:
  %c = icmp ult %x, 8
  br %c, bla, blb
  %tc = lshr %x, 3
becomes
  %tc = lshr %x, 3
  %c = icmp eq %tc, 0
  br %c, bla, blb

As a first order approximation, this can reduce the number of
instructions needed to perform the branch as the shift is (often) needed
anyway. At the moment this does not effect very much, as llvm tends to
prefer the opposite form. But it can protect against regressions from
commits like rG9423f78240a2.

Simple cases of Add and Sub are added along with Shift, equally as the
comparison to zero can often be folded with cpsr flags.

Differential Revision: https://reviews.llvm.org/D101778
2021-05-16 17:54:06 +01:00
..
AArch64
AMDGPU
ARM [CPG][ARM] Optimize towards branch on zero in codegenprepare 2021-05-16 17:54:06 +01:00
Mips
NVPTX
PowerPC
SPARC
X86 [Utils] recognizeBSwapOrBitReverseIdiom - support matching from funnel shift roots (PR40058) 2021-05-04 13:46:45 +01:00
dom-tree.ll
sink-shift-and-trunc.ll
skip-merging-case-block.ll