[DAG] Fix updateDivergence calculation

Check correct SDNode when deciding if we should update the divergence
property.

llvm-svn: 340851
This commit is contained in:
Nirav Dave 2018-08-28 18:12:35 +00:00
parent 10de2775bd
commit 0b8cb46e0b
1 changed files with 1 additions and 1 deletions

View File

@ -7815,7 +7815,7 @@ void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) {
const SDValue &ToOp = To[Use.getResNo()]; const SDValue &ToOp = To[Use.getResNo()];
++UI; ++UI;
Use.set(ToOp); Use.set(ToOp);
if (To->getNode()->isDivergent() != From->isDivergent()) if (ToOp->isDivergent() != From->isDivergent())
updateDivergence(User); updateDivergence(User);
} while (UI != UE && *UI == User); } while (UI != UE && *UI == User);
// Now that we have modified User, add it back to the CSE maps. If it // Now that we have modified User, add it back to the CSE maps. If it