[PATCH] D69281: [FPEnv][WIP] Constrained FCmp intrinsics

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 14:14:03 PDT 2019


uweigand created this revision.
uweigand added reviewers: cameron.mcinally, craig.topper, andrew.w.kaylor, kpn, kristof.beyls.
Herald added subscribers: llvm-commits, jdoerfert.
Herald added a project: LLVM.

This is a continuation of https://reviews.llvm.org/D54649, which was abandoned by @cameron.mcinally

The major differences to Cameron's approach include:

- I did not actually require any TableGen changes, but was able to represent the overloaded intrinsic types using existing mechanisms.  This solution looks correct to me, but if I'm missing anything here, please let me know ...
- This adds a full set of compare intrinsics for all comparison codes.
- I've added (mostly) complete SystemZ back-end support to actually generate correct code for all of them -- this is also to verify that the use of Custom expansion of strict operations actually allows the back-end to do what it needs to do.

This patch is still not complete, but I wanted to show it now to ask for feedback.

Some areas that definitely need more work are:

- Vector type legalization of invalid vector types involving STRICT_FSETCC doesn't work yet.
- Signalling comparisons are not supported yet.
- We may also need strict versions of SELECT_CC and BR_CC.  I haven't implemented those yet since they aren't really necessary for SystemZ, but some other platforms may require them.
- The X86 back-end changes are incomplete, they're right now the bare minimum to keep Cameron's two test cases working.
- There are many SETCC-related transformations and optimizations in the SelectionDAG codegen.  Many of these are also valid for the strict FP case.  I haven't found a simple way yet to write those transformations so that can easily handle both cases without duplicating a lot of boilerplate code ...   Right now the patch implements the minimum set of those to get the SystemZ test cases to work (at least generating the same code as the non-strict versions for extremely simple use cases).


Repository:
  rL LLVM

https://reviews.llvm.org/D69281

Files:
  include/llvm/CodeGen/ISDOpcodes.h
  include/llvm/CodeGen/SelectionDAGNodes.h
  include/llvm/CodeGen/TargetLowering.h
  include/llvm/IR/IntrinsicInst.h
  include/llvm/IR/Intrinsics.td
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
  lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  lib/IR/Verifier.cpp
  lib/Target/SystemZ/SystemZISelLowering.cpp
  lib/Target/SystemZ/SystemZISelLowering.h
  lib/Target/SystemZ/SystemZInstrFP.td
  lib/Target/SystemZ/SystemZInstrVector.td
  lib/Target/SystemZ/SystemZOperators.td
  lib/Target/SystemZ/SystemZPatterns.td
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/SystemZ/fp-strict-cmp-01.ll
  test/CodeGen/SystemZ/fp-strict-cmp-02.ll
  test/CodeGen/SystemZ/fp-strict-cmp-03.ll
  test/CodeGen/SystemZ/fp-strict-cmp-04.ll
  test/CodeGen/SystemZ/fp-strict-cmp-06.ll
  test/CodeGen/SystemZ/vec-strict-cmp-05.ll
  test/CodeGen/SystemZ/vec-strict-cmp-06.ll
  test/CodeGen/SystemZ/vec-strict-cmp-07.ll
  test/CodeGen/X86/fp-intrinsics.ll
  test/CodeGen/X86/vector-constrained-fp-intrinsics-cmp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69281.225954.patch
Type: text/x-patch
Size: 169295 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191021/67c7b774/attachment-0001.bin>


More information about the llvm-commits mailing list