git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110665
91177308-0d34-0410-b5e6-
96231b3b80d8
return false;
for (pred_iterator PI = pred_begin(entry), PE = pred_end(entry); PI != PE;
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;
}
if (found) {
isSimple = false;
break;
}
found = true;
}
--- /dev/null
+; 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
+}