]> granicus.if.org Git - llvm/commit
[ARM] Generate vcmp instead of vcmpe
authorKristof Beyls <kristof.beyls@arm.com>
Tue, 8 Oct 2019 08:25:42 +0000 (08:25 +0000)
committerKristof Beyls <kristof.beyls@arm.com>
Tue, 8 Oct 2019 08:25:42 +0000 (08:25 +0000)
commit2a0eea05ecf213f2cfffb74c4245abe6963d2957
tree5f52e0361e25b9a6d85f654de3c04cb5be707732
parentc7712cd897d63f37f68863566ce01539cd21fbc1
[ARM] Generate vcmp instead of vcmpe

Based on the discussion in
http://lists.llvm.org/pipermail/llvm-dev/2019-October/135574.html, the
conclusion was reached that the ARM backend should produce vcmp instead
of vcmpe instructions by default, i.e. not be producing an Invalid
Operation exception when either arguments in a floating point compare
are quiet NaNs.

In the future, after constrained floating point intrinsics for floating
point compare have been introduced, vcmpe instructions probably should
be produced for those intrinsics - depending on the exact semantics
they'll be defined to have.

This patch logically consists of the following parts:
- Revert http://llvm.org/viewvc/llvm-project?rev=294945&view=rev and
  http://llvm.org/viewvc/llvm-project?rev=294968&view=rev, which
  implemented fine-tuning for when to produce vcmpe (i.e. not do it for
  equality comparisons). The complexity introduced by those patches
  isn't needed anymore if we just always produce vcmp instead. Maybe
  these patches need to be reintroduced again once support is needed to
  map potential LLVM-IR constrained floating point compare intrinsics to
  the ARM instruction set.
- Simply select vcmp, instead of vcmpe, see simple changes in
  lib/Target/ARM/ARMInstrVFP.td
- Adapt lots of tests that tested for vcmpe (instead of vcmp). For all
  of these test, the intent of what is tested for isn't related to
  whether the vcmp should produce an Invalid Operation exception or not.

Fixes PR43374.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374025 91177308-0d34-0410-b5e6-96231b3b80d8
23 files changed:
lib/Target/ARM/ARMFastISel.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMISelLowering.h
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMInstrVFP.td
test/CodeGen/ARM/2009-07-18-RewriterBug.ll
test/CodeGen/ARM/arm-shrink-wrapping.ll
test/CodeGen/ARM/compare-call.ll
test/CodeGen/ARM/fcmp-xo.ll
test/CodeGen/ARM/float-helpers.s
test/CodeGen/ARM/fp16-instructions.ll
test/CodeGen/ARM/fp16-promote.ll
test/CodeGen/ARM/fpcmp.ll
test/CodeGen/ARM/ifcvt11.ll
test/CodeGen/ARM/swifterror.ll
test/CodeGen/ARM/vcmp-crash.ll [deleted file]
test/CodeGen/ARM/vfp.ll
test/CodeGen/ARM/vsel-fp16.ll
test/CodeGen/ARM/vsel.ll
test/CodeGen/Thumb2/float-cmp.ll
test/CodeGen/Thumb2/mve-vcmpf.ll
test/CodeGen/Thumb2/mve-vcmpfr.ll
test/CodeGen/Thumb2/mve-vcmpfz.ll