1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -passes="loop-vectorize" -pass-remarks-output=%t.yaml -S %s | FileCheck %s
3 ; RUN: FileCheck --input-file=%t.yaml --check-prefix=REMARKS %s
5 ; REMARKS: the cost-model indicates that vectorization is not beneficial
7 ; Test for https://github.com/llvm/llvm-project/issues/116375.
8 define void @test_i24_load_for(ptr noalias %src, ptr %dst) {
9 ; CHECK-LABEL: define void @test_i24_load_for(
10 ; CHECK-SAME: ptr noalias [[SRC:%.*]], ptr [[DST:%.*]]) {
11 ; CHECK-NEXT: [[ENTRY:.*]]:
12 ; CHECK-NEXT: br label %[[LOOP:.*]]
14 ; CHECK-NEXT: [[IV:%.*]] = phi i16 [ 0, %[[ENTRY]] ], [ [[IV_NEXT:%.*]], %[[LOOP]] ]
15 ; CHECK-NEXT: [[FOR:%.*]] = phi i24 [ 0, %[[ENTRY]] ], [ [[FOR_NEXT:%.*]], %[[LOOP]] ]
16 ; CHECK-NEXT: [[IV_NEXT]] = add i16 [[IV]], 1
17 ; CHECK-NEXT: [[GEP_SRC:%.*]] = getelementptr inbounds i24, ptr [[SRC]], i16 [[IV]]
18 ; CHECK-NEXT: [[FOR_NEXT]] = load i24, ptr [[GEP_SRC]], align 1
19 ; CHECK-NEXT: [[GEP_DST:%.*]] = getelementptr inbounds i24, ptr [[DST]], i16 [[IV]]
20 ; CHECK-NEXT: store i24 [[FOR]], ptr [[GEP_DST]], align 4
21 ; CHECK-NEXT: [[EC:%.*]] = icmp eq i16 [[IV_NEXT]], 1000
22 ; CHECK-NEXT: br i1 [[EC]], label %[[EXIT:.*]], label %[[LOOP]]
24 ; CHECK-NEXT: ret void
30 %iv = phi i16 [ 0, %entry ], [ %iv.next, %loop ]
31 %for = phi i24 [ 0, %entry ], [ %for.next, %loop ]
32 %iv.next = add i16 %iv, 1
33 %gep.src = getelementptr inbounds i24, ptr %src, i16 %iv
34 %for.next = load i24, ptr %gep.src, align 1
35 %gep.dst = getelementptr inbounds i24, ptr %dst, i16 %iv
36 store i24 %for, ptr %gep.dst
37 %ec = icmp eq i16 %iv.next, 1000
38 br i1 %ec, label %exit, label %loop