Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Jul 29, 2025

I believe it checks the result number in addition to the SDNode*. SDNode::isOperandOf only checks the SDNode*.

…Of. NFC

I believe it checks the result number in addition to the SDNode *.
SDNode::isOperandOf only checks the SDNode.
@topperc topperc requested review from RKSimon and arsenm July 29, 2025 22:25
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label Jul 29, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 29, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

Changes

I believe it checks the result number in addition to the SDNode*. SDNode::isOperandOf only checks the SDNode*.


Full diff: https://github.com/llvm/llvm-project/pull/151244.diff

2 Files Affected:

  • (modified) llvm/include/llvm/CodeGen/SelectionDAGNodes.h (+1-1)
  • (modified) llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (+1-1)
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
index 8f88811be9c01..11ae8cd5eb77a 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -182,7 +182,7 @@ class SDValue {
     return SDValue(Node, R);
   }
 
-  /// Return true if this node is an operand of N.
+  /// Return true if the referenced return value is an operand of N.
   LLVM_ABI bool isOperandOf(const SDNode *N) const;
 
   /// Return the ValueType of the referenced return value.
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5c586f73aa125..4e0cdc0168388 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -12741,7 +12741,7 @@ bool SDNode::areOnlyUsersOf(ArrayRef<const SDNode *> Nodes, const SDNode *N) {
   return Seen;
 }
 
-/// isOperand - Return true if this node is an operand of N.
+/// Return true if the referenced return value is an operand of N.
 bool SDValue::isOperandOf(const SDNode *N) const {
   return is_contained(N->op_values(), *this);
 }

@topperc topperc merged commit 2737d01 into llvm:main Jul 31, 2025
11 checks passed
@topperc topperc deleted the pr/operandof branch July 31, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:SelectionDAG SelectionDAGISel as well

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants