diff --git a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp --- a/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp +++ b/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp @@ -74,6 +74,7 @@ V = new LoadInst(I.getType(), Slot, I.getName() + ".reload", VolatileLoads, PN->getIncomingBlock(i)->getTerminator()); + Loads[PN->getIncomingBlock(i)] = V; } PN->setIncomingValue(i, V); }