Skip to content

Conversation

@topperc
Copy link
Collaborator

@topperc topperc commented Oct 31, 2025

No description provided.

@topperc topperc requested a review from arsenm October 31, 2025 21:48
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label Oct 31, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 31, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

Changes

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

1 Files Affected:

  • (modified) llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp (+4-18)
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index bf1abfe50327e..1178b6fba6f0b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -3957,28 +3957,14 @@ SDValue DAGTypeLegalizer::SoftPromoteHalfOp_ATOMIC_STORE(SDNode *N,
 SDValue DAGTypeLegalizer::SoftPromoteHalfOp_STACKMAP(SDNode *N, unsigned OpNo) {
   assert(OpNo > 1); // Because the first two arguments are guaranteed legal.
   SmallVector<SDValue> NewOps(N->ops());
-  SDValue Op = N->getOperand(OpNo);
-  NewOps[OpNo] = GetSoftPromotedHalf(Op);
-  SDValue NewNode =
-      DAG.getNode(N->getOpcode(), SDLoc(N), N->getVTList(), NewOps);
-
-  for (unsigned ResNum = 0; ResNum < N->getNumValues(); ResNum++)
-    ReplaceValueWith(SDValue(N, ResNum), NewNode.getValue(ResNum));
-
-  return SDValue(); // Signal that we replaced the node ourselves.
+  NewOps[OpNo] = GetSoftPromotedHalf(NewOps[OpNo]);
+  return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
 }
 
 SDValue DAGTypeLegalizer::SoftPromoteHalfOp_PATCHPOINT(SDNode *N,
                                                        unsigned OpNo) {
   assert(OpNo >= 7);
   SmallVector<SDValue> NewOps(N->ops());
-  SDValue Op = N->getOperand(OpNo);
-  NewOps[OpNo] = GetSoftPromotedHalf(Op);
-  SDValue NewNode =
-      DAG.getNode(N->getOpcode(), SDLoc(N), N->getVTList(), NewOps);
-
-  for (unsigned ResNum = 0; ResNum < N->getNumValues(); ResNum++)
-    ReplaceValueWith(SDValue(N, ResNum), NewNode.getValue(ResNum));
-
-  return SDValue(); // Signal that we replaced the node ourselves.
+  NewOps[OpNo] = GetSoftPromotedHalf(NewOps[OpNo]);
+  return SDValue(DAG.UpdateNodeOperands(N, NewOps), 0);
 }

@topperc topperc merged commit 4357fcb into llvm:main Nov 1, 2025
12 checks passed
@topperc topperc deleted the pr/softpromotehalf-stackmap-patchpoint branch November 1, 2025 06:30
topperc added a commit that referenced this pull request Nov 1, 2025
…TACKMAP/PATCHPOINT. (#165927)"

This reverts commit 4357fcb.

Causes a crash when combined with #165922.
DEBADRIBASAK pushed a commit to DEBADRIBASAK/llvm-project that referenced this pull request Nov 3, 2025
DEBADRIBASAK pushed a commit to DEBADRIBASAK/llvm-project that referenced this pull request Nov 3, 2025
…TACKMAP/PATCHPOINT. (llvm#165927)"

This reverts commit 4357fcb.

Causes a crash when combined with llvm#165922.
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.

3 participants