[SelectionDAG] Fix operand of BRCOND in visitSPDescriptorParent#174230
Merged
s-barannikov merged 2 commits intollvm:mainfrom Jan 2, 2026
Merged
[SelectionDAG] Fix operand of BRCOND in visitSPDescriptorParent#174230s-barannikov merged 2 commits intollvm:mainfrom
s-barannikov merged 2 commits intollvm:mainfrom
Conversation
The first operand should be a chain, but `GuardVal.getOperand(0)` isn't always a chain (i.e. if `TLI.emitStackGuardXorFP()` is called). Use `getControlRoot()` instead like in other places when creating terminator nodes. Extracted from llvm#168421
Member
|
@llvm/pr-subscribers-llvm-selectiondag Author: Sergei Barannikov (s-barannikov) ChangesThe first operand should be a chain, but Extracted from #168421 Full diff: https://github.com/llvm/llvm-project/pull/174230.diff 1 Files Affected:
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index ba70484ccd034..f127d5ae1592f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -3186,7 +3186,7 @@ void SelectionDAGBuilder::visitSPDescriptorParent(StackProtectorDescriptor &SPD,
// If the guard/stackslot do not equal, branch to failure MBB.
SDValue BrCond = DAG.getNode(ISD::BRCOND, dl,
- MVT::Other, GuardVal.getOperand(0),
+ MVT::Other, getControlRoot(),
Cmp, DAG.getBasicBlock(SPD.getFailureMBB()));
// Otherwise branch to success MBB.
SDValue Br = DAG.getNode(ISD::BR, dl,
|
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
Collaborator
|
Title is incorrect. This isn't changing the return type. |
Contributor
Author
|
Right, I fixed the description |
mahesh-attarde
pushed a commit
to mahesh-attarde/llvm-project
that referenced
this pull request
Jan 6, 2026
…#174230) The first operand should be a chain, but `GuardVal.getOperand(0)` isn't always a chain (i.e. if `TLI.emitStackGuardXorFP()` is called). Use `getControlRoot()` instead like in other places when creating terminator nodes. Extracted from llvm#168421.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first operand should be a chain, but
GuardVal.getOperand(0)isn't always a chain (i.e. ifTLI.emitStackGuardXorFP()is called). UsegetControlRoot()instead like in other places when creating terminator nodes.Extracted from #168421