[llvm] [RFC] TableGen-erate SDNode descriptions (PR #119709)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 09:32:30 PST 2024
================
@@ -688,22 +687,6 @@ END_TWO_BYTE_PACK()
/// \<target\>ISD namespace).
bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
- /// Test if this node has a target-specific opcode that may raise
- /// FP exceptions (in the \<target\>ISD namespace and greater than
- /// FIRST_TARGET_STRICTFP_OPCODE). Note that all target memory
- /// opcode are currently automatically considered to possibly raise
- /// FP exceptions as well.
- bool isTargetStrictFPOpcode() const {
- return NodeType >= ISD::FIRST_TARGET_STRICTFP_OPCODE;
- }
-
- /// Test if this node has a target-specific
- /// memory-referencing opcode (in the \<target\>ISD namespace and
- /// greater than FIRST_TARGET_MEMORY_OPCODE).
- bool isTargetMemoryOpcode() const {
----------------
s-barannikov wrote:
I remembered it has one more "use". Before this patch it is implicitly checked [here](https://github.com/llvm/llvm-project/blob/73731d6873b6fb0757c3065aaf2452eaccd0eebc/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp#L4398). `isTargetStrictFPOpcode` returns true for memory opcodes as well. `mayRaiseFPException` is then used [here](https://github.com/llvm/llvm-project/blob/73731d6873b6fb0757c3065aaf2452eaccd0eebc/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp#L4227) to decide whether the resulting MachineInstr needs `NoFPExcept` flag. IIUC it will *not* set this flag on MachineInstrs if the matched SDNode(s) are flagged as memory accessing.
This behavior was introduced in 63336795. I couldn't conclude if it is safe to return false for memory opcodes so I left it as is.
After this patch the check is explicit, please see `SelectionDAGTargetInfo.cpp:mayRaiseFPException`.
https://github.com/llvm/llvm-project/pull/119709
More information about the llvm-commits
mailing list