[llvm-commits] [llvm] r90507 - /llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Chris Lattner
sabre at nondot.org
Thu Dec 3 17:03:32 PST 2009
Author: lattner
Date: Thu Dec 3 19:03:32 2009
New Revision: 90507
URL: http://llvm.org/viewvc/llvm-project?rev=90507&view=rev
Log:
add an assert to make it really clear what this is doing. Return singularval as
a compile time perf optimization to avoid a load.
Modified:
llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
Modified: llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp?rev=90507&r1=90506&r2=90507&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/SSAUpdater.cpp Thu Dec 3 19:03:32 2009
@@ -295,10 +295,14 @@
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.
More information about the llvm-commits
mailing list