summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 19:26:49 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-17 19:26:49 +0000
commita71301befa81f0985ecfc3eac2336cbc9749daef (patch)
treee7193c477c13b7ae983474a77c0a9afc3de01613
parent197871d5322f6a294d58bfa54c25772808170fbb (diff)
downloadbcm5719-llvm-a71301befa81f0985ecfc3eac2336cbc9749daef.tar.gz
bcm5719-llvm-a71301befa81f0985ecfc3eac2336cbc9749daef.zip
Transforms: Fix bootstrap after r266565
Apparently there isn't test coverage for all of these. I'd appreciate if someone with could reproduce and send me something to reduce, but for now I've just looked for users of RemapInstruction and MapValue and ensured they don't accidentally insert nullptr. Here is one of the bootstraps that caught: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11494 llvm-svn: 266567
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp2
-rw-r--r--llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index b8148916295..1c567fd6655 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -70,7 +70,7 @@ static void RewriteUsesOfClonedInstructions(BasicBlock *OrigHeader,
if (OrigHeaderVal->use_empty())
continue;
- Value *OrigPreHeaderVal = ValueMap[OrigHeaderVal];
+ Value *OrigPreHeaderVal = ValueMap.lookup(OrigHeaderVal);
// The value now exits in two versions: the initial value in the preheader
// and the loop "next" value in the original header.
diff --git a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
index 9f5a43b6d6f..da66da0e85f 100644
--- a/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp
@@ -94,7 +94,7 @@ static void ConnectProlog(Loop *L, Value *BECount, unsigned Count,
Value *V = PN->getIncomingValueForBlock(Latch);
if (Instruction *I = dyn_cast<Instruction>(V)) {
if (L->contains(I)) {
- V = VMap[I];
+ V = VMap.lookup(I);
}
}
// Adding a value to the new PHI node from the last prolog block
@@ -199,7 +199,7 @@ static void ConnectEpilog(Loop *L, Value *ModVal, BasicBlock *NewExit,
Instruction *I = dyn_cast<Instruction>(V);
if (I && L->contains(I))
// If value comes from an instruction in the loop add VMap value.
- V = VMap[I];
+ V = VMap.lookup(I);
// For the instruction out of the loop, constant or undefined value
// insert value itself.
EpilogPN->addIncoming(V, EpilogLatch);
@@ -353,8 +353,8 @@ static void CloneLoopBlocks(Loop *L, Value *NewIter,
idx = NewPHI->getBasicBlockIndex(Latch);
Value *InVal = NewPHI->getIncomingValue(idx);
NewPHI->setIncomingBlock(idx, NewLatch);
- if (VMap[InVal])
- NewPHI->setIncomingValue(idx, VMap[InVal]);
+ if (Value *V = VMap.lookup(InVal))
+ NewPHI->setIncomingValue(idx, V);
}
}
if (NewLoop) {
OpenPOWER on IntegriCloud