[Tests] Give meaningful names to blocks in LoopUnroll/pr18861.ll, add a description of what's going on.

llvm-svn: 249173
This commit is contained in:
Michael Zolotukhin 2015-10-02 19:21:49 +00:00
parent 47eef7a3c9
commit 8df4bddd16
1 changed files with 37 additions and 13 deletions

View File

@ -2,30 +2,54 @@
@b = external global i32, align 4
; Test that LoopUnroll does not break LCSSA form.
;
; In this function we have a following CFG:
; ( entry )
; |
; v
; ( outer.header ) <--
; | \
; v |
; --> ( inner.header ) |
; / / \ |
; \ / \ |
; \ v v /
; ( inner.latch ) ( outer.latch )
; |
; v
; ( exit )
;
; When the inner loop is unrolled, we inner.latch block has only one
; predecessor and one successor, so it can be merged with exit block.
; During the merge, however, we remove an LCSSA definition for
; %storemerge1.lcssa, breaking LCSSA form for the outer loop.
; Function Attrs: nounwind uwtable
define void @fn1() #0 {
entry:
br label %for.cond1thread-pre-split
br label %outer.header
for.cond1thread-pre-split: ; preds = %for.inc5, %entry
%storemerge1 = phi i32 [ 0, %entry ], [ %inc9, %for.inc5 ]
br label %for.cond2
outer.header: ; preds = %outer.latch, %entry
%storemerge1 = phi i32 [ 0, %entry ], [ %inc9, %outer.latch ]
br label %inner.header
for.cond2: ; preds = %for.body3, %for.cond1thread-pre-split
%storemerge = phi i32 [ %add, %for.body3 ], [ 0, %for.cond1thread-pre-split ]
inner.header: ; preds = %inner.latch, %outer.header
%storemerge = phi i32 [ %add, %inner.latch ], [ 0, %outer.header ]
%cmp = icmp slt i32 %storemerge, 1
br i1 %cmp, label %for.body3, label %for.inc5
br i1 %cmp, label %inner.latch, label %outer.latch
for.body3: ; preds = %for.cond2
inner.latch: ; preds = %inner.header
%tobool4 = icmp eq i32 %storemerge, 0
%add = add nsw i32 %storemerge, 1
br i1 %tobool4, label %for.cond2, label %if.then
br i1 %tobool4, label %inner.header, label %exit
if.then: ; preds = %for.body3
store i32 %storemerge1, i32* @b, align 4
exit: ; preds = %inner.latch
%storemerge1.lcssa = phi i32 [ %storemerge1, %inner.latch ]
store i32 %storemerge1.lcssa, i32* @b, align 4
ret void
for.inc5: ; preds = %for.cond2
outer.latch: ; preds = %inner.header
%inc9 = add nsw i32 %storemerge1, 1
br label %for.cond1thread-pre-split
br label %outer.header
}