[llvm] Reland "[SelectionDAG] Introducing a new ISD::POISON SDNode to represent the poison value in the IR." (PR #135056)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 07:16:41 PDT 2025


================
@@ -692,8 +692,10 @@ END_TWO_BYTE_PACK()
   /// \<target\>ISD namespace).
   bool isTargetOpcode() const { return NodeType >= ISD::BUILTIN_OP_END; }
 
-  /// Return true if the type of the node type undefined.
-  bool isUndef() const { return NodeType == ISD::UNDEF; }
+  /// Returns true if the node type is UNDEF or POISON.
+  bool isUndef() const {
----------------
diggerlin wrote:

> IMO it would be better to rename this to `isUndefOrPoison`, since the two are not the same...

we had a discuss on the function name in the https://github.com/llvm/llvm-project/pull/125883#discussion_r1944609060 and https://github.com/llvm/llvm-project/pull/125883#discussion_r1954310207  `I agree that isUndef() should include poison by default.`

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


More information about the llvm-commits mailing list