Imported Upstream version 5.18.0.234

Former-commit-id: 8071ec1a8c5eaa9be24b41745add19297608001f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-01-08 08:22:36 +00:00
parent f32dbaf0b2
commit 212f6bafcb
28494 changed files with 359 additions and 3867025 deletions

View File

@@ -1,13 +0,0 @@
; RUN: opt < %s -loop-deletion -S | grep switch
; PR 1564
define fastcc void @out() {
start:
br label %loop
unreachable:
unreachable
loop:
switch i32 0, label %unreachable [
i32 0, label %loop
]
}

View File

@@ -1,109 +0,0 @@
; RUN: opt < %s -inline -instcombine -jump-threading -licm -loop-unswitch -instcombine -indvars -loop-deletion -gvn -simplifycfg -verify -disable-output
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9"
%struct.BF_BitstreamElement = type { i32, i16 }
%struct.BF_BitstreamPart = type { i32, %struct.BF_BitstreamElement* }
%struct.BF_PartHolder = type { i32, %struct.BF_BitstreamPart* }
%struct.Bit_stream_struc = type { i8*, i32, %struct.FILE*, i8*, i32, i32, i32, i32 }
%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
%struct.III_scalefac_t = type { [22 x i32], [13 x [3 x i32]] }
%struct.III_side_info_t = type { i32, i32, i32, [2 x [4 x i32]], [2 x %struct.anon] }
%struct.__sFILEX = type opaque
%struct.__sbuf = type { i8*, i32 }
%struct.anon = type { [2 x %struct.gr_info_ss] }
%struct.gr_info = type { i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32*, [4 x i32] }
%struct.gr_info_ss = type { %struct.gr_info }
%struct.lame_global_flags = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, float, float, float, float, i32, i32, i32, i32, i32, i32, i32, i32 }
@scaleFactorsPH = external global [2 x [2 x %struct.BF_PartHolder*]] ; <[2 x [2 x %struct.BF_PartHolder*]]*> [#uses=1]
@slen1_tab = external constant [16 x i32] ; <[16 x i32]*> [#uses=1]
declare %struct.BF_PartHolder* @BF_addElement(%struct.BF_PartHolder*, %struct.BF_BitstreamElement*) nounwind
define %struct.BF_PartHolder* @BF_addEntry(%struct.BF_PartHolder* %thePH, i32 %value, i32 %length) nounwind {
entry:
%myElement = alloca %struct.BF_BitstreamElement ; <%struct.BF_BitstreamElement*> [#uses=2]
%tmp1 = getelementptr %struct.BF_BitstreamElement, %struct.BF_BitstreamElement* %myElement, i32 0, i32 0 ; <i32*> [#uses=1]
store i32 %value, i32* %tmp1, align 8
%tmp7 = icmp eq i32 %length, 0 ; <i1> [#uses=1]
br i1 %tmp7, label %bb13, label %bb
bb: ; preds = %entry
%tmp10 = call %struct.BF_PartHolder* @BF_addElement( %struct.BF_PartHolder* %thePH, %struct.BF_BitstreamElement* %myElement ) nounwind ; <%struct.BF_PartHolder*> [#uses=1]
ret %struct.BF_PartHolder* %tmp10
bb13: ; preds = %entry
ret %struct.BF_PartHolder* %thePH
}
define void @III_format_bitstream(%struct.lame_global_flags* %gfp, i32 %bitsPerFrame, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac, %struct.Bit_stream_struc* %in_bs) nounwind {
entry:
call fastcc void @encodeMainData( %struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %l3_side, [2 x %struct.III_scalefac_t]* %scalefac ) nounwind
unreachable
}
define internal fastcc void @encodeMainData(%struct.lame_global_flags* %gfp, [2 x [576 x i32]]* %l3_enc, %struct.III_side_info_t* %si, [2 x %struct.III_scalefac_t]* %scalefac) nounwind {
entry:
%tmp69 = getelementptr %struct.lame_global_flags, %struct.lame_global_flags* %gfp, i32 0, i32 43 ; <i32*> [#uses=1]
%tmp70 = load i32, i32* %tmp69, align 4 ; <i32> [#uses=1]
%tmp71 = icmp eq i32 %tmp70, 1 ; <i1> [#uses=1]
br i1 %tmp71, label %bb352, label %bb498
bb113: ; preds = %bb132
%tmp123 = getelementptr [2 x %struct.III_scalefac_t], [2 x %struct.III_scalefac_t]* %scalefac, i32 0, i32 0, i32 1, i32 %sfb.0, i32 %window.0 ; <i32*> [#uses=1]
%tmp124 = load i32, i32* %tmp123, align 4 ; <i32> [#uses=1]
%tmp126 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1]
%tmp128 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp126, i32 %tmp124, i32 %tmp93 ) nounwind ; <%struct.BF_PartHolder*> [#uses=1]
store %struct.BF_PartHolder* %tmp128, %struct.BF_PartHolder** %tmp80, align 4
%tmp131 = add i32 %window.0, 1 ; <i32> [#uses=1]
br label %bb132
bb132: ; preds = %bb140, %bb113
%window.0 = phi i32 [ %tmp131, %bb113 ], [ 0, %bb140 ] ; <i32> [#uses=3]
%tmp134 = icmp slt i32 %window.0, 3 ; <i1> [#uses=1]
br i1 %tmp134, label %bb113, label %bb137
bb137: ; preds = %bb132
%tmp139 = add i32 %sfb.0, 1 ; <i32> [#uses=1]
br label %bb140
bb140: ; preds = %bb341, %bb137
%sfb.0 = phi i32 [ %tmp139, %bb137 ], [ 0, %bb341 ] ; <i32> [#uses=3]
%tmp142 = icmp slt i32 %sfb.0, 6 ; <i1> [#uses=1]
br i1 %tmp142, label %bb132, label %bb174
bb166: ; preds = %bb174
%tmp160 = load %struct.BF_PartHolder*, %struct.BF_PartHolder** %tmp80, align 4 ; <%struct.BF_PartHolder*> [#uses=1]
%tmp162 = call %struct.BF_PartHolder* @BF_addEntry( %struct.BF_PartHolder* %tmp160, i32 0, i32 0 ) nounwind ; <%struct.BF_PartHolder*> [#uses=0]
unreachable
bb174: ; preds = %bb140
%tmp176 = icmp slt i32 6, 12 ; <i1> [#uses=1]
br i1 %tmp176, label %bb166, label %bb341
bb341: ; preds = %bb352, %bb174
%tmp80 = getelementptr [2 x [2 x %struct.BF_PartHolder*]], [2 x [2 x %struct.BF_PartHolder*]]* @scaleFactorsPH, i32 0, i32 0, i32 0 ; <%struct.BF_PartHolder**> [#uses=3]
%tmp92 = getelementptr [16 x i32], [16 x i32]* @slen1_tab, i32 0, i32 0 ; <i32*> [#uses=1]
%tmp93 = load i32, i32* %tmp92, align 4 ; <i32> [#uses=1]
br label %bb140
bb352: ; preds = %entry
%tmp354 = icmp slt i32 0, 2 ; <i1> [#uses=1]
br i1 %tmp354, label %bb341, label %return
bb498: ; preds = %entry
ret void
return: ; preds = %bb352
ret void
}
define void @getframebits(%struct.lame_global_flags* %gfp, i32* %bitsPerFrame, i32* %mean_bits) nounwind {
entry:
unreachable
}
define i32 @lame_encode_buffer(%struct.lame_global_flags* %gfp, i16* %buffer_l, i16* %buffer_r, i32 %nsamples, i8* %mp3buf, i32 %mp3buf_size) nounwind {
entry:
unreachable
}

View File

@@ -1,182 +0,0 @@
; RUN: opt -loop-deletion -disable-output < %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
%0 = type { %"class.llvm::SmallVectorImpl", [1 x %"union.llvm::SmallVectorBase::U"] }
%"class.clang::SourceLocation" = type { i32 }
%"class.clang::driver::Arg" = type { %"class.clang::driver::Option"*, %"class.clang::driver::Arg"*, i32, i8, %0 }
%"class.clang::driver::Option" = type { i32 (...)**, i32, %"class.clang::SourceLocation", i8*, %"class.clang::driver::OptionGroup"*, %"class.clang::driver::Option"*, i8 }
%"class.clang::driver::OptionGroup" = type { %"class.clang::driver::Option" }
%"class.llvm::SmallVectorBase" = type { i8*, i8*, i8*, %"union.llvm::SmallVectorBase::U" }
%"class.llvm::SmallVectorImpl" = type { %"class.llvm::SmallVectorTemplateBase" }
%"class.llvm::SmallVectorTemplateBase" = type { %"class.llvm::SmallVectorTemplateCommon" }
%"class.llvm::SmallVectorTemplateCommon" = type { %"class.llvm::SmallVectorBase" }
%"union.llvm::SmallVectorBase::U" = type { x86_fp80 }
define void @_ZNK5clang6driver7ArgList20AddAllArgsTranslatedERN4llvm11SmallVectorIPKcLj16EEENS0_12OptSpecifierES5_b(i1 zeroext %Joined) nounwind align 2 {
entry:
br i1 undef, label %entry.split.us, label %entry.entry.split_crit_edge
entry.entry.split_crit_edge: ; preds = %entry
br label %entry.split
entry.split.us: ; preds = %entry
br label %for.cond.i14.us
for.cond.i14.us: ; preds = %for.inc.i38.us, %entry.split.us
br i1 true, label %for.cond.i50.us-lcssa.us, label %if.end.i23.us
for.inc.i38.us: ; preds = %if.end.i23.us
br label %for.cond.i14.us
if.end.i23.us: ; preds = %for.cond.i14.us
br i1 true, label %for.cond.i50.us-lcssa.us, label %for.inc.i38.us
for.cond.i50.us-lcssa.us: ; preds = %if.end.i23.us, %for.cond.i14.us
br label %for.cond.i50
entry.split: ; preds = %entry.entry.split_crit_edge
br label %for.cond.i14
for.cond.i14: ; preds = %for.inc.i38, %entry.split
br i1 undef, label %for.cond.i50.us-lcssa, label %if.end.i23
if.end.i23: ; preds = %for.cond.i14
br i1 undef, label %for.cond.i50.us-lcssa, label %for.inc.i38
for.inc.i38: ; preds = %if.end.i23
br label %for.cond.i14
for.cond.i50.us-lcssa: ; preds = %if.end.i23, %for.cond.i14
br label %for.cond.i50
for.cond.i50: ; preds = %for.cond.i50.us-lcssa, %for.cond.i50.us-lcssa.us
br label %for.cond
for.cond.loopexit.us-lcssa: ; preds = %if.end.i, %for.cond.i
br label %for.cond.loopexit
for.cond.loopexit: ; preds = %for.cond.loopexit.us-lcssa.us, %for.cond.loopexit.us-lcssa
br label %for.cond
for.cond: ; preds = %for.cond.loopexit, %for.cond.i50
br i1 undef, label %for.end, label %for.body
for.body: ; preds = %for.cond
br i1 %Joined, label %if.then, label %if.else
if.then: ; preds = %for.body
br i1 undef, label %cond.false.i.i, label %_ZN4llvm9StringRefC1EPKc.exit
cond.false.i.i: ; preds = %if.then
unreachable
_ZN4llvm9StringRefC1EPKc.exit: ; preds = %if.then
br i1 undef, label %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit, label %cond.false.i.i91
cond.false.i.i91: ; preds = %_ZN4llvm9StringRefC1EPKc.exit
unreachable
_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit: ; preds = %_ZN4llvm9StringRefC1EPKc.exit
br i1 undef, label %cond.false.i.i.i, label %if.end13.i.i.i.i
if.end13.i.i.i.i: ; preds = %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit
br i1 undef, label %land.lhs.true16.i.i.i.i, label %if.end19.i.i.i.i
land.lhs.true16.i.i.i.i: ; preds = %if.end13.i.i.i.i
br i1 undef, label %cond.false.i.i.i, label %_ZNK4llvm5Twine8isBinaryEv.exit8.i.i.i.i
_ZNK4llvm5Twine8isBinaryEv.exit8.i.i.i.i: ; preds = %land.lhs.true16.i.i.i.i
br i1 undef, label %cond.false.i.i.i, label %if.end19.i.i.i.i
if.end19.i.i.i.i: ; preds = %_ZNK4llvm5Twine8isBinaryEv.exit8.i.i.i.i, %if.end13.i.i.i.i
br i1 undef, label %land.lhs.true22.i.i.i.i, label %_ZN4llvmplERKNS_9StringRefEPKc.exit
land.lhs.true22.i.i.i.i: ; preds = %if.end19.i.i.i.i
br i1 undef, label %cond.false.i.i.i, label %_ZNK4llvm5Twine8isBinaryEv.exit.i.i.i.i
_ZNK4llvm5Twine8isBinaryEv.exit.i.i.i.i: ; preds = %land.lhs.true22.i.i.i.i
br i1 undef, label %cond.false.i.i.i, label %_ZN4llvmplERKNS_9StringRefEPKc.exit
cond.false.i.i.i: ; preds = %_ZNK4llvm5Twine8isBinaryEv.exit.i.i.i.i, %land.lhs.true22.i.i.i.i, %_ZNK4llvm5Twine8isBinaryEv.exit8.i.i.i.i, %land.lhs.true16.i.i.i.i, %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit
unreachable
_ZN4llvmplERKNS_9StringRefEPKc.exit: ; preds = %_ZNK4llvm5Twine8isBinaryEv.exit.i.i.i.i, %if.end19.i.i.i.i
br i1 undef, label %Retry.i, label %if.end.i99
Retry.i: ; preds = %if.end.i99, %_ZN4llvmplERKNS_9StringRefEPKc.exit
br i1 undef, label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit, label %new.notnull.i
new.notnull.i: ; preds = %Retry.i
br label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit
if.end.i99: ; preds = %_ZN4llvmplERKNS_9StringRefEPKc.exit
br label %Retry.i
_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit: ; preds = %new.notnull.i, %Retry.i
br label %for.cond.i.preheader
if.else: ; preds = %for.body
br i1 undef, label %Retry.i108, label %if.end.i113
Retry.i108: ; preds = %if.end.i113, %if.else
br i1 undef, label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit114, label %new.notnull.i110
new.notnull.i110: ; preds = %Retry.i108
br label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit114
if.end.i113: ; preds = %if.else
br label %Retry.i108
_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit114: ; preds = %new.notnull.i110, %Retry.i108
br i1 undef, label %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit125, label %cond.false.i.i123
cond.false.i.i123: ; preds = %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit114
unreachable
_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit125: ; preds = %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit114
br i1 undef, label %Retry.i134, label %if.end.i139
Retry.i134: ; preds = %if.end.i139, %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit125
br i1 undef, label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit140, label %new.notnull.i136
new.notnull.i136: ; preds = %Retry.i134
br label %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit140
if.end.i139: ; preds = %_ZNK5clang6driver3Arg8getValueERKNS0_7ArgListEj.exit125
br label %Retry.i134
_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit140: ; preds = %new.notnull.i136, %Retry.i134
br label %for.cond.i.preheader
for.cond.i.preheader: ; preds = %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit140, %_ZN4llvm15SmallVectorImplIPKcE9push_backERKS2_.exit
br i1 undef, label %for.cond.i.preheader.split.us, label %for.cond.i.preheader.for.cond.i.preheader.split_crit_edge
for.cond.i.preheader.for.cond.i.preheader.split_crit_edge: ; preds = %for.cond.i.preheader
br label %for.cond.i.preheader.split
for.cond.i.preheader.split.us: ; preds = %for.cond.i.preheader
br label %for.cond.i.us
for.cond.i.us: ; preds = %if.end.i.us, %for.cond.i.preheader.split.us
br i1 true, label %for.cond.loopexit.us-lcssa.us, label %if.end.i.us
if.end.i.us: ; preds = %for.cond.i.us
br i1 true, label %for.cond.loopexit.us-lcssa.us, label %for.cond.i.us
for.cond.loopexit.us-lcssa.us: ; preds = %if.end.i.us, %for.cond.i.us
%tmp178218.us.lcssa = phi %"class.clang::driver::Arg"** [ undef, %if.end.i.us ], [ undef, %for.cond.i.us ]
br label %for.cond.loopexit
for.cond.i.preheader.split: ; preds = %for.cond.i.preheader.for.cond.i.preheader.split_crit_edge
br label %for.cond.i
for.cond.i: ; preds = %if.end.i, %for.cond.i.preheader.split
br i1 undef, label %for.cond.loopexit.us-lcssa, label %if.end.i
if.end.i: ; preds = %for.cond.i
br i1 undef, label %for.cond.loopexit.us-lcssa, label %for.cond.i
for.end: ; preds = %for.cond
ret void
}

View File

@@ -1,56 +0,0 @@
; RUN: opt < %s -loop-deletion -S
; RUN: opt < %s -loop-deletion -analyze -domtree 2>&1 | FileCheck -check-prefix=DT %s
; RUN: opt < %s -loop-deletion -analyze -verify-dom-info
; CHECK: for.body
; CHECK-NOT: for.cond1
; Verify only the important parts of the DomTree.
; DT: [1] %entry
; DT: [2] %for.cond
; DT: [3] %lbl63A679E5
; DT: [3] %for.cond9
; DT: [3] %lbl64774A9B
; DT: [3] %for.body
; DT: [4] %for.cond3.loopexit
define i32 @fn1() {
entry:
br label %for.cond
for.cond: ; preds = %entry
br i1 undef, label %lbl63A679E5, label %for.body
for.body: ; preds = %for.cond
br label %for.cond1
for.cond1: ; preds = %for.cond1, %for.body
br i1 undef, label %for.cond1, label %for.cond3.loopexit
for.cond3.loopexit: ; preds = %for.cond1
br label %for.cond3
for.cond3: ; preds = %for.cond9, %for.cond3.loopexit
br i1 undef, label %for.body4, label %for.cond17
for.body4: ; preds = %for.cond3
br label %for.cond5
for.cond5: ; preds = %lbl63A679E5, %for.body4
br label %for.cond9
lbl63A679E5: ; preds = %for.cond
br label %for.cond5
for.cond9: ; preds = %for.end14.split, %for.cond5
br i1 undef, label %for.cond3, label %lbl64774A9B
lbl64774A9B: ; preds = %for.cond17, %for.cond9
br label %for.end14.split
for.end14.split: ; preds = %lbl64774A9B
br label %for.cond9
for.cond17: ; preds = %for.cond3
br label %lbl64774A9B
}

View File

@@ -1,36 +0,0 @@
; This is the test case taken from Appel's book that illustrates a hard case
; that SCCP gets right, and when followed by ADCE, is completely eliminated
;
; RUN: opt < %s -sccp -simplifycfg -indvars -loop-deletion -dce -simplifycfg -S | not grep br
define i32 @"test function"(i32 %i0, i32 %j0) {
BB1:
br label %BB2
BB2: ; preds = %BB7, %BB1
%j2 = phi i32 [ %j4, %BB7 ], [ 1, %BB1 ] ; <i32> [#uses=2]
%k2 = phi i32 [ %k4, %BB7 ], [ 0, %BB1 ] ; <i32> [#uses=4]
%kcond = icmp slt i32 %k2, 100 ; <i1> [#uses=1]
br i1 %kcond, label %BB3, label %BB4
BB3: ; preds = %BB2
%jcond = icmp slt i32 %j2, 20 ; <i1> [#uses=1]
br i1 %jcond, label %BB5, label %BB6
BB4: ; preds = %BB2
ret i32 %j2
BB5: ; preds = %BB3
%k3 = add i32 %k2, 1 ; <i32> [#uses=1]
br label %BB7
BB6: ; preds = %BB3
%k5 = add i32 %k2, 1 ; <i32> [#uses=1]
br label %BB7
BB7: ; preds = %BB6, %BB5
%j4 = phi i32 [ 1, %BB5 ], [ %k2, %BB6 ] ; <i32> [#uses=1]
%k4 = phi i32 [ %k3, %BB5 ], [ %k5, %BB6 ] ; <i32> [#uses=1]
br label %BB2
}

View File

@@ -1,42 +0,0 @@
; Ensure we don't run analyses over loops after they've been deleted. We run
; one version with a no-op loop pass to make sure that the loop doesn't get
; simplified away.
;
; RUN: opt < %s -passes='require<ivusers>,no-op-loop,require<ivusers>' -S \
; RUN: | FileCheck %s --check-prefixes=CHECK,BEFORE
; RUN: opt < %s -passes='require<ivusers>,loop-deletion,require<ivusers>' -S \
; RUN: | FileCheck %s --check-prefixes=CHECK,AFTER
define void @foo(i64 %n, i64 %m) nounwind {
; CHECK-LABEL: @foo(
entry:
br label %bb
; CHECK: entry:
; BEFORE-NEXT: br label %bb
; AFTER-NEXT: br label %return
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb2 ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
br i1 %t1, label %bb2, label %return
; BEFORE: bb:
; BEFORE: br i1 {{.*}}, label %bb2, label %return
; AFTER-NOT: bb:
; AFTER-NOT: br
bb2:
%t2 = icmp slt i64 %x.0, %m
br i1 %t1, label %bb, label %return
; BEFORE: bb2:
; BEFORE: br i1 {{.*}}, label %bb, label %return
; AFTER-NOT: bb2:
; AFTER-NOT: br
return:
ret void
; CHECK: return:
; CHECK-NEXT: ret void
}

View File

@@ -1,28 +0,0 @@
; RUN: opt < %s -loop-deletion -S | FileCheck %s
; RUN: opt < %s -passes='loop(loop-deletion)' -S | FileCheck %s
; ScalarEvolution can prove the loop iteration is finite, even though
; it can't represent the exact trip count as an expression. That's
; good enough to let the loop be deleted.
; CHECK: entry:
; CHECK-NEXT: br label %return
; CHECK: return:
; CHECK-NEXT: ret void
define void @foo(i64 %n, i64 %m) nounwind {
entry:
br label %bb
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br i1 %t4, label %bb, label %return
return:
ret void
}

View File

@@ -1,138 +0,0 @@
; Checks whether dead loops with multiple exits can be eliminated.
; Note that we loop simplify and LCSSA over the test cases to make sure the
; critical components remain after those passes and are visible to the loop
; deletion pass.
;
; RUN: opt < %s -loop-simplify -lcssa -S | FileCheck %s --check-prefixes=CHECK,BEFORE
; RUN: opt < %s -loop-deletion -S | FileCheck %s --check-prefixes=CHECK,AFTER
;
; RUN: opt < %s -passes=no-op-loop -S | FileCheck %s --check-prefixes=CHECK,BEFORE
; RUN: opt < %s -passes=loop-deletion -S | FileCheck %s --check-prefixes=CHECK,AFTER
define void @foo(i64 %n, i64 %m) nounwind {
; CHECK-LABEL: @foo(
entry:
br label %bb
; CHECK: entry:
; BEFORE-NEXT: br label %bb
; AFTER-NEXT: br label %return
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb2 ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
br i1 %t1, label %bb2, label %return
; BEFORE: bb:
; BEFORE: br i1 {{.*}}, label %bb2, label %return
; AFTER-NOT: bb:
; AFTER-NOT: br
bb2:
%t2 = icmp slt i64 %x.0, %m
br i1 %t1, label %bb, label %return
; BEFORE: bb2:
; BEFORE: br i1 {{.*}}, label %bb, label %return
; AFTER-NOT: bb2:
; AFTER-NOT: br
return:
ret void
; CHECK: return:
; CHECK-NEXT: ret void
}
define i64 @bar(i64 %n, i64 %m, i64 %maybe_zero) nounwind {
; CHECK-LABEL: @bar(
entry:
br label %bb
; CHECK: entry:
; BEFORE-NEXT: br label %bb
; AFTER-NEXT: br label %return
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb3 ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
br i1 %t1, label %bb2, label %return
; BEFORE: bb:
; BEFORE: br i1 {{.*}}, label %bb2, label %return
; AFTER-NOT: bb:
; AFTER-NOT: br
bb2:
%t2 = icmp slt i64 %x.0, %m
; This unused division prevents unifying this loop exit path with others
; because it can be deleted but cannot be hoisted.
%unused1 = udiv i64 42, %maybe_zero
br i1 %t2, label %bb3, label %return
; BEFORE: bb2:
; BEFORE: br i1 {{.*}}, label %bb3, label %return
; AFTER-NOT: bb2:
; AFTER-NOT: br
bb3:
%t3 = icmp slt i64 %x.0, %m
; This unused division prevents unifying this loop exit path with others
; because it can be deleted but cannot be hoisted.
%unused2 = sdiv i64 42, %maybe_zero
br i1 %t3, label %bb, label %return
; BEFORE: bb3:
; BEFORE: br i1 {{.*}}, label %bb, label %return
; AFTER-NOT: bb3:
; AFTER-NOT: br
return:
%x.lcssa = phi i64 [ 10, %bb ], [ 10, %bb2 ], [ 10, %bb3 ]
ret i64 %x.lcssa
; CHECK: return:
; BEFORE-NEXT: %[[X:.*]] = phi i64 [ 10, %bb ], [ 10, %bb2 ], [ 10, %bb3 ]
; AFTER-NEXT: %[[X:.*]] = phi i64 [ 10, %entry ]
; CHECK-NEXT: ret i64 %[[X]]
}
; This function has a loop which looks like @bar's but that cannot be deleted
; because which path we exit through determines which value is selected.
define i64 @baz(i64 %n, i64 %m, i64 %maybe_zero) nounwind {
; CHECK-LABEL: @baz(
entry:
br label %bb
; CHECK: entry:
; CHECK-NEXT: br label %bb
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb3 ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
br i1 %t1, label %bb2, label %return
; CHECK: bb:
; CHECK: br i1 {{.*}}, label %bb2, label %return
bb2:
%t2 = icmp slt i64 %x.0, %m
; This unused division prevents unifying this loop exit path with others
; because it can be deleted but cannot be hoisted.
%unused1 = udiv i64 42, %maybe_zero
br i1 %t2, label %bb3, label %return
; CHECK: bb2:
; CHECK: br i1 {{.*}}, label %bb3, label %return
bb3:
%t3 = icmp slt i64 %x.0, %m
; This unused division prevents unifying this loop exit path with others
; because it can be deleted but cannot be hoisted.
%unused2 = sdiv i64 42, %maybe_zero
br i1 %t3, label %bb, label %return
; CHECK: bb3:
; CHECK: br i1 {{.*}}, label %bb, label %return
return:
%x.lcssa = phi i64 [ 12, %bb ], [ 10, %bb2 ], [ 10, %bb3 ]
ret i64 %x.lcssa
; CHECK: return:
; CHECK-NEXT: %[[X:.*]] = phi i64 [ 12, %bb ], [ 10, %bb2 ], [ 10, %bb3 ]
; CHECK-NEXT: ret i64 %[[X]]
}

View File

@@ -1,67 +0,0 @@
; RUN: opt < %s -S -indvars -loop-deletion -simplifycfg | FileCheck %s
; PR5794
; Indvars and loop deletion should be able to eliminate all looping
; in this testcase.
; CHECK: define i32 @pmat(i32 %m, i32 %n, double* %y) #0 {
; CHECK-NEXT: entry:
; CHECK-NEXT: ret i32 0
; CHECK-NEXT: }
target datalayout = "e-p:64:64:64"
define i32 @pmat(i32 %m, i32 %n, double* %y) nounwind {
entry:
%cmp4 = icmp sgt i32 %m, 0
br i1 %cmp4, label %bb.n10, label %w.e12
w.c:
%cmp = icmp slt i32 %inc11, %m
br i1 %cmp, label %w.c2.p, label %w.c.w.e12c
w.c.w.e12c:
br label %w.c.w.e12c.s
w.c.w.e12c.s:
br label %w.e12
bb.n10:
%cmp51 = icmp sgt i32 %n, 0
br i1 %cmp51, label %bb.n10.w.c.w.e12c.sc, label %bb.n10.bb.n10.sc
bb.n10.bb.n10.sc:
br label %bb.n10.s
bb.n10.w.c.w.e12c.sc:
br label %w.c.w.e12c.s
bb.n10.s:
br label %w.c2.p
w.c2.p:
%i.05 = phi i32 [ 0, %bb.n10.s ], [ %inc11, %w.c ]
br i1 false, label %bb.n, label %w.e
w.c2:
br i1 undef, label %w.b6, label %w.c2.w.ec
w.c2.w.ec:
br label %w.e
bb.n:
br label %w.b6
w.b6:
br label %w.c2
w.e:
%i.08 = phi i32 [ undef, %w.c2.w.ec ], [ %i.05, %w.c2.p ]
%inc11 = add nsw i32 %i.08, 1
br label %w.c
w.e12:
ret i32 0
}
; CHECK: attributes #0 = { nounwind }

View File

@@ -1,412 +0,0 @@
; RUN: opt < %s -loop-deletion -verify-dom-info -S | FileCheck %s
; Checking that we can delete loops that are never executed.
; We do not change the constant conditional branch statement (where the not-taken target
; is the loop) to an unconditional one.
; delete the infinite loop because it is never executed.
define void @test1(i64 %n, i64 %m) nounwind {
; CHECK-LABEL: test1
; CHECK-LABEL: entry:
; CHECK-NEXT: br i1 true, label %return, label %bb.preheader
; CHECK-NOT: bb:
entry:
br i1 true, label %return, label %bb
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br i1 true, label %bb, label %return
return:
ret void
}
; FIXME: We can delete this infinite loop. Currently we do not,
; because the infinite loop has no exit block.
define void @test2(i64 %n, i64 %m) nounwind {
; CHECK-LABEL: test2
; CHECK-LABEL: entry:
; CHECK-NEXT: br i1 true, label %return, label %bb.preheader
; CHECK-LABEL: bb:
; CHECK: br label %bb
entry:
br i1 true, label %return, label %bb
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br label %bb
return:
ret void
}
; There are multiple exiting blocks and a single exit block.
; Since it is a never executed loop, we do not care about the values
; from different exiting paths and we can
; delete the loop.
define i64 @test3(i64 %n, i64 %m, i64 %maybe_zero) nounwind {
; CHECK-NOT: bb:
; CHECK-NOT: bb2:
; CHECK-NOT: bb3:
; CHECK-LABEL: return.loopexit:
; CHECK-NEXT: %x.lcssa.ph = phi i64 [ undef, %bb.preheader ]
; CHECK-NEXT: br label %return
; CHECK-LABEL: return:
; CHECK-NEXT: %x.lcssa = phi i64 [ 20, %entry ], [ %x.lcssa.ph, %return.loopexit ]
; CHECK-NEXT: ret i64 %x.lcssa
entry:
br i1 false, label %bb, label %return
bb:
%x.0 = phi i64 [ 0, %entry ], [ %t0, %bb3 ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
br i1 %t1, label %bb2, label %return
bb2:
%t2 = icmp slt i64 %x.0, %m
%unused1 = udiv i64 42, %maybe_zero
br i1 %t2, label %bb3, label %return
bb3:
%t3 = icmp slt i64 %x.0, %m
%unused2 = sdiv i64 42, %maybe_zero
br i1 %t3, label %bb, label %return
return:
; the only valid value fo x.lcssa is 20.
%x.lcssa = phi i64 [ 12, %bb ], [ 14, %bb2 ], [ 16, %bb3 ], [20, %entry ]
ret i64 %x.lcssa
}
; Cannot delete the loop, since it may be executed at runtime.
define void @test4(i64 %n, i64 %m, i1 %cond) {
; CHECK-LABEL: test4
; CHECK-LABEL: bb:
entry:
br i1 %cond, label %looppred1, label %looppred2
looppred1:
br i1 true, label %return, label %bb
looppred2:
br i1 false, label %return, label %bb
bb:
%x.0 = phi i64 [ 0, %looppred1 ], [ 1, %looppred2 ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br i1 true, label %bb, label %return
return:
ret void
}
; multiple constant conditional branches with loop not-taken in all cases.
define void @test5(i64 %n, i64 %m, i1 %cond) nounwind {
; CHECK-LABEL: test5
; CHECK-LABEL: looppred1:
; CHECK-NEXT: br i1 true, label %return, label %bb.preheader
; CHECK-LABEL: looppred2:
; CHECK-NEXT: br i1 true, label %return, label %bb.preheader
; CHECK-NOT: bb:
entry:
br i1 %cond, label %looppred1, label %looppred2
looppred1:
br i1 true, label %return, label %bb
looppred2:
br i1 true, label %return, label %bb
bb:
%x.0 = phi i64 [ 0, %looppred1 ], [ 1, %looppred2 ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br i1 true, label %bb, label %return
return:
ret void
}
; Don't delete this infinite loop because the loop
; is executable at runtime.
define void @test6(i64 %n, i64 %m) nounwind {
; CHECK-LABEL: test6
; CHECK-LABEL: entry:
; CHECK-NEXT: br i1 true, label %bb.preheader, label %bb.preheader
; CHECK: bb:
entry:
br i1 true, label %bb, label %bb
bb:
%x.0 = phi i64 [ 0, %entry ], [ 0, %entry ], [ %t0, %bb ]
%t0 = add i64 %x.0, 1
%t1 = icmp slt i64 %x.0, %n
%t3 = icmp sgt i64 %x.0, %m
%t4 = and i1 %t1, %t3
br i1 true, label %bb, label %return
return:
ret void
}
declare i64 @foo(i64)
; The loop L2 is never executed and is a subloop, with an
; exit block that branches back to parent loop.
; Here we can delete loop L2, while L1 still exists.
define i64 @test7(i64 %n) {
; CHECK-LABEL: test7
; CHECK-LABEL: L1:
; CHECK: br i1 true, label %L1Latch, label %L2.preheader
; CHECK-LABEL: L2.preheader:
; CHECK-NEXT: br label %L1Latch.loopexit
; CHECK-LABEL: L1Latch.loopexit:
; CHECK: br label %L1Latch
; CHECK-LABEL: L1Latch:
; CHECK-NEXT: %y = phi i64 [ %y.next, %L1 ], [ %y.L2.lcssa, %L1Latch.loopexit ]
; CHECK: br i1 %cond2, label %exit, label %L1
entry:
br label %L1
L1:
%y.next = phi i64 [ 0, %entry ], [ %y.add, %L1Latch ]
br i1 true, label %L1Latch, label %L2
L2:
%x = phi i64 [ 0, %L1 ], [ %x.next, %L2 ]
%x.next = add i64 %x, 1
%y.L2 = call i64 @foo(i64 %x.next)
%cond = icmp slt i64 %x.next, %n
br i1 %cond, label %L2, label %L1Latch
L1Latch:
%y = phi i64 [ %y.next, %L1 ], [ %y.L2, %L2 ]
%y.add = add i64 %y, %n
%cond2 = icmp eq i64 %y.add, 42
br i1 %cond2, label %exit, label %L1
exit:
ret i64 %y.add
}
; Show recursive deletion of loops. Since we start with subloops and progress outward
; to parent loop, we first delete the loop L2. Now loop L1 becomes a non-loop since it's backedge
; from L2's preheader to L1's exit block is never taken. So, L1 gets deleted as well.
define void @test8(i64 %n) {
; CHECK-LABEL: test8
; CHECK-LABEL: entry:
; CHECK-NEXT: br label %exit
; CHECK-LABEL: exit:
; CHECK-NEXT: ret void
entry:
br label %L1
L1:
br i1 true, label %exit, label %L2
L2:
%x = phi i64 [ 0, %L1 ], [ %x.next, %L2 ]
%x.next = add i64 %x, 1
%y.L2 = call i64 @foo(i64 %x.next)
%cond = icmp slt i64 %x.next, %n
br i1 %cond, label %L2, label %L1
exit:
ret void
}
; Delete a loop (L2) which has subloop (L3).
; Here we delete loop L2, but leave L3 as is.
; FIXME: Can delete L3 as well, by iteratively going backward through the single
; predecessor of L3 until we reach L1's block that guarantees L3 is never
; executed.
define void @test9(i64 %n) {
; CHECK-LABEL: test9
; CHECK-LABEL: L2.preheader:
; CHECK-NEXT: br label %L3.preheader
; CHECK-NOT: L2:
; CHECK-LABEL: L3.preheader:
; CHECK-NEXT: %y.L2.lcssa = phi i64 [ undef, %L2.preheader ]
; CHECK-NEXT: br label %L3
; CHECK-LABEL: L3:
; CHECK: br i1 %cond2, label %L3, label %L1.loopexit
entry:
br label %L1
L1:
br i1 true, label %exit, label %L2
L2:
%x = phi i64 [ 0, %L1 ], [ %x.next, %L2 ]
%x.next = add i64 %x, 1
%y.L2 = call i64 @foo(i64 %x.next)
%cond = icmp slt i64 %x.next, %n
br i1 %cond, label %L2, label %L3
L3:
%cond2 = icmp slt i64 %y.L2, %n
br i1 %cond2, label %L3, label %L1
exit:
ret void
}
; We cannot delete L3 because of call within it.
; Since L3 is not deleted, and entirely contained within L2, L2 is also not
; deleted.
; FIXME: We can delete unexecutable loops having
; subloops contained entirely within them.
define void @test10(i64 %n) {
; CHECK-LABEL: test10
; CHECK: L2:
; CHECK: L3:
entry:
br label %L1
L1:
br i1 true, label %exit, label %L2
L2:
%x = phi i64 [ 0, %L1 ], [ %x.next, %L3 ]
%x.next = add i64 %x, 1
%y.L2 = call i64 @foo(i64 %x.next)
%cond = icmp slt i64 %x.next, %n
br i1 %cond, label %L1, label %L3
L3:
%y.L3 = phi i64 [ %y.L2, %L2 ], [ %y.L3.next, %L3 ]
%y.L3.next = add i64 %y.L3, 1
%dummy = call i64 @foo(i64 %y.L3.next)
%cond2 = icmp slt i64 %y.L3, %n
br i1 %cond2, label %L3, label %L2
exit:
ret void
}
; same as test10, but L3 does not contain call.
; So, in the first iteration, all statements of L3 are made invariant, and L3 is
; deleted.
; In the next iteration, since L2 is never executed and has no subloops, we delete
; L2 as well. Finally, the outermost loop L1 is deleted.
define void @test11(i64 %n) {
; CHECK-LABEL: test11
; CHECK-LABEL: entry:
; CHECK-NEXT: br label %exit
; CHECK-LABEL: exit:
; CHECK-NEXT: ret void
entry:
br label %L1
L1:
br i1 true, label %exit, label %L2
L2:
%x = phi i64 [ 0, %L1 ], [ %x.next, %L3 ]
%x.next = add i64 %x, 1
%y.L2 = call i64 @foo(i64 %x.next)
%cond = icmp slt i64 %x.next, %n
br i1 %cond, label %L1, label %L3
L3:
%y.L3 = phi i64 [ %y.L2, %L2 ], [ %y.L3.next, %L3 ]
%y.L3.next = add i64 %y.L3, 1
%cond2 = icmp slt i64 %y.L3, %n
br i1 %cond2, label %L3, label %L2
exit:
ret void
}
; 2 edges from a single exiting block to the exit block.
define i64 @test12(i64 %n){
;CHECK-LABEL: @test12
; CHECK-NOT: L1:
; CHECK-NOT: L1Latch:
; CHECK-LABEL: L1.preheader:
; CHECK-NEXT: br label %exit
; CHECK-LABEL: exit:
; CHECK-NEXT: %y.phi = phi i64 [ undef, %L1.preheader ]
; CHECK-NEXT: ret i64 %y.phi
entry:
br i1 true, label %exit1, label %L1
exit1:
ret i64 42
L1: ; preds = %L1Latch, %entry
%y.next = phi i64 [ 0, %entry ], [ %y.add, %L1Latch ]
br i1 true, label %L1Latch, label %exit
L1Latch: ; preds = %L1
%y = phi i64 [ %y.next, %L1 ]
%y.add = add i64 %y, %n
%cond2 = icmp eq i64 %y.add, 42
switch i64 %n, label %L1 [
i64 10, label %exit
i64 20, label %exit
]
exit: ; preds = %L1Latch, %L1Latch
%y.phi = phi i64 [ 10, %L1Latch ], [ 10, %L1Latch ], [ %y.next, %L1]
ret i64 %y.phi
}
; multiple edges to exit block from the same exiting blocks
define i64 @test13(i64 %n) {
; CHECK-LABEL: @test13
; CHECK-NOT: L1:
; CHECK-NOT: L1Latch:
; CHECK-LABEL: L1.preheader:
; CHECK-NEXT: br label %exit
; CHECK-LABEL: exit:
; CHECK-NEXT: %y.phi = phi i64 [ undef, %L1.preheader ]
; CHECK-NEXT: ret i64 %y.phi
entry:
br i1 true, label %exit1, label %L1
exit1:
ret i64 42
L1: ; preds = %L1Latch, %entry
%y.next = phi i64 [ 0, %entry ], [ %y.add, %L1Latch ]
br i1 true, label %L1Block, label %exit
L1Block: ; preds = %L1
%y = phi i64 [ %y.next, %L1 ]
%y.add = add i64 %y, %n
%cond2 = icmp eq i64 %y.add, 42
switch i64 %n, label %L1Latch [
i64 10, label %exit
i64 20, label %exit
]
L1Latch:
switch i64 %n, label %L1 [
i64 30, label %exit
i64 40, label %exit
]
exit: ; preds = %L1Block, %L1, %L1Latch
%y.phi = phi i64 [ 10, %L1Block ], [ 10, %L1Block ], [ %y.next, %L1 ], [ 30, %L1Latch ], [ 30, %L1Latch ]
ret i64 %y.phi
}

View File

@@ -1,56 +0,0 @@
; RUN: opt -S -analyze -scalar-evolution -loop-deletion -scalar-evolution < %s | FileCheck %s --check-prefix=SCEV-EXPRS
; RUN: opt -S -loop-deletion < %s | FileCheck %s --check-prefix=IR-AFTER-TRANSFORM
; RUN: opt -S -indvars -loop-deletion -indvars < %s | FileCheck %s --check-prefix=ORIGINAL-CRASH
; Checking for a crash. Loop-deletion would change the loop
; disposition of an instruction, but not update SCEV.
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.11.0"
define void @pr27570() {
; IR-AFTER-TRANSFORM-LABEL: @pr27570(
; ORIGINAL-CRASH: @pr27570(
entry:
br label %for.cond
for.cond: ; preds = %for.cond14, %entry
%f.0 = phi i32 [ 20, %entry ], [ 0, %for.cond14 ]
br label %for.body
for.body: ; preds = %for.inc11, %for.cond
; IR-AFTER-TRANSFORM: for.body:
; IR-AFTER-TRANSFORM: %cmp = icmp eq i32 %val, -1
; IR-AFTER-TRANSFORM: %conv7 = zext i1 %cmp to i32
; IR-AFTER-TRANSFORM: for.body6:
; SCEV-EXPRS: %conv7 = zext i1 %cmp to i32
; SCEV-EXPRS: %conv7 = zext i1 %cmp to i32
; SCEV-EXPRS-NEXT: --> {{.*}} LoopDispositions: { %for.body: Variant, %for.cond: Variant, %for.body6: Invariant }
%val = phi i32 [ -20, %for.cond ], [ %inc12, %for.inc11 ]
%g.040 = phi i32 [ -20, %for.cond ], [ %and.lcssa, %for.inc11 ]
br label %for.body6
for.body6: ; preds = %for.body6, %for.body
%h.039 = phi i32 [ 1, %for.body ], [ %inc, %for.body6 ]
%g.138 = phi i32 [ %g.040, %for.body ], [ %and, %for.body6 ]
%cmp = icmp eq i32 %val, -1
%conv7 = zext i1 %cmp to i32
%add.i = add nsw i32 %conv7, %h.039
%sext = shl i32 %add.i, 24
%conv8 = ashr exact i32 %sext, 24
%cmp9 = icmp eq i32 %conv8, %f.0
%conv10 = zext i1 %cmp9 to i32
%and = and i32 %conv10, %g.138
%inc = add i32 %h.039, 1
br i1 undef, label %for.inc11, label %for.body6
for.inc11: ; preds = %for.body6
%and.lcssa = phi i32 [ %and, %for.body6 ]
%inc12 = add nsw i32 %val, 1
%tobool = icmp eq i32 %inc12, 0
br i1 %tobool, label %for.cond14, label %for.body
for.cond14: ; preds = %for.cond14, %for.inc11
br i1 undef, label %for.cond, label %for.cond14
}