45 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --filter-out-after "^scalar.ph" --version 52; RUN: opt -passes=loop-vectorize -mtriple=aarch64 -mattr=+sve -S %s | FileCheck %s3 4define void @cost_hoisted_vector_code(ptr %p, float %arg) {5; CHECK-LABEL: define void @cost_hoisted_vector_code(6; CHECK-SAME: ptr [[P:%.*]], float [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {7; CHECK-NEXT: [[ENTRY:.*:]]8; CHECK-NEXT: br label %[[VECTOR_PH:.*]]9; CHECK: [[VECTOR_PH]]:10; CHECK-NEXT: [[BROADCAST_SPLATINSERT:%.*]] = insertelement <4 x float> poison, float [[ARG]], i64 011; CHECK-NEXT: [[BROADCAST_SPLAT:%.*]] = shufflevector <4 x float> [[BROADCAST_SPLATINSERT]], <4 x float> poison, <4 x i32> zeroinitializer12; CHECK-NEXT: [[TMP0:%.*]] = call <4 x float> @llvm.minimumnum.v4f32(<4 x float> [[BROADCAST_SPLAT]], <4 x float> zeroinitializer)13; CHECK-NEXT: br label %[[VECTOR_BODY:.*]]14; CHECK: [[VECTOR_BODY]]:15; CHECK-NEXT: [[INDEX:%.*]] = phi i64 [ 0, %[[VECTOR_PH]] ], [ [[INDEX_NEXT:%.*]], %[[VECTOR_BODY]] ]16; CHECK-NEXT: [[OFFSET_IDX:%.*]] = add i64 1, [[INDEX]]17; CHECK-NEXT: [[TMP1:%.*]] = getelementptr float, ptr [[P]], i64 [[OFFSET_IDX]]18; CHECK-NEXT: [[TMP2:%.*]] = getelementptr float, ptr [[TMP1]], i64 419; CHECK-NEXT: store <4 x float> [[TMP0]], ptr [[TMP1]], align 420; CHECK-NEXT: store <4 x float> [[TMP0]], ptr [[TMP2]], align 421; CHECK-NEXT: [[INDEX_NEXT]] = add nuw i64 [[INDEX]], 822; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i64 [[INDEX_NEXT]], -823; CHECK-NEXT: br i1 [[TMP3]], label %[[MIDDLE_BLOCK:.*]], label %[[VECTOR_BODY]], !llvm.loop [[LOOP0:![0-9]+]]24; CHECK: [[MIDDLE_BLOCK]]:25; CHECK-NEXT: br label %[[SCALAR_PH:.*]]26; CHECK: [[SCALAR_PH]]:27;28entry:29 br label %loop30 31loop: ; preds = %loop, %entry32 %iv = phi i64 [ 1, %entry ], [ %iv.next, %loop ]33 %res = tail call float @llvm.minimumnum.f32(float %arg, float 0.0)34 %gep.p.red = getelementptr float, ptr %p, i64 %iv35 store float %res, ptr %gep.p.red, align 436 %iv.next = add i64 %iv, 137 %exit.cond = icmp eq i64 %iv.next, 038 br i1 %exit.cond, label %exit, label %loop39 40exit: ; preds = %loop41 ret void42}43 44declare float @llvm.minimumnum.f32(float, float)45