Skip to content

Commit 11e5d1c

Browse files
authored
[AMDGPU] Respect existing glue when lowering convergence tokens (llvm#90834)
1 parent 79a6a7e commit 11e5d1c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3859,20 +3859,20 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
38593859
assert(Mask && "Missing call preserved mask for calling convention");
38603860
Ops.push_back(DAG.getRegisterMask(Mask));
38613861

3862-
if (InGlue.getNode())
3863-
Ops.push_back(InGlue);
3864-
3865-
// NOTE: This potentially results in *two* glue operands, and the wrong one
3866-
// might possibly show up where the other was intended. In particular,
3867-
// Emitter::EmitMachineNode() expects only the glued convergence token if it
3868-
// exists. Similarly, the selection of the call expects to match only the
3869-
// InGlue operand if it exists.
38703862
if (SDValue Token = CLI.ConvergenceControlToken) {
3871-
Ops.push_back(SDValue(DAG.getMachineNode(TargetOpcode::CONVERGENCECTRL_GLUE,
3872-
DL, MVT::Glue, Token),
3873-
0));
3863+
SmallVector<SDValue, 2> GlueOps;
3864+
GlueOps.push_back(Token);
3865+
if (InGlue)
3866+
GlueOps.push_back(InGlue);
3867+
3868+
InGlue = SDValue(DAG.getMachineNode(TargetOpcode::CONVERGENCECTRL_GLUE, DL,
3869+
MVT::Glue, GlueOps),
3870+
0);
38743871
}
38753872

3873+
if (InGlue)
3874+
Ops.push_back(InGlue);
3875+
38763876
SDVTList NodeTys = DAG.getVTList(MVT::Other, MVT::Glue);
38773877

38783878
// If we're doing a tall call, use a TC_RETURN here rather than an

0 commit comments

Comments
 (0)