[PATCH] D45576: [RFC] Allow target to handle STRICT floating-point nodes

Ulrich Weigand via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 09:54:39 PDT 2018


uweigand created this revision.
Herald added a subscriber: llvm-commits.

The ISD::STRICT_ nodes used to implement the constrained floating-point intrinsics are currently never passed to the target back-end, which makes it impossible to handle them correctly (e.g. mark instructions are depending on a floating-point status and control register, or mark instructions as possibly trapping).

This patch allows the target to use setOperationAction to switch the action on ISD::STRICT_ nodes to Legal.  If this is done, the SelectionDAG common code will stop converting the STRICT nodes to regular floating-point nodes, but instead pass the STRICT nodes to the target using normal SelectionDAG matching rules.

The patch also implements support for this feature in the SystemZ back-end for all the STRICT nodes currently supported.  This involves basically duplicating all FP patterns in the .td files, with one copy handling the normal FP node and another copy handling the STRICT FP node.  However, most of that duplication is hidden via use of a number of multiclasses, so the maintainability of the actual .td files is preserved.

Note: I'm not asking for review to commit the patch as-is.  (For one, it is still missing test cases.)  However, I'm submitting the patch now in the hope to receive comments and feedback, so we can decide whether this approach is the way forward or not.


Repository:
  rL LLVM

https://reviews.llvm.org/D45576

Files:
  include/llvm/Target/TargetSelectionDAG.td
  lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  lib/Target/SystemZ/SystemZISelLowering.cpp
  lib/Target/SystemZ/SystemZInstrFP.td
  lib/Target/SystemZ/SystemZInstrFormats.td
  lib/Target/SystemZ/SystemZOperators.td
  lib/Target/SystemZ/SystemZRegisterInfo.cpp
  lib/Target/SystemZ/SystemZRegisterInfo.td
  lib/Target/SystemZ/SystemZScheduleZ13.td
  lib/Target/SystemZ/SystemZScheduleZ14.td
  lib/Target/SystemZ/SystemZScheduleZ196.td
  lib/Target/SystemZ/SystemZScheduleZEC12.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45576.142205.patch
Type: text/x-patch
Size: 41911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180412/56694bf3/attachment.bin>


More information about the llvm-commits mailing list