aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/SSAUpdater.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-04 01:03:32 +0000
committerChris Lattner <sabre@nondot.org>2009-12-04 01:03:32 +0000
commit45305d4ff6bff8dfe62228c68b3cb61bb2d7254f (patch)
treeb288be8a962e858144acd47399389b4cc79ee894 /lib/Transforms/Utils/SSAUpdater.cpp
parent6b74e505be1016223e090a6c806f7caa3165a146 (diff)
add an assert to make it really clear what this is doing. Return singularval as
a compile time perf optimization to avoid a load. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90507 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/SSAUpdater.cpp')
-rw-r--r--lib/Transforms/Utils/SSAUpdater.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/SSAUpdater.cpp b/lib/Transforms/Utils/SSAUpdater.cpp
index 8a07c35f35..ba41bf9d2e 100644
--- a/lib/Transforms/Utils/SSAUpdater.cpp
+++ b/lib/Transforms/Utils/SSAUpdater.cpp
@@ -295,10 +295,14 @@ Value *SSAUpdater::GetValueAtEndOfBlockInternal(BasicBlock *BB) {
InsertedVal = SingularValue;
}
+ // Either path through the 'if' should have set insertedVal -> SingularVal.
+ assert((InsertedVal == SingularValue || isa<UndefValue>(InsertedVal)) &&
+ "RAUW didn't change InsertedVal to be SingularVal");
+
// Drop the entries we added in IncomingPredInfo to restore the stack.
IncomingPredInfo.erase(IncomingPredInfo.begin()+FirstPredInfoEntry,
IncomingPredInfo.end());
- return InsertedVal;
+ return SingularValue;
}
// Otherwise, we do need a PHI: insert one now if we don't already have one.