[PATCH] D30603: New Test-Case for Region Analysis

Nandini Singhal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 4 02:54:35 PST 2017


nandini12396 created this revision.

While working on improvements to the region info analysis, this test case caused an incorrect region 1 => 2 to be detected. It is incorrect because entry has an outgoing edge to 3. This is interesting because 1 dom 2 and 2 pdom 1, which should have been enough to prevent incoming forward edges into the region and outgoing forward edges from the region.


https://reviews.llvm.org/D30603

Files:
  test/Analysis/RegionInfo/outgoing_edge.ll


Index: test/Analysis/RegionInfo/outgoing_edge.ll
===================================================================
--- /dev/null
+++ test/Analysis/RegionInfo/outgoing_edge.ll
@@ -0,0 +1,28 @@
+; REQUIRES: asserts
+; RUN: opt -regions -analyze < %s | FileCheck %s
+
+; While working on improvements to the region info analysis, this test
+; case caused an incorrect region 1 => 2 to be detected. It is incorrect
+; because entry has an outgoing edge to 3. This is interesting because
+; 1 dom 2 and 2 pdom 1, which should have been enough to prevent incoming
+; forward edges into the region and outgoing forward edges from the region.
+
+define void @meread_() nounwind {
+entry:
+   br label %"0"
+
+"0":                                              ; preds = %"3", %entry
+   br label %"1"
+
+"1":                                              ; preds = %"0"
+  br i1 true, label %"2", label %"3"
+
+"2":                                              ; preds = %"1"
+  br i1 true, label %"3", label %end
+
+"3":                                              ; preds = %"2", %"1"
+   br label %"0"
+
+end:                                              ; preds = %"2"
+   ret void
+ }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30603.90570.patch
Type: text/x-patch
Size: 1183 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170304/fc0e72ad/attachment.bin>


More information about the llvm-commits mailing list