@@ -1370,7 +1370,7 @@ void SelectionDAG::init(MachineFunction &NewMF,
13701370 const TargetLibraryInfo *LibraryInfo,
13711371 UniformityInfo *NewUA, ProfileSummaryInfo *PSIin,
13721372 BlockFrequencyInfo *BFIin, MachineModuleInfo &MMIin,
1373- FunctionVarLocs const *VarLocs, bool HasDivergency ) {
1373+ FunctionVarLocs const *VarLocs) {
13741374 MF = &NewMF;
13751375 SDAGISelPass = PassPtr;
13761376 ORE = &NewORE;
@@ -1383,7 +1383,6 @@ void SelectionDAG::init(MachineFunction &NewMF,
13831383 BFI = BFIin;
13841384 MMI = &MMIin;
13851385 FnVarLocs = VarLocs;
1386- DivergentTarget = HasDivergency;
13871386}
13881387
13891388SelectionDAG::~SelectionDAG() {
@@ -2330,8 +2329,7 @@ SDValue SelectionDAG::getRegister(Register Reg, EVT VT) {
23302329 return SDValue(E, 0);
23312330
23322331 auto *N = newSDNode<RegisterSDNode>(Reg, VTs);
2333- N->SDNodeBits.IsDivergent =
2334- DivergentTarget && TLI->isSDNodeSourceOfDivergence(N, FLI, UA);
2332+ N->SDNodeBits.IsDivergent = TLI->isSDNodeSourceOfDivergence(N, FLI, UA);
23352333 CSEMap.InsertNode(N, IP);
23362334 InsertNode(N);
23372335 return SDValue(N, 0);
@@ -12069,8 +12067,6 @@ static bool gluePropagatesDivergence(const SDNode *Node) {
1206912067}
1207012068
1207112069bool SelectionDAG::calculateDivergence(SDNode *N) {
12072- if(!DivergentTarget)
12073- return false;
1207412070 if (TLI->isSDNodeAlwaysUniform(N)) {
1207512071 assert(!TLI->isSDNodeSourceOfDivergence(N, FLI, UA) &&
1207612072 "Conflicting divergence information!");
@@ -12090,8 +12086,6 @@ bool SelectionDAG::calculateDivergence(SDNode *N) {
1209012086}
1209112087
1209212088void SelectionDAG::updateDivergence(SDNode *N) {
12093- if (!DivergentTarget)
12094- return;
1209512089 SmallVector<SDNode *, 16> Worklist(1, N);
1209612090 do {
1209712091 N = Worklist.pop_back_val();
@@ -13639,20 +13633,16 @@ void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
1363913633 Ops[I].setInitial(Vals[I]);
1364013634 EVT VT = Ops[I].getValueType();
1364113635
13642- // Take care of the Node's operands iff target has divergence
1364313636 // Skip Chain. It does not carry divergence.
13644- if (DivergentTarget && VT != MVT::Other &&
13637+ if (VT != MVT::Other &&
1364513638 (VT != MVT::Glue || gluePropagatesDivergence(Ops[I].getNode())) &&
1364613639 Ops[I].getNode()->isDivergent()) {
13647- // Node is going to be divergent if at least one of its operand is
13648- // divergent, unless it belongs to the "AlwaysUniform" exemptions.
1364913640 IsDivergent = true;
1365013641 }
1365113642 }
1365213643 Node->NumOperands = Vals.size();
1365313644 Node->OperandList = Ops;
13654- // Check the divergence of the Node itself.
13655- if (DivergentTarget && !TLI->isSDNodeAlwaysUniform(Node)) {
13645+ if (!TLI->isSDNodeAlwaysUniform(Node)) {
1365613646 IsDivergent |= TLI->isSDNodeSourceOfDivergence(Node, FLI, UA);
1365713647 Node->SDNodeBits.IsDivergent = IsDivergent;
1365813648 }
0 commit comments