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
This commit is contained in:
Chris Lattner 2009-12-04 01:03:32 +00:00
parent 6b74e505be
commit 45305d4ff6

View File

@ -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.