@@ -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);
@@ -12098,8 +12096,6 @@ static bool gluePropagatesDivergence(const SDNode *Node) {
1209812096}
1209912097
1210012098bool SelectionDAG::calculateDivergence(SDNode *N) {
12101- if(!DivergentTarget)
12102- return false;
1210312099 if (TLI->isSDNodeAlwaysUniform(N)) {
1210412100 assert(!TLI->isSDNodeSourceOfDivergence(N, FLI, UA) &&
1210512101 "Conflicting divergence information!");
@@ -12119,8 +12115,6 @@ bool SelectionDAG::calculateDivergence(SDNode *N) {
1211912115}
1212012116
1212112117void SelectionDAG::updateDivergence(SDNode *N) {
12122- if (!DivergentTarget)
12123- return;
1212412118 SmallVector<SDNode *, 16> Worklist(1, N);
1212512119 do {
1212612120 N = Worklist.pop_back_val();
@@ -13668,20 +13662,16 @@ void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
1366813662 Ops[I].setInitial(Vals[I]);
1366913663 EVT VT = Ops[I].getValueType();
1367013664
13671- // Take care of the Node's operands iff target has divergence
1367213665 // Skip Chain. It does not carry divergence.
13673- if (DivergentTarget && VT != MVT::Other &&
13666+ if (VT != MVT::Other &&
1367413667 (VT != MVT::Glue || gluePropagatesDivergence(Ops[I].getNode())) &&
1367513668 Ops[I].getNode()->isDivergent()) {
13676- // Node is going to be divergent if at least one of its operand is
13677- // divergent, unless it belongs to the "AlwaysUniform" exemptions.
1367813669 IsDivergent = true;
1367913670 }
1368013671 }
1368113672 Node->NumOperands = Vals.size();
1368213673 Node->OperandList = Ops;
13683- // Check the divergence of the Node itself.
13684- if (DivergentTarget && !TLI->isSDNodeAlwaysUniform(Node)) {
13674+ if (!TLI->isSDNodeAlwaysUniform(Node)) {
1368513675 IsDivergent |= TLI->isSDNodeSourceOfDivergence(Node, FLI, UA);
1368613676 Node->SDNodeBits.IsDivergent = IsDivergent;
1368713677 }
0 commit comments