@@ -1371,7 +1371,7 @@ void SelectionDAG::init(MachineFunction &NewMF,
13711371 const TargetLibraryInfo *LibraryInfo,
13721372 UniformityInfo *NewUA, ProfileSummaryInfo *PSIin,
13731373 BlockFrequencyInfo *BFIin, MachineModuleInfo &MMIin,
1374- FunctionVarLocs const *VarLocs, bool HasDivergency ) {
1374+ FunctionVarLocs const *VarLocs) {
13751375 MF = &NewMF;
13761376 SDAGISelPass = PassPtr;
13771377 ORE = &NewORE;
@@ -1384,7 +1384,6 @@ void SelectionDAG::init(MachineFunction &NewMF,
13841384 BFI = BFIin;
13851385 MMI = &MMIin;
13861386 FnVarLocs = VarLocs;
1387- DivergentTarget = HasDivergency;
13881387}
13891388
13901389SelectionDAG::~SelectionDAG() {
@@ -2331,8 +2330,7 @@ SDValue SelectionDAG::getRegister(Register Reg, EVT VT) {
23312330 return SDValue(E, 0);
23322331
23332332 auto *N = newSDNode<RegisterSDNode>(Reg, VTs);
2334- N->SDNodeBits.IsDivergent =
2335- DivergentTarget && TLI->isSDNodeSourceOfDivergence(N, FLI, UA);
2333+ N->SDNodeBits.IsDivergent = TLI->isSDNodeSourceOfDivergence(N, FLI, UA);
23362334 CSEMap.InsertNode(N, IP);
23372335 InsertNode(N);
23382336 return SDValue(N, 0);
@@ -12264,8 +12262,6 @@ static bool gluePropagatesDivergence(const SDNode *Node) {
1226412262}
1226512263
1226612264bool SelectionDAG::calculateDivergence(SDNode *N) {
12267- if (!DivergentTarget)
12268- return false;
1226912265 if (TLI->isSDNodeAlwaysUniform(N)) {
1227012266 assert(!TLI->isSDNodeSourceOfDivergence(N, FLI, UA) &&
1227112267 "Conflicting divergence information!");
@@ -12285,8 +12281,6 @@ bool SelectionDAG::calculateDivergence(SDNode *N) {
1228512281}
1228612282
1228712283void SelectionDAG::updateDivergence(SDNode *N) {
12288- if (!DivergentTarget)
12289- return;
1229012284 SmallVector<SDNode *, 16> Worklist(1, N);
1229112285 do {
1229212286 N = Worklist.pop_back_val();
@@ -13847,20 +13841,16 @@ void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
1384713841 Ops[I].setInitial(Vals[I]);
1384813842 EVT VT = Ops[I].getValueType();
1384913843
13850- // Take care of the Node's operands iff target has divergence
1385113844 // Skip Chain. It does not carry divergence.
13852- if (DivergentTarget && VT != MVT::Other &&
13845+ if (VT != MVT::Other &&
1385313846 (VT != MVT::Glue || gluePropagatesDivergence(Ops[I].getNode())) &&
1385413847 Ops[I].getNode()->isDivergent()) {
13855- // Node is going to be divergent if at least one of its operand is
13856- // divergent, unless it belongs to the "AlwaysUniform" exemptions.
1385713848 IsDivergent = true;
1385813849 }
1385913850 }
1386013851 Node->NumOperands = Vals.size();
1386113852 Node->OperandList = Ops;
13862- // Check the divergence of the Node itself.
13863- if (DivergentTarget && !TLI->isSDNodeAlwaysUniform(Node)) {
13853+ if (!TLI->isSDNodeAlwaysUniform(Node)) {
1386413854 IsDivergent |= TLI->isSDNodeSourceOfDivergence(Node, FLI, UA);
1386513855 Node->SDNodeBits.IsDivergent = IsDivergent;
1386613856 }
0 commit comments