summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJakub Kuderski <kubakuderski@gmail.com>2017-08-15 18:14:57 +0000
committerJakub Kuderski <kubakuderski@gmail.com>2017-08-15 18:14:57 +0000
commit638c085d07aa631e1280c159bfa7b5bf67f0523f (patch)
tree978d9d7429ee727054f5d7079c6c253445b80efa /llvm/test
parent590a974e10df6894242990d3b7ae4a34822d95bf (diff)
downloadbcm5719-llvm-638c085d07aa631e1280c159bfa7b5bf67f0523f.tar.gz
bcm5719-llvm-638c085d07aa631e1280c159bfa7b5bf67f0523f.zip
[Dominators] Include infinite loops in PostDominatorTree
Summary: This patch teaches PostDominatorTree about infinite loops. It is built on top of D29705 by @dberlin which includes a very detailed motivation for this change. What's new is that the patch also teaches the incremental updater how to deal with reverse-unreachable regions and how to properly maintain and verify tree roots. Before that, the incremental algorithm sometimes ended up preserving reverse-unreachable regions after updates that wouldn't appear in the tree if it was constructed from scratch on the same CFG. This patch makes the following assumptions: - A sequence of updates should produce the same tree as a recalculating it. - Any sequence of the same updates should lead to the same tree. - Siblings and roots are unordered. The last two properties are essential to efficiently perform batch updates in the future. When it comes to the first one, we can decide later that the consistency between freshly built tree and an updated one doesn't matter match, as there are many correct ways to pick roots in infinite loops, and to relax this assumption. That should enable us to recalculate postdominators less frequently. This patch is pretty conservative when it comes to incremental updates on reverse-unreachable regions and ends up recalculating the whole tree in many cases. It should be possible to improve the performance in many cases, if we decide that it's important enough. That being said, my experiments showed that reverse-unreachable are very rare in the IR emitted by clang when bootstrapping clang. Here are the statistics I collected by analyzing IR between passes and after each removePredecessor call: ``` # functions: 52283 # samples: 337609 # reverse unreachable BBs: 216022 # BBs: 247840796 Percent reverse-unreachable: 0.08716159869015269 % Max(PercRevUnreachable) in a function: 87.58620689655172 % # > 25 % samples: 471 ( 0.1395104988314885 % samples ) ... in 145 ( 0.27733680163724345 % functions ) ``` Most of the reverse-unreachable regions come from invalid IR where it wouldn't be possible to construct a PostDomTree anyway. I would like to commit this patch in the next week in order to be able to complete the work that depends on it before the end of my internship, so please don't wait long to voice your concerns :). Reviewers: dberlin, sanjoy, grosser, brzycki, davide, chandlerc, hfinkel Reviewed By: dberlin Subscribers: nhaehnle, javed.absar, kparzysz, uabelho, jlebar, hiraditya, llvm-commits, dberlin, david2050 Differential Revision: https://reviews.llvm.org/D35851 llvm-svn: 310940
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/PostDominators/infinite-loop.ll30
-rw-r--r--llvm/test/Analysis/PostDominators/infinite-loop2.ll34
-rw-r--r--llvm/test/Analysis/PostDominators/infinite-loop3.ll34
-rw-r--r--llvm/test/Analysis/PostDominators/pr24415.ll18
-rw-r--r--llvm/test/Analysis/PostDominators/pr6047_a.ll8
-rw-r--r--llvm/test/Analysis/PostDominators/pr6047_b.ll8
-rw-r--r--llvm/test/Analysis/PostDominators/pr6047_c.ll52
-rw-r--r--llvm/test/Analysis/PostDominators/pr6047_d.ll10
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop.ll4
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop_2.ll11
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop_3.ll14
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop_4.ll14
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop_5_a.ll2
-rw-r--r--llvm/test/Analysis/RegionInfo/infinite_loop_5_b.ll1
-rw-r--r--llvm/test/CodeGen/AMDGPU/branch-relaxation.ll16
-rw-r--r--llvm/test/CodeGen/ARM/struct-byval-frame-index.ll17
-rw-r--r--llvm/test/CodeGen/Thumb2/v8_IT_5.ll7
-rw-r--r--llvm/test/Transforms/StructurizeCFG/branch-on-argument.ll9
-rw-r--r--llvm/test/Transforms/StructurizeCFG/no-branch-to-entry.ll7
19 files changed, 229 insertions, 67 deletions
diff --git a/llvm/test/Analysis/PostDominators/infinite-loop.ll b/llvm/test/Analysis/PostDominators/infinite-loop.ll
new file mode 100644
index 00000000000..5796b8614db
--- /dev/null
+++ b/llvm/test/Analysis/PostDominators/infinite-loop.ll
@@ -0,0 +1,30 @@
+; RUN: opt < %s -postdomtree -analyze | FileCheck %s
+; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
+
+@a = external global i32, align 4
+
+define void @fn1() {
+entry:
+ store i32 5, i32* @a, align 4
+ %call = call i32 (...) @foo()
+ %tobool = icmp ne i32 %call, 0
+ br i1 %tobool, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ br label %loop
+
+loop: ; preds = %loop, %if.then
+ br label %loop
+
+if.end: ; preds = %entry
+ store i32 6, i32* @a, align 4
+ ret void
+}
+
+declare i32 @foo(...)
+
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK: [2] %loop
+; CHECK-NEXT: [3] %if.then
+; CHECK: Roots: %if.end %loop
diff --git a/llvm/test/Analysis/PostDominators/infinite-loop2.ll b/llvm/test/Analysis/PostDominators/infinite-loop2.ll
new file mode 100644
index 00000000000..139abb76e95
--- /dev/null
+++ b/llvm/test/Analysis/PostDominators/infinite-loop2.ll
@@ -0,0 +1,34 @@
+; RUN: opt < %s -postdomtree -analyze | FileCheck %s
+; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
+
+@a = external global i32, align 4
+
+define void @fn1() {
+entry:
+ store i32 5, i32* @a, align 4
+ %call = call i32 (...) @foo()
+ %tobool = icmp ne i32 %call, 0
+ br i1 %tobool, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ br label %loop
+
+loop: ; preds = %loop, %if.then
+ %0 = load i32, i32* @a, align 4
+ call void @bar(i32 %0)
+ br label %loop
+
+if.end: ; preds = %entry
+ store i32 6, i32* @a, align 4
+ ret void
+}
+
+declare i32 @foo(...)
+declare void @bar(i32)
+
+
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK: [2] %loop
+; CHECK-NEXT: [3] %if.then
+; CHECK: Roots: %if.end %loop
diff --git a/llvm/test/Analysis/PostDominators/infinite-loop3.ll b/llvm/test/Analysis/PostDominators/infinite-loop3.ll
new file mode 100644
index 00000000000..f767df79d3a
--- /dev/null
+++ b/llvm/test/Analysis/PostDominators/infinite-loop3.ll
@@ -0,0 +1,34 @@
+; RUN: opt < %s -postdomtree -analyze | FileCheck %s
+; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
+
+@a = external global i32, align 4
+
+define void @fn1() {
+entry:
+ store i32 5, i32* @a, align 4
+ %call = call i32 (...) @foo()
+ %tobool = icmp ne i32 %call, 0
+ br i1 %tobool, label %if.then, label %if.end
+
+if.then: ; preds = %entry, %loop
+ br label %loop
+
+loop: ; preds = %loop, %if.then
+ %0 = load i32, i32* @a, align 4
+ call void @bar(i32 %0)
+ br i1 true, label %loop, label %if.then
+
+if.end: ; preds = %entry
+ store i32 6, i32* @a, align 4
+ ret void
+}
+
+declare i32 @foo(...)
+declare void @bar(i32)
+
+
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK: [2] %loop
+; CHECK-NEXT: [3] %if.then
+; CHECK: Roots: %if.end %loop
diff --git a/llvm/test/Analysis/PostDominators/pr24415.ll b/llvm/test/Analysis/PostDominators/pr24415.ll
new file mode 100644
index 00000000000..536c36848b9
--- /dev/null
+++ b/llvm/test/Analysis/PostDominators/pr24415.ll
@@ -0,0 +1,18 @@
+; RUN: opt < %s -postdomtree -analyze | FileCheck %s
+; RUN: opt < %s -passes='print<postdomtree>' 2>&1 | FileCheck %s
+
+; Function Attrs: nounwind ssp uwtable
+define void @foo() {
+ br label %1
+
+; <label>:1 ; preds = %0, %1
+ br label %1
+ ; No predecessors!
+ ret void
+}
+
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK-NEXT: [2] %2
+; CHECK-NEXT: [2] %1
+; CHECK-NEXT: [3] %0 \ No newline at end of file
diff --git a/llvm/test/Analysis/PostDominators/pr6047_a.ll b/llvm/test/Analysis/PostDominators/pr6047_a.ll
index ec1455b46fe..32ccbe61271 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_a.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_a.ll
@@ -12,4 +12,10 @@ bb35.loopexit3:
bb35:
ret void
}
-; CHECK: [3] %entry
+
+;CHECK:Inorder PostDominator Tree:
+;CHECK-NEXT: [1] <<exit node>>
+;CHECK-NEXT: [2] %bb35
+;CHECK-NEXT: [3] %bb35.loopexit3
+;CHECK-NEXT: [2] %entry
+;CHECK-NEXT: [2] %bb3.i
diff --git a/llvm/test/Analysis/PostDominators/pr6047_b.ll b/llvm/test/Analysis/PostDominators/pr6047_b.ll
index 7bd2c86b737..f1fbb648f53 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_b.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_b.ll
@@ -16,4 +16,10 @@ bb35.loopexit3:
bb35:
ret void
}
-; CHECK: [4] %entry
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK-NEXT: [2] %bb35
+; CHECK-NEXT: [3] %bb35.loopexit3
+; CHECK-NEXT: [2] %a
+; CHECK-NEXT: [2] %entry
+; CHECK-NEXT: [2] %bb3.i \ No newline at end of file
diff --git a/llvm/test/Analysis/PostDominators/pr6047_c.ll b/llvm/test/Analysis/PostDominators/pr6047_c.ll
index 08c9551f156..0eef023b418 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_c.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_c.ll
@@ -144,4 +144,54 @@ bb35.loopexit3:
bb35:
ret void
}
-; CHECK: [3] %entry
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK-NEXT: [2] %bb35
+; CHECK-NEXT: [3] %bb
+; CHECK-NEXT: [3] %bb.i
+; CHECK-NEXT: [3] %_float32_unpack.exit
+; CHECK-NEXT: [3] %bb.i5
+; CHECK-NEXT: [3] %_float32_unpack.exit8
+; CHECK-NEXT: [3] %bb32.preheader
+; CHECK-NEXT: [3] %bb3
+; CHECK-NEXT: [3] %bb3.split.us
+; CHECK-NEXT: [3] %bb.i4.us
+; CHECK-NEXT: [3] %bb7.i.us
+; CHECK-NEXT: [3] %bb.i4.us.backedge
+; CHECK-NEXT: [3] %bb1.i.us
+; CHECK-NEXT: [3] %bb6.i.us
+; CHECK-NEXT: [3] %bb4.i.us
+; CHECK-NEXT: [3] %bb8.i.us
+; CHECK-NEXT: [3] %bb3.i.loopexit.us
+; CHECK-NEXT: [3] %bb.nph21
+; CHECK-NEXT: [3] %bb4
+; CHECK-NEXT: [3] %bb5
+; CHECK-NEXT: [3] %bb14.preheader
+; CHECK-NEXT: [3] %bb.nph18
+; CHECK-NEXT: [3] %bb8.us.preheader
+; CHECK-NEXT: [3] %bb8.preheader
+; CHECK-NEXT: [3] %bb8.us
+; CHECK-NEXT: [3] %bb8
+; CHECK-NEXT: [3] %bb15.loopexit
+; CHECK-NEXT: [3] %bb15.loopexit2
+; CHECK-NEXT: [3] %bb15
+; CHECK-NEXT: [3] %bb16
+; CHECK-NEXT: [3] %bb17.loopexit.split
+; CHECK-NEXT: [3] %bb.nph14
+; CHECK-NEXT: [3] %bb19
+; CHECK-NEXT: [3] %bb20
+; CHECK-NEXT: [3] %bb29.preheader
+; CHECK-NEXT: [3] %bb.nph
+; CHECK-NEXT: [3] %bb23.us.preheader
+; CHECK-NEXT: [3] %bb23.preheader
+; CHECK-NEXT: [3] %bb23.us
+; CHECK-NEXT: [3] %bb23
+; CHECK-NEXT: [3] %bb30.loopexit
+; CHECK-NEXT: [3] %bb30.loopexit1
+; CHECK-NEXT: [3] %bb30
+; CHECK-NEXT: [3] %bb31
+; CHECK-NEXT: [3] %bb35.loopexit
+; CHECK-NEXT: [3] %bb35.loopexit3
+; CHECK-NEXT: [2] %entry
+; CHECK-NEXT: [2] %bb3.i
+; CHECK-NEXT: Roots: %bb35 %bb3.i \ No newline at end of file
diff --git a/llvm/test/Analysis/PostDominators/pr6047_d.ll b/llvm/test/Analysis/PostDominators/pr6047_d.ll
index 4cfa88029ae..45ed86c27f8 100644
--- a/llvm/test/Analysis/PostDominators/pr6047_d.ll
+++ b/llvm/test/Analysis/PostDominators/pr6047_d.ll
@@ -21,4 +21,12 @@ bb35.loopexit3:
bb35:
ret void
}
-; CHECK: [4] %entry
+; CHECK: Inorder PostDominator Tree:
+; CHECK-NEXT: [1] <<exit node>>
+; CHECK-NEXT: [2] %bb35
+; CHECK-NEXT: [3] %bb35.loopexit3
+; CHECK-NEXT: [2] %c
+; CHECK-NEXT: [3] %a
+; CHECK-NEXT: [3] %entry
+; CHECK-NEXT: [3] %b
+; CHECK-NEXT: [2] %bb3.i \ No newline at end of file
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop.ll b/llvm/test/Analysis/RegionInfo/infinite_loop.ll
index d8412bf1ddd..4d9057e0406 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop.ll
@@ -16,6 +16,4 @@ define void @normal_condition() nounwind {
}
; CHECK-NOT: =>
; CHECK: [0] 0 => <Function Return>
-; CHECK: [1] 1 => 4
-; STAT: 2 region - The # of regions
-; STAT: 1 region - The # of simple regions
+; STAT: 1 region - The # of regions \ No newline at end of file
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop_2.ll b/llvm/test/Analysis/RegionInfo/infinite_loop_2.ll
index 4068babae4e..09feecd96f5 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop_2.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop_2.ll
@@ -26,12 +26,9 @@ define void @normal_condition() nounwind {
}
; CHECK-NOT: =>
; CHECK: [0] 0 => <Function Return>
-; CHECK: [1] 1 => 3
-; STAT: 2 region - The # of regions
-; STAT: 1 region - The # of simple regions
+; CHECK-NOT: [1]
+; STAT: 1 region - The # of regions
-; BBIT: 0, 1, 2, 5, 11, 6, 12, 3, 4,
-; BBIT: 1, 2, 5, 11, 6, 12,
+; BBIT: 0, 1, 2, 5, 11, 6, 12, 3, 4,
-; RNIT: 0, 1 => 3, 3, 4,
-; RNIT: 1, 2, 5, 11, 6, 12,
+; RNIT: 0, 1, 2, 5, 11, 6, 12, 3, 4,
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop_3.ll b/llvm/test/Analysis/RegionInfo/infinite_loop_3.ll
index 055e5e1d550..00d555177af 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop_3.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop_3.ll
@@ -38,16 +38,10 @@ define void @normal_condition() nounwind {
ret void
}
; CHECK-NOT: =>
-; CHECK: [0] 0 => <Function Return>
-; CHECK-NEXT: [1] 1 => 3
-; CHECK-NEXT: [1] 7 => 1
-; STAT: 3 region - The # of regions
-; STAT: 2 region - The # of simple regions
+; CHECK:[0] 0 => <Function Return>
+; CHECK-NOT: [1]
+; STAT: 1 region - The # of regions
; BBIT: 0, 7, 1, 2, 5, 11, 6, 12, 3, 4, 8, 9, 13, 10, 14,
-; BBIT: 7, 8, 9, 13, 10, 14,
-; BBIT: 1, 2, 5, 11, 6, 12,
-; RNIT: 0, 7 => 1, 1 => 3, 3, 4,
-; RNIT: 7, 8, 9, 13, 10, 14,
-; RNIT: 1, 2, 5, 11, 6, 12,
+; RNIT: 0, 7, 1, 2, 5, 11, 6, 12, 3, 4, 8, 9, 13, 10, 14,
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop_4.ll b/llvm/test/Analysis/RegionInfo/infinite_loop_4.ll
index 1c5bb74aed5..51d8ffe0d5b 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop_4.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop_4.ll
@@ -38,12 +38,14 @@ define void @normal_condition() nounwind {
}
; CHECK-NOT: =>
; CHECK: [0] 0 => <Function Return>
-; CHECK-NEXT: [1] 7 => 3
-; STAT: 2 region - The # of regions
+; CHECK-NEXT: [1] 2 => 10
+; CHECK_NEXT: [2] 5 => 6
+; STAT: 3 region - The # of regions
; STAT: 1 region - The # of simple regions
; BBIT: 0, 7, 1, 2, 5, 11, 6, 10, 8, 9, 13, 14, 12, 3, 4,
-; BBIT: 7, 1, 2, 5, 11, 6, 10, 8, 9, 13, 14, 12,
-
-; RNIT: 0, 7 => 3, 3, 4,
-; RNIT: 7, 1, 2, 5, 11, 6, 10, 8, 9, 13, 14, 12,
+; BBIT: 2, 5, 11, 6, 12,
+; BBIT: 5, 11, 12,
+; RNIT: 0, 7, 1, 2 => 10, 10, 8, 9, 13, 14, 3, 4,
+; RNIT: 2, 5 => 6, 6,
+; RNIT: 5, 11, 12, \ No newline at end of file
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop_5_a.ll b/llvm/test/Analysis/RegionInfo/infinite_loop_5_a.ll
index b0e52861b7c..12796417351 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop_5_a.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop_5_a.ll
@@ -19,6 +19,4 @@ define void @normal_condition() nounwind {
; CHECK: Region tree:
; CHECK-NEXT: [0] 0 => <Function Return>
-; CHECK-NEXT: [1] 7 => 3
; CHECK-NEXT: End region tree
-
diff --git a/llvm/test/Analysis/RegionInfo/infinite_loop_5_b.ll b/llvm/test/Analysis/RegionInfo/infinite_loop_5_b.ll
index 49580c9de3d..9759ea873c5 100644
--- a/llvm/test/Analysis/RegionInfo/infinite_loop_5_b.ll
+++ b/llvm/test/Analysis/RegionInfo/infinite_loop_5_b.ll
@@ -21,5 +21,4 @@ define void @normal_condition() nounwind {
; CHECK: Region tree:
; CHECK-NEXT: [0] 0 => <Function Return>
-; CHECK-NEXT: [1] 7 => 3
; CHECK-NEXT: End region tree
diff --git a/llvm/test/CodeGen/AMDGPU/branch-relaxation.ll b/llvm/test/CodeGen/AMDGPU/branch-relaxation.ll
index 661a6bd9958..9edf439b586 100644
--- a/llvm/test/CodeGen/AMDGPU/branch-relaxation.ll
+++ b/llvm/test/CodeGen/AMDGPU/branch-relaxation.ll
@@ -428,24 +428,13 @@ endif:
}
; si_mask_branch
-; s_cbranch_execz
-; s_branch
; GCN-LABEL: {{^}}analyze_mask_branch:
; GCN: v_cmp_lt_f32_e32 vcc
; GCN-NEXT: s_and_saveexec_b64 [[MASK:s\[[0-9]+:[0-9]+\]]], vcc
; GCN-NEXT: ; mask branch [[RET:BB[0-9]+_[0-9]+]]
-; GCN-NEXT: s_cbranch_execz [[BRANCH_SKIP:BB[0-9]+_[0-9]+]]
-; GCN-NEXT: s_branch [[LOOP_BODY:BB[0-9]+_[0-9]+]]
-; GCN-NEXT: [[BRANCH_SKIP]]: ; %entry
-; GCN-NEXT: s_getpc_b64 vcc
-; GCN-NEXT: s_add_u32 vcc_lo, vcc_lo, [[RET]]-([[BRANCH_SKIP]]+4)
-; GCN-NEXT: s_addc_u32 vcc_hi, vcc_hi, 0
-; GCN-NEXT: s_setpc_b64 vcc
-
-; GCN-NEXT: [[LOOP_BODY]]: ; %loop_body
-; GCN: s_mov_b64 vcc, -1{{$}}
+; GCN-NEXT: [[LOOP_BODY:BB[0-9]+_[0-9]+]]: ; %loop_body
; GCN: ;;#ASMSTART
; GCN: v_nop_e64
; GCN: v_nop_e64
@@ -454,7 +443,6 @@ endif:
; GCN: v_nop_e64
; GCN: v_nop_e64
; GCN: ;;#ASMEND
-; GCN-NEXT: s_cbranch_vccz [[RET]]
; GCN-NEXT: [[LONGBB:BB[0-9]+_[0-9]+]]: ; %loop_body
; GCN-NEXT: ; in Loop: Header=[[LOOP_BODY]] Depth=1
@@ -463,7 +451,7 @@ endif:
; GCN-NEXT: s_subb_u32 vcc_hi, vcc_hi, 0
; GCN-NEXT: s_setpc_b64 vcc
-; GCN-NEXT: [[RET]]: ; %Flow
+; GCN-NEXT: [[RET]]: ; %ret
; GCN-NEXT: s_or_b64 exec, exec, [[MASK]]
; GCN: buffer_store_dword
; GCN-NEXT: s_endpgm
diff --git a/llvm/test/CodeGen/ARM/struct-byval-frame-index.ll b/llvm/test/CodeGen/ARM/struct-byval-frame-index.ll
index 68629d3581d..b3ed5de857b 100644
--- a/llvm/test/CodeGen/ARM/struct-byval-frame-index.ll
+++ b/llvm/test/CodeGen/ARM/struct-byval-frame-index.ll
@@ -4,22 +4,11 @@
; generated.
; PR16393
-; We expect the spill to be generated in %if.end230 and the reloads in
-; %if.end249 and %for.body285.
+; We expect 4-byte spill and reload to be generated.
; CHECK: set_stored_macroblock_parameters
-; CHECK: @ %if.end230
-; CHECK-NOT:@ %if.
-; CHECK-NOT:@ %for.
-; CHECK: str r{{.*}}, [sp, [[SLOT:#[0-9]+]]] @ 4-byte Spill
-; CHECK: @ %if.end249
-; CHECK-NOT:@ %if.
-; CHECK-NOT:@ %for.
-; CHECK: ldr r{{.*}}, [sp, [[SLOT]]] @ 4-byte Reload
-; CHECK: @ %for.body285
-; CHECK-NOT:@ %if.
-; CHECK-NOT:@ %for.
-; CHECK: ldr r{{.*}}, [sp, [[SLOT]]] @ 4-byte Reload
+; CHECK: str r{{.*}}, [sp, {{#[0-9]+}}] @ 4-byte Spill
+; CHECK: ldr r{{.*}}, [lr, {{#[0-9]+}}] @ 4-byte Reload
target triple = "armv7l-unknown-linux-gnueabihf"
diff --git a/llvm/test/CodeGen/Thumb2/v8_IT_5.ll b/llvm/test/CodeGen/Thumb2/v8_IT_5.ll
index 5e7a40299ed..4e9ebac7d15 100644
--- a/llvm/test/CodeGen/Thumb2/v8_IT_5.ll
+++ b/llvm/test/CodeGen/Thumb2/v8_IT_5.ll
@@ -1,6 +1,6 @@
; RUN: llc < %s -mtriple=thumbv8 -arm-atomic-cfg-tidy=0 | FileCheck %s
; RUN: llc < %s -mtriple=thumbv7 -arm-atomic-cfg-tidy=0 -arm-restrict-it | FileCheck %s
-; CHECK: it ne
+; CHECK: it ne
; CHECK-NEXT: cmpne
; CHECK-NEXT: bne [[JUMPTARGET:.LBB[0-9]+_[0-9]+]]
; CHECK: cbz
@@ -9,9 +9,10 @@
; CHECK-NEXT: b
; CHECK: [[JUMPTARGET]]:{{.*}}%if.else173
; CHECK-NEXT: mov.w
-; CHECK-NEXT: pop
-; CHECK-NEXT: %if.else145
+; CHECK-NEXT: bx lr
+; CHECK: %if.else145
; CHECK-NEXT: mov.w
+; CHECK: pop.w
%struct.hc = type { i32, i32, i32, i32 }
diff --git a/llvm/test/Transforms/StructurizeCFG/branch-on-argument.ll b/llvm/test/Transforms/StructurizeCFG/branch-on-argument.ll
index 386994f1fd9..cdd4b70592b 100644
--- a/llvm/test/Transforms/StructurizeCFG/branch-on-argument.ll
+++ b/llvm/test/Transforms/StructurizeCFG/branch-on-argument.ll
@@ -3,14 +3,17 @@
; CHECK-LABEL: @invert_branch_on_arg_inf_loop(
; CHECK: entry:
; CHECK: %arg.inv = xor i1 %arg, true
-; CHECK: phi i1 [ false, %Flow1 ], [ %arg.inv, %entry ]
define void @invert_branch_on_arg_inf_loop(i32 addrspace(1)* %out, i1 %arg) {
entry:
- br i1 %arg, label %for.end, label %for.body
+ br i1 %arg, label %for.end, label %sesestart
+sesestart:
+ br label %for.body
for.body: ; preds = %entry, %for.body
store i32 999, i32 addrspace(1)* %out, align 4
- br label %for.body
+ br i1 %arg, label %for.body, label %seseend
+seseend:
+ ret void
for.end: ; preds = %Flow
ret void
diff --git a/llvm/test/Transforms/StructurizeCFG/no-branch-to-entry.ll b/llvm/test/Transforms/StructurizeCFG/no-branch-to-entry.ll
index 1db1060ca82..b0897ee6c85 100644
--- a/llvm/test/Transforms/StructurizeCFG/no-branch-to-entry.ll
+++ b/llvm/test/Transforms/StructurizeCFG/no-branch-to-entry.ll
@@ -1,3 +1,10 @@
+; XFAIL: *
+
+; This test used to generate a region that caused it to delete the entry block,
+; but it does not anymore after the changes to handling of infinite loops in the
+; PostDominatorTree.
+; TODO: This should be either replaced with another IR or deleted completely.
+
; RUN: opt -S -o - -structurizecfg -verify-dom-info < %s | FileCheck %s
; CHECK-LABEL: @no_branch_to_entry_undef(
OpenPOWER on IntegriCloud