[llvm] [SelectionDAG] Virtualize isTargetStrictFPOpcode / isTargetMemoryOpcode (PR #119969)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 21 18:59:07 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;
----------------
s-barannikov wrote:

I see your point now. This may work well for strict-fp opcodes, but it will be more difficult to implement for memory opcodes.

Not all memory opcodes will be generated, because some targets do not provide a tablegen description for all memory nodes. This means that some enum members will have to be assigned a value by hand, and this won't look pretty.

Some target that provide tablegen descriptons for memory nodes do not set SDNPMemOperand property on them. As a result, the generated enum values will not have the "memory bit" set, and there is no way to change the enum value included from a generated file.

In the future, we may want to add more properties (e.g., `isBinOp`), which I think is by itself a good justification for adding a separate field for them rather than encoding them in the opcode.


https://github.com/llvm/llvm-project/pull/119969


More information about the llvm-commits mailing list