1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -loop-vectorize -force-vector-width=4 -S | FileCheck %s
4 target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
6 ; Reductions of pointer types are not supported.
8 define void @PR49215(i32* %p, i32* %q) {
9 ; CHECK-LABEL: @PR49215(
11 ; CHECK-NEXT: br label [[FOR_BODY:%.*]]
13 ; CHECK-NEXT: [[IV:%.*]] = phi i64 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[FOR_BODY]] ]
14 ; CHECK-NEXT: [[G:%.*]] = phi i32* [ [[P:%.*]], [[ENTRY]] ], [ [[UMIN:%.*]], [[FOR_BODY]] ]
15 ; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32* [[Q:%.*]], [[G]]
16 ; CHECK-NEXT: [[UMIN]] = select i1 [[CMP2]], i32* [[Q]], i32* [[G]]
17 ; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i64 [[IV]], 1
18 ; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[IV_NEXT]], undef
19 ; CHECK-NEXT: br i1 [[EXITCOND]], label [[LOOPEXIT:%.*]], label [[FOR_BODY]]
21 ; CHECK-NEXT: [[UMIN_LCSSA:%.*]] = phi i32* [ [[UMIN]], [[FOR_BODY]] ]
22 ; CHECK-NEXT: [[PHI_CAST:%.*]] = ptrtoint i32* [[UMIN_LCSSA]] to i64
23 ; CHECK-NEXT: ret void
29 %iv = phi i64 [ 0, %entry ], [ %iv.next, %for.body ]
30 %g = phi i32* [ %p, %entry ], [ %umin, %for.body ]
31 %cmp2 = icmp ult i32* %q, %g
32 %umin = select i1 %cmp2, i32* %q, i32* %g
33 %iv.next = add nuw nsw i64 %iv, 1
34 %exitcond = icmp eq i64 %iv.next, undef
35 br i1 %exitcond, label %loopexit, label %for.body
38 %phi.cast = ptrtoint i32* %umin to i64