diff options
Diffstat (limited to 'contrib/llvm/lib/Transforms/Scalar/SCCP.cpp')
-rw-r--r-- | contrib/llvm/lib/Transforms/Scalar/SCCP.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp index 90c3520..cfc9a8e 100644 --- a/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp +++ b/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp @@ -214,7 +214,8 @@ public: /// /// This returns true if the block was not considered live before. bool MarkBlockExecutable(BasicBlock *BB) { - if (!BBExecutable.insert(BB)) return false; + if (!BBExecutable.insert(BB).second) + return false; DEBUG(dbgs() << "Marking Block Executable: " << BB->getName() << '\n'); BBWorkList.push_back(BB); // Add the block to the work list! return true; @@ -1010,7 +1011,7 @@ void SCCPSolver::visitGetElementPtrInst(GetElementPtrInst &I) { } Constant *Ptr = Operands[0]; - ArrayRef<Constant *> Indices(Operands.begin() + 1, Operands.end()); + auto Indices = makeArrayRef(Operands.begin() + 1, Operands.end()); markConstant(&I, ConstantExpr::getGetElementPtr(Ptr, Indices)); } @@ -1107,6 +1108,9 @@ CallOverdefined: Operands.push_back(State.getConstant()); } + if (getValueState(I).isOverdefined()) + return; + // If we can constant fold this, mark the result of the call as a // constant. if (Constant *C = ConstantFoldCall(F, Operands, TLI)) |