From 0b8cb46e0b8f593221478fa24a35bcf3e56edfaa Mon Sep 17 00:00:00 2001 From: Nirav Dave Date: Tue, 28 Aug 2018 18:12:35 +0000 Subject: [PATCH] [DAG] Fix updateDivergence calculation Check correct SDNode when deciding if we should update the divergence property. llvm-svn: 340851 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 9073591eaeaf..534585685c8d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -7815,7 +7815,7 @@ void SelectionDAG::ReplaceAllUsesWith(SDNode *From, const SDValue *To) { const SDValue &ToOp = To[Use.getResNo()]; ++UI; Use.set(ToOp); - if (To->getNode()->isDivergent() != From->isDivergent()) + if (ToOp->isDivergent() != From->isDivergent()) updateDivergence(User); } while (UI != UE && *UI == User); // Now that we have modified User, add it back to the CSE maps. If it