@@ -9531,6 +9531,11 @@ void SelectionDAGBuilder::populateCallLoweringInfo(
9531
9531
Call->countOperandBundlesOfType (LLVMContext::OB_preallocated) != 0 );
9532
9532
}
9533
9533
9534
+ // Is the node `N` a glue or chain node?
9535
+ bool isGlueOrChain (const SDValue &N) {
9536
+ return (N.getValueType () == MVT::Other) || (N.getValueType () == MVT::Glue);
9537
+ }
9538
+
9534
9539
// / Given the stackmap live variable `N`, search its sub-DAG and return all of
9535
9540
// / the constituent values that need to be reported in the stackmap table.
9536
9541
static std::vector<SDValue> findLiveConstituents (SelectionDAG &DAG,
@@ -9542,8 +9547,11 @@ static std::vector<SDValue> findLiveConstituents(SelectionDAG &DAG,
9542
9547
case ISD::CONCAT_VECTORS:
9543
9548
case ISD::MERGE_VALUES:
9544
9549
case ISD::BUILD_VECTOR:
9545
- for (SDValue Op : N->op_values ())
9546
- V.push_back (Op);
9550
+ for (SDValue Op : N->op_values ()) {
9551
+ if (!isGlueOrChain (Op)) {
9552
+ V.push_back (Op);
9553
+ }
9554
+ }
9547
9555
break ;
9548
9556
case ISD::INSERT_VECTOR_ELT: {
9549
9557
V = findLiveConstituents (DAG, N.getOperand (0 ));
@@ -9556,6 +9564,14 @@ static std::vector<SDValue> findLiveConstituents(SelectionDAG &DAG,
9556
9564
V.push_back (N);
9557
9565
}
9558
9566
9567
+ // We have to be careful not to ask the stackmap to record the locations
9568
+ // of glue or chain operands. That would make no sense, as glue and chain
9569
+ // operands are not real data, rather control dependencies that are an
9570
+ // artefact of using a DAG.
9571
+ for (SDValue &VV: V) {
9572
+ assert (!isGlueOrChain (VV));
9573
+ }
9574
+
9559
9575
return V;
9560
9576
}
9561
9577
0 commit comments