Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / Transforms / LoopUnroll / revert-D110922.ll
blob07d536d37875c905fafeaab39bb0acf900455939
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; ModuleID = 'reduced.ll'
3 ; RUN: opt < %s -passes=loop-unroll -verify-loop-lcssa -S | FileCheck %s
5 source_filename = "reduced.ll"
7 %"class.std::__Cr::basic_ostream" = type { ptr, %"class.std::__Cr::basic_ios" }
8 %"class.std::__Cr::basic_ios" = type { %"class.std::__Cr::ios_base", ptr, i32 }
9 %"class.std::__Cr::ios_base" = type { ptr, i32, i32, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, i32, i32 }
10 %"class.v8::internal::wasm::StructType" = type { i32, ptr, ptr, ptr }
11 %"class.v8::internal::wasm::ValueType" = type { i32 }
13 $_ZNK2v88internal4wasm10StructType12field_offsetEj = comdat any
15 declare hidden ptr @_ZNSt4__CrlsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc() local_unnamed_addr
17 define hidden void @_ZN2v88internal10WasmStruct15WasmStructPrintERNSt4__Cr13basic_ostreamIcNS2_11char_traitsIcEEEE() local_unnamed_addr align 2 {
18 ; CHECK-LABEL: @_ZN2v88internal10WasmStruct15WasmStructPrintERNSt4__Cr13basic_ostreamIcNS2_11char_traitsIcEEEE(
19 ; CHECK-NEXT:  entry:
20 ; CHECK-NEXT:    [[CALL61:%.*]] = tail call i32 @_ZNK2v88internal4wasm10StructType11field_countEv()
21 ; CHECK-NEXT:    [[CMP2_NOT:%.*]] = icmp eq i32 [[CALL61]], 0
22 ; CHECK-NEXT:    br i1 [[CMP2_NOT]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY_PREHEADER:%.*]]
23 ; CHECK:       for.body.preheader:
24 ; CHECK-NEXT:    br label [[FOR_BODY_PEEL_BEGIN:%.*]]
25 ; CHECK:       for.body.peel.begin:
26 ; CHECK-NEXT:    br label [[FOR_BODY_PEEL:%.*]]
27 ; CHECK:       for.body.peel:
28 ; CHECK-NEXT:    tail call void @llvm.assume(i1 true)
29 ; CHECK-NEXT:    [[CALL13_PEEL:%.*]] = tail call i8 @_ZNK2v88internal4wasm9ValueType4kindEv()
30 ; CHECK-NEXT:    switch i8 [[CALL13_PEEL]], label [[FOR_INC_PEEL:%.*]] [
31 ; CHECK-NEXT:    i8 5, label [[SW_BB33_PEEL:%.*]]
32 ; CHECK-NEXT:    i8 9, label [[SW_BB31:%.*]]
33 ; CHECK-NEXT:    i8 8, label [[SW_BB31]]
34 ; CHECK-NEXT:    i8 11, label [[SW_BB31]]
35 ; CHECK-NEXT:    i8 10, label [[SW_BB31]]
36 ; CHECK-NEXT:    ]
37 ; CHECK:       sw.bb33.peel:
38 ; CHECK-NEXT:    [[CALL34_PEEL:%.*]] = tail call ptr @_ZNSt4__CrlsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc()
39 ; CHECK-NEXT:    br label [[FOR_INC_PEEL]]
40 ; CHECK:       for.inc.peel:
41 ; CHECK-NEXT:    [[CALL6_PEEL:%.*]] = tail call i32 @_ZNK2v88internal4wasm10StructType11field_countEv()
42 ; CHECK-NEXT:    [[CMP_PEEL:%.*]] = icmp ugt i32 [[CALL6_PEEL]], 1
43 ; CHECK-NEXT:    br i1 [[CMP_PEEL]], label [[FOR_BODY_PEEL_NEXT:%.*]], label [[FOR_COND_CLEANUP_LOOPEXIT:%.*]]
44 ; CHECK:       for.body.peel.next:
45 ; CHECK-NEXT:    br label [[FOR_BODY_PEEL_NEXT1:%.*]]
46 ; CHECK:       for.body.peel.next1:
47 ; CHECK-NEXT:    br label [[FOR_BODY_PREHEADER_PEEL_NEWPH:%.*]]
48 ; CHECK:       for.body.preheader.peel.newph:
49 ; CHECK-NEXT:    br label [[FOR_BODY:%.*]]
50 ; CHECK:       for.cond.cleanup.loopexit.loopexit:
51 ; CHECK-NEXT:    br label [[FOR_COND_CLEANUP_LOOPEXIT]]
52 ; CHECK:       for.cond.cleanup.loopexit:
53 ; CHECK-NEXT:    br label [[FOR_COND_CLEANUP]]
54 ; CHECK:       for.cond.cleanup:
55 ; CHECK-NEXT:    ret void
56 ; CHECK:       for.body:
57 ; CHECK-NEXT:    tail call void @llvm.assume(i1 false)
58 ; CHECK-NEXT:    [[CALL13:%.*]] = tail call i8 @_ZNK2v88internal4wasm9ValueType4kindEv()
59 ; CHECK-NEXT:    switch i8 [[CALL13]], label [[FOR_INC:%.*]] [
60 ; CHECK-NEXT:    i8 5, label [[SW_BB33:%.*]]
61 ; CHECK-NEXT:    i8 9, label [[SW_BB31_LOOPEXIT:%.*]]
62 ; CHECK-NEXT:    i8 8, label [[SW_BB31_LOOPEXIT]]
63 ; CHECK-NEXT:    i8 11, label [[SW_BB31_LOOPEXIT]]
64 ; CHECK-NEXT:    i8 10, label [[SW_BB31_LOOPEXIT]]
65 ; CHECK-NEXT:    ]
66 ; CHECK:       sw.bb31.loopexit:
67 ; CHECK-NEXT:    br label [[SW_BB31]]
68 ; CHECK:       sw.bb31:
69 ; CHECK-NEXT:    tail call void @_ZN2v84baseL18ReadUnalignedValueINS_8internal6ObjectEEET_j()
70 ; CHECK-NEXT:    unreachable
71 ; CHECK:       sw.bb33:
72 ; CHECK-NEXT:    [[CALL34:%.*]] = tail call ptr @_ZNSt4__CrlsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc()
73 ; CHECK-NEXT:    br label [[FOR_INC]]
74 ; CHECK:       for.inc:
75 ; CHECK-NEXT:    [[CALL6:%.*]] = tail call i32 @_ZNK2v88internal4wasm10StructType11field_countEv()
76 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ugt i32 [[CALL6]], 1
77 ; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY]], label [[FOR_COND_CLEANUP_LOOPEXIT_LOOPEXIT:%.*]], !llvm.loop [[LOOP0:![0-9]+]]
79 entry:
80   %call61 = tail call i32 @_ZNK2v88internal4wasm10StructType11field_countEv()
81   %cmp2.not = icmp eq i32 %call61, 0
82   br i1 %cmp2.not, label %for.cond.cleanup, label %for.body.preheader
84 for.body.preheader:                               ; preds = %entry
85   br label %for.body
87 for.cond.cleanup.loopexit:                        ; preds = %for.inc
88   br label %for.cond.cleanup
90 for.cond.cleanup:                                 ; preds = %for.cond.cleanup.loopexit, %entry
91   ret void
93 for.body:                                         ; preds = %for.body.preheader, %for.inc
94   %cmp.i3 = phi i1 [ false, %for.inc ], [ true, %for.body.preheader ]
95   tail call void @llvm.assume(i1 %cmp.i3)
96   %call13 = tail call i8 @_ZNK2v88internal4wasm9ValueType4kindEv()
97   switch i8 %call13, label %for.inc [
98   i8 5, label %sw.bb33
99   i8 9, label %sw.bb31
100   i8 8, label %sw.bb31
101   i8 11, label %sw.bb31
102   i8 10, label %sw.bb31
103   ]
105 sw.bb31:                                          ; preds = %for.body, %for.body, %for.body, %for.body
106   tail call void @_ZN2v84baseL18ReadUnalignedValueINS_8internal6ObjectEEET_j()
107   unreachable
109 sw.bb33:                                          ; preds = %for.body
110   %call34 = tail call ptr @_ZNSt4__CrlsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc()
111   br label %for.inc
113 for.inc:                                          ; preds = %for.body, %sw.bb33
114   %call6 = tail call i32 @_ZNK2v88internal4wasm10StructType11field_countEv()
115   %cmp = icmp ugt i32 %call6, 1
116   br i1 %cmp, label %for.body, label %for.cond.cleanup.loopexit
119 declare hidden i32 @_ZNK2v88internal4wasm10StructType11field_countEv() local_unnamed_addr align 2
121 define linkonce_odr hidden i32 @_ZNK2v88internal4wasm10StructType12field_offsetEj(ptr %this, i32 %index) local_unnamed_addr comdat align 2 {
122 ; CHECK-LABEL: @_ZNK2v88internal4wasm10StructType12field_offsetEj(
123 ; CHECK-NEXT:  entry:
124 ; CHECK-NEXT:    [[CMP:%.*]] = icmp eq i32 [[INDEX:%.*]], 0
125 ; CHECK-NEXT:    tail call void @llvm.assume(i1 [[CMP]])
126 ; CHECK-NEXT:    ret i32 undef
128 entry:
129   %cmp = icmp eq i32 %index, 0
130   tail call void @llvm.assume(i1 %cmp)
131   ret i32 undef
134 declare hidden i8 @_ZNK2v88internal4wasm9ValueType4kindEv() local_unnamed_addr align 2
136 declare void @_ZN2v84baseL18ReadUnalignedValueINS_8internal6ObjectEEET_j() local_unnamed_addr
138 ; Function Attrs: inaccessiblememonly nofree nosync nounwind willreturn
139 declare void @llvm.assume(i1 noundef) #0
141 attributes #0 = { inaccessiblememonly nofree nosync nounwind willreturn }