diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-04 01:03:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-04 01:03:32 +0000 |
commit | 2bd960999209393fca1b61d1611f32b60d36dd18 (patch) | |
tree | c2012c8ec569343971b5dfa3ac4042a9e8eaec4d /llvm/lib/Transforms | |
parent | 253882431e5486735e225bfa8fa432ddf94ed00c (diff) | |
download | bcm5719-llvm-2bd960999209393fca1b61d1611f32b60d36dd18.tar.gz bcm5719-llvm-2bd960999209393fca1b61d1611f32b60d36dd18.zip |
add an assert to make it really clear what this is doing. Return singularval as
a compile time perf optimization to avoid a load.
llvm-svn: 90507
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Utils/SSAUpdater.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/SSAUpdater.cpp b/llvm/lib/Transforms/Utils/SSAUpdater.cpp index 8a07c35f352..ba41bf9d2e5 100644 --- a/llvm/lib/Transforms/Utils/SSAUpdater.cpp +++ b/llvm/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. |