[PATCH] D68463: [ARM] Generate vcmp instead of vcmpe

Kristof Beyls via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 4 06:45:22 PDT 2019


kristof.beyls created this revision.
kristof.beyls added reviewers: t.p.northover, jmolloy, spatel, eli.friedman.
Herald added subscribers: dmgreen, hiraditya.
Herald added a project: LLVM.

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.


Repository:
  rL LLVM

https://reviews.llvm.org/D68463

Files:
  llvm/lib/Target/ARM/ARMFastISel.cpp
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMInstrInfo.td
  llvm/lib/Target/ARM/ARMInstrVFP.td
  llvm/test/CodeGen/ARM/2009-07-18-RewriterBug.ll
  llvm/test/CodeGen/ARM/arm-shrink-wrapping.ll
  llvm/test/CodeGen/ARM/compare-call.ll
  llvm/test/CodeGen/ARM/fcmp-xo.ll
  llvm/test/CodeGen/ARM/float-helpers.s
  llvm/test/CodeGen/ARM/fp16-instructions.ll
  llvm/test/CodeGen/ARM/fp16-promote.ll
  llvm/test/CodeGen/ARM/fpcmp.ll
  llvm/test/CodeGen/ARM/ifcvt11.ll
  llvm/test/CodeGen/ARM/swifterror.ll
  llvm/test/CodeGen/ARM/vcmp-crash.ll
  llvm/test/CodeGen/ARM/vfp.ll
  llvm/test/CodeGen/ARM/vsel-fp16.ll
  llvm/test/CodeGen/ARM/vsel.ll
  llvm/test/CodeGen/Thumb2/float-cmp.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpf.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfr.ll
  llvm/test/CodeGen/Thumb2/mve-vcmpfz.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68463.223208.patch
Type: text/x-patch
Size: 166325 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191004/252a1ac9/attachment-0001.bin>


More information about the llvm-commits mailing list