OSDN Git Service

[ARM] Favour PL/MI over GE/LT when possible
authorDavid Green <david.green@arm.com>
Thu, 4 Jul 2019 08:58:58 +0000 (08:58 +0000)
committerDavid Green <david.green@arm.com>
Thu, 4 Jul 2019 08:58:58 +0000 (08:58 +0000)
commit963f1fa4ace25fc1198d92efd8a42de64157cb55
treeb8706ccf28b18dcef79812181a0ebd5c8333dc09
parent867300b482034e97e97ea6a7cceb3456cd99a345
[ARM] Favour PL/MI over GE/LT when possible

The arm condition codes for GE is N==V (and for LT is N!=V). If the source of
flags cannot set V (overflow), such as a cmp against #0, then we can use the
simpler PL and MI conditions that only check N. As these PL/MI conditions are
simpler than GE/LT, other passes like the peephole optimiser can have a better
time optimising away the redundant CMPs.

The exception is the VSEL instruction, which cannot take the PL code, so there
the transform favours GE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365117 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/code-placement.ll
test/CodeGen/ARM/hoist-and-by-const-from-lshr-in-eqcmp-zero.ll
test/CodeGen/ARM/hoist-and-by-const-from-shl-in-eqcmp-zero.ll
test/CodeGen/ARM/long_shift.ll
test/CodeGen/ARM/sat-to-bitop.ll
test/CodeGen/ARM/select.ll
test/CodeGen/ARM/shift-i64.ll
test/CodeGen/Thumb/select.ll