1
1
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter-out-after "^scalar.ph:" --version 5
2
- ; RUN: opt -passes=loop-vectorize < %s -S -o - | FileCheck %s
2
+ ; RUN: opt -mattr=+mve - passes=loop-vectorize < %s -S -o - | FileCheck %s
3
3
4
- source_filename = "<source>"
5
4
target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
6
5
target triple = "thumbv8.1m.main-unknown-none-eabihf"
7
6
@@ -12,7 +11,7 @@ define void @fn(i32 noundef %n, ptr %in, ptr %out) #0 {
12
11
; CHECK-SAME: i32 noundef [[N:%.*]], ptr [[IN:%.*]], ptr [[OUT:%.*]]) #[[ATTR0:[0-9]+]] {
13
12
; CHECK-NEXT: [[ENTRY:.*:]]
14
13
; CHECK-NEXT: [[CMP46_NOT:%.*]] = icmp eq i32 [[N]], 0
15
- ; CHECK-NEXT: br i1 [[CMP46_NOT]], [[FOR_COND_CLEANUP :label %.*]], label %[[FOR_BODY_PREHEADER:.*]]
14
+ ; CHECK-NEXT: br i1 [[CMP46_NOT]], [[EXIT :label %.*]], label %[[FOR_BODY_PREHEADER:.*]]
16
15
; CHECK: [[FOR_BODY_PREHEADER]]:
17
16
; CHECK-NEXT: br i1 false, label %[[SCALAR_PH:.*]], label %[[VECTOR_MEMCHECK:.*]]
18
17
; CHECK: [[VECTOR_MEMCHECK]]:
@@ -78,31 +77,22 @@ define void @fn(i32 noundef %n, ptr %in, ptr %out) #0 {
78
77
; CHECK-NEXT: [[TMP32:%.*]] = icmp eq i32 [[INDEX_NEXT]], [[N_VEC]]
79
78
; CHECK-NEXT: br i1 [[TMP32]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP5:![0-9]+]]
80
79
; CHECK: [[MIDDLE_BLOCK]]:
81
- ; CHECK-NEXT: br [[FOR_COND_CLEANUP_LOOPEXIT :label %.*]]
80
+ ; CHECK-NEXT: br [[EXIT_LOOPEXIT :label %.*]]
82
81
; CHECK: [[SCALAR_PH]]:
83
82
;
84
83
entry:
85
84
%cmp46.not = icmp eq i32 %n , 0
86
- br i1 %cmp46.not , label %for.cond.cleanup , label %for.body.preheader
87
-
88
- for.body.preheader: ; preds = %entry
89
- br label %for.body
90
-
91
- for.cond.cleanup.loopexit: ; preds = %for.body
92
- br label %for.cond.cleanup
93
-
94
- for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
95
- ret void
85
+ br i1 %cmp46.not , label %exit , label %for.body
96
86
97
87
for.body: ; preds = %for.body.preheader, %for.body
98
- %in.addr.049 = phi ptr [ %incdec.ptr2 , %for.body ], [ %in , %for.body.preheader ]
99
- %out.addr.048 = phi ptr [ %incdec.ptr34 , %for.body ], [ %out , %for.body.preheader ]
100
- %i.047 = phi i32 [ %inc , %for.body ], [ 0 , %for.body.preheader ]
101
- %incdec.ptr = getelementptr inbounds nuw i8 , ptr %in.addr.049 , i32 1
102
- %0 = load i8 , ptr %in.addr.049 , align 1
103
- %incdec.ptr1 = getelementptr inbounds nuw i8 , ptr %in.addr.049 , i32 2
88
+ %ptr.iv.1 = phi ptr [ %in , %entry ], [ %ptr.iv.1.next , %for.body ]
89
+ %ptr.iv.2 = phi ptr [ %out , %entry ], [ %ptr.iv.2.next , %for.body ]
90
+ %iv = phi i32 [ %iv.next , %for.body ], [ 0 , %entry ]
91
+ %incdec.ptr = getelementptr inbounds nuw i8 , ptr %ptr.iv.1 , i32 1
92
+ %0 = load i8 , ptr %ptr.iv.1 , align 1
93
+ %incdec.ptr1 = getelementptr inbounds nuw i8 , ptr %ptr.iv.1 , i32 2
104
94
%1 = load i8 , ptr %incdec.ptr , align 1
105
- %incdec.ptr2 = getelementptr inbounds nuw i8 , ptr %in.addr.049 , i32 3
95
+ %ptr.iv.1.next = getelementptr inbounds nuw i8 , ptr %ptr.iv.1 , i32 3
106
96
%2 = load i8 , ptr %incdec.ptr1 , align 1
107
97
%conv = zext i8 %0 to i32
108
98
%mul = mul nuw nsw i32 %conv , 19595
@@ -131,17 +121,16 @@ for.body: ; preds = %for.body.preheader,
131
121
%add29 = add nuw i32 %add28 , %mul27
132
122
%shr30 = lshr i32 %add29 , 16
133
123
%conv31 = trunc i32 %shr30 to i8
134
- %incdec.ptr32 = getelementptr inbounds nuw i8 , ptr %out.addr.048 , i32 1
135
- store i8 %conv9 , ptr %out.addr.048 , align 1
136
- %incdec.ptr33 = getelementptr inbounds nuw i8 , ptr %out.addr.048 , i32 2
124
+ %incdec.ptr32 = getelementptr inbounds nuw i8 , ptr %ptr.iv.2 , i32 1
125
+ store i8 %conv9 , ptr %ptr.iv.2 , align 1
126
+ %incdec.ptr33 = getelementptr inbounds nuw i8 , ptr %ptr.iv.2 , i32 2
137
127
store i8 %conv20 , ptr %incdec.ptr32 , align 1
138
- %incdec.ptr34 = getelementptr inbounds nuw i8 , ptr %out.addr.048 , i32 3
128
+ %ptr.iv.2.next = getelementptr inbounds nuw i8 , ptr %ptr.iv.2 , i32 3
139
129
store i8 %conv31 , ptr %incdec.ptr33 , align 1
140
- %inc = add nuw i32 %i.047 , 1
141
- %exitcond.not = icmp eq i32 %inc , %n
142
- br i1 %exitcond.not , label %for.cond.cleanup.loopexit , label %for.body , !llvm.loop !7
143
- }
144
-
145
- attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) "target-features" ="+mve" }
130
+ %iv.next = add nuw i32 %iv , 1
131
+ %exitcond.not = icmp eq i32 %iv.next , %n
132
+ br i1 %exitcond.not , label %exit , label %for.body
146
133
147
- !7 = !{!"llvm.loop.mustprogress" }
134
+ exit: ; preds = %for.cond.cleanup.loopexit, %entry
135
+ ret void
136
+ }
0 commit comments