[llvm] r266570 - Transforms: Try harder to fix bootstrap after r266565
Duncan P. N. Exon Smith via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 17 13:11:11 PDT 2016
Author: dexonsmith
Date: Sun Apr 17 15:11:09 2016
New Revision: 266570
URL: http://llvm.org/viewvc/llvm-project?rev=266570&view=rev
Log:
Transforms: Try harder to fix bootstrap after r266565
This catches two nullptr insertions into the ValueMap I missed in
r266567. I missed CloneFunction becuase it never calls RemapInstruction
directly. Here's one of the still-failing bots:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11496
Modified:
llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
Modified: llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp?rev=266570&r1=266569&r2=266570&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CloneFunction.cpp Sun Apr 17 15:11:09 2016
@@ -362,7 +362,7 @@ void PruningFunctionCloner::CloneBlock(c
// If switching on a value known constant in the caller.
ConstantInt *Cond = dyn_cast<ConstantInt>(SI->getCondition());
if (!Cond) { // Or known constant after constant prop in the callee...
- Value *V = VMap[SI->getCondition()];
+ Value *V = VMap.lookup(SI->getCondition());
Cond = dyn_cast_or_null<ConstantInt>(V);
}
if (Cond) { // Constant fold to uncond branch!
@@ -493,7 +493,7 @@ void llvm::CloneAndPruneIntoFromInst(Fun
OPN = PHIToResolve[phino];
PHINode *PN = cast<PHINode>(VMap[OPN]);
for (unsigned pred = 0, e = NumPreds; pred != e; ++pred) {
- Value *V = VMap[PN->getIncomingBlock(pred)];
+ Value *V = VMap.lookup(PN->getIncomingBlock(pred));
if (BasicBlock *MappedBlock = cast_or_null<BasicBlock>(V)) {
Value *InVal = MapValue(PN->getIncomingValue(pred),
VMap,
More information about the llvm-commits
mailing list