[llvm-commits] [llvm] r110665 - in /llvm/trunk: lib/Analysis/RegionInfo.cpp test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
Tobias Grosser
grosser at fim.uni-passau.de
Tue Aug 10 02:54:35 PDT 2010
Author: grosser
Date: Tue Aug 10 04:54:35 2010
New Revision: 110665
URL: http://llvm.org/viewvc/llvm-project?rev=110665&view=rev
Log:
RegionInfo: Do not assert if a BB is not part of the dominance tree.
Added:
llvm/trunk/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
Modified:
llvm/trunk/lib/Analysis/RegionInfo.cpp
Modified: llvm/trunk/lib/Analysis/RegionInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/RegionInfo.cpp?rev=110665&r1=110664&r2=110665&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/RegionInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/RegionInfo.cpp Tue Aug 10 04:54:35 2010
@@ -136,14 +136,16 @@
return false;
for (pred_iterator PI = pred_begin(entry), PE = pred_end(entry); PI != PE;
- ++PI)
- if (!contains(*PI)) {
+ ++PI) {
+ BasicBlock *Pred = *PI;
+ if (DT->getNode(Pred) && !contains(Pred)) {
if (found) {
isSimple = false;
break;
}
found = true;
}
+ }
found = false;
Added: llvm/trunk/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll?rev=110665&view=auto
==============================================================================
--- llvm/trunk/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll (added)
+++ llvm/trunk/test/Analysis/RegionInfo/20100809_bb_not_in_domtree.ll Tue Aug 10 04:54:35 2010
@@ -0,0 +1,20 @@
+; RUN: opt -regions %s
+define i32 @main() nounwind {
+entry:
+ br label %for.cond
+
+test:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ br i1 true, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret i32 0
+}
More information about the llvm-commits
mailing list