[llvm-commits] [llvm] r39924 - /llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
Reid Spencer
rspencer at reidspencer.com
Mon Jul 16 14:03:45 PDT 2007
Author: reid
Date: Mon Jul 16 16:03:44 2007
New Revision: 39924
URL: http://llvm.org/viewvc/llvm-project?rev=39924&view=rev
Log:
Return Undef if the block has no dominator. This was required to allow
llvm-gcc build to succeed. Without this change it fails in libstdc++
compilation. This causes no regressions in dejagnu tests. However,
someone who knows this code better might want to review it.
Modified:
llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
Modified: llvm/trunk/lib/Transforms/Utils/LCSSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/LCSSA.cpp?rev=39924&r1=39923&r2=39924&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/LCSSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/LCSSA.cpp Mon Jul 16 16:03:44 2007
@@ -231,6 +231,10 @@
DomTreeNode *IDom = BB->getIDom();
+ // If the block has no dominator, bail
+ if (!IDom)
+ return V = UndefValue::get(OrigInst->getType());
+
// Otherwise, there are two cases: we either have to insert a PHI node or we
// don't. We need to insert a PHI node if this block is not dominated by one
// of the exit nodes from the loop (the loop could have multiple exits, and
More information about the llvm-commits
mailing list