llvm.org GIT mirror llvm / 81b9a7e
[LICM] auto-generate complete test checks; NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359881 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 4 months ago
1 changed file(s) with 27 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
132132 ; pointers; should handle integers too
133133 define i32 @test4(i32* noalias nocapture readonly %a) nounwind uwtable {
134134 ; CHECK-LABEL: @test4(
135 ; CHECK-NEXT: entry:
136 ; CHECK-NEXT: [[LEN:%.*]] = load i32, i32* [[A:%.*]], align 4, !range !0
137 ; CHECK-NEXT: [[IS_ZERO:%.*]] = icmp eq i32 [[LEN]], 0
138 ; CHECK-NEXT: br i1 [[IS_ZERO]], label [[FAIL:%.*]], label [[PREHEADER:%.*]]
139 ; CHECK: preheader:
140 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
141 ; CHECK: for.body:
142 ; CHECK-NEXT: [[IV:%.*]] = phi i32 [ 0, [[PREHEADER]] ], [ [[INC:%.*]], [[CONTINUE:%.*]] ]
143 ; CHECK-NEXT: [[ACC:%.*]] = phi i32 [ 0, [[PREHEADER]] ], [ [[ADD:%.*]], [[CONTINUE]] ]
144 ; CHECK-NEXT: [[R_CHK:%.*]] = icmp ult i32 [[IV]], [[LEN]]
145 ; CHECK-NEXT: br i1 [[R_CHK]], label [[CONTINUE]], label [[FAIL_LOOPEXIT:%.*]]
146 ; CHECK: continue:
147 ; CHECK-NEXT: [[I1:%.*]] = load i32, i32* [[A]], align 4
148 ; CHECK-NEXT: [[ADD]] = add nsw i32 [[I1]], [[ACC]]
149 ; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[IV]], 1
150 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INC]], 1000
151 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[FOR_COND_CLEANUP:%.*]], label [[FOR_BODY]]
152 ; CHECK: for.cond.cleanup:
153 ; CHECK-NEXT: [[ADD_LCSSA:%.*]] = phi i32 [ [[ADD]], [[CONTINUE]] ]
154 ; CHECK-NEXT: ret i32 [[ADD_LCSSA]]
155 ; CHECK: fail.loopexit:
156 ; CHECK-NEXT: br label [[FAIL]]
157 ; CHECK: fail:
158 ; CHECK-NEXT: call void @f()
159 ; CHECK-NEXT: ret i32 -1
160 ;
135161 entry:
136162 %len = load i32, i32* %a, align 4, !range !{i32 0, i32 512}
137163 %is.zero = icmp eq i32 %len, 0
144170 %r.chk = icmp ult i32 %iv, %len
145171 br i1 %r.chk, label %continue, label %fail
146172 continue:
147 ; CHECK-LABEL: continue
148 ; CHECK: %i1 = load i32, i32* %a, align 4
149173 %i1 = load i32, i32* %a, align 4
150174 %add = add nsw i32 %i1, %acc
151175 %inc = add nuw nsw i32 %iv, 1
220244 ; CHECK-LABEL: @test-wrongphi(
221245 entry:
222246 br label %for.body
223
247
224248 for.body:
225249 %iv = phi i32 [ 0, %entry ], [ %inc, %continue ]
226250 %acc = phi i32 [ 0, %entry ], [ %add, %continue ]