3 Commits

Author SHA1 Message Date
Tim Northover
0487bd8f42 ARM: use target-specific SUBS node when combining cmp with cmov.
This has two positive effects. First, using a custom node prevents
recombination leading to an infinite loop since the output DAG is notionally a
little more complex than the input one. Using a flag-setting instruction also
allows the subtraction to be folded with the related comparison more easily.

https://reviews.llvm.org/D53190

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348122 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-03 11:16:21 +00:00
Roger Ferrer Ibanez
ca353f0f9c [ARM] Materialise some boolean values to avoid a branch
This patch combines some cases of ARMISD::CMOV for integers that arise in comparisons of the form

  a != b ? x : 0
  a == b ? 0 : x

and that currently (e.g. in Thumb1) are emitted as branches.

Differential Revision: https://reviews.llvm.org/D34515



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325323 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-16 09:23:59 +00:00
Sam Parker
6d5e445dba [ARM] Swap cmp operands for automatic shifts
Swap the compare operands if the lhs is a shift and the rhs isn't,
as in arm and T2 the shift can be performed by the compare for its
second operand.

Differential Revision: https://reviews.llvm.org/D39004


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316562 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25 08:33:06 +00:00