@@ -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);
@@ -12180,8 +12178,6 @@ static bool gluePropagatesDivergence(const SDNode *Node) {
1218012178}
1218112179
1218212180bool SelectionDAG::calculateDivergence(SDNode *N) {
12183- if (!DivergentTarget)
12184- return false;
1218512181 if (TLI->isSDNodeAlwaysUniform(N)) {
1218612182 assert(!TLI->isSDNodeSourceOfDivergence(N, FLI, UA) &&
1218712183 "Conflicting divergence information!");
@@ -12201,8 +12197,6 @@ bool SelectionDAG::calculateDivergence(SDNode *N) {
1220112197}
1220212198
1220312199void SelectionDAG::updateDivergence(SDNode *N) {
12204- if (!DivergentTarget)
12205- return;
1220612200 SmallVector<SDNode *, 16> Worklist(1, N);
1220712201 do {
1220812202 N = Worklist.pop_back_val();
@@ -13763,20 +13757,16 @@ void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
1376313757 Ops[I].setInitial(Vals[I]);
1376413758 EVT VT = Ops[I].getValueType();
1376513759
13766- // Take care of the Node's operands iff target has divergence
1376713760 // Skip Chain. It does not carry divergence.
13768- if (DivergentTarget && VT != MVT::Other &&
13761+ if (VT != MVT::Other &&
1376913762 (VT != MVT::Glue || gluePropagatesDivergence(Ops[I].getNode())) &&
1377013763 Ops[I].getNode()->isDivergent()) {
13771- // Node is going to be divergent if at least one of its operand is
13772- // divergent, unless it belongs to the "AlwaysUniform" exemptions.
1377313764 IsDivergent = true;
1377413765 }
1377513766 }
1377613767 Node->NumOperands = Vals.size();
1377713768 Node->OperandList = Ops;
13778- // Check the divergence of the Node itself.
13779- if (DivergentTarget && !TLI->isSDNodeAlwaysUniform(Node)) {
13769+ if (!TLI->isSDNodeAlwaysUniform(Node)) {
1378013770 IsDivergent |= TLI->isSDNodeSourceOfDivergence(Node, FLI, UA);
1378113771 Node->SDNodeBits.IsDivergent = IsDivergent;
1378213772 }
0 commit comments