1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64 < %s | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
6 define void @signed(ptr %x, ptr %y, i32 %n) {
7 ; CHECK-LABEL: @signed(
9 ; CHECK-NEXT: [[TMP0:%.*]] = load <4 x float>, ptr [[X:%.*]], align 4
10 ; CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.fptosi.sat.v4i32.v4f32(<4 x float> [[TMP0]])
11 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr [[Y:%.*]], align 4
12 ; CHECK-NEXT: ret void
15 %l0 = load float, ptr %x, align 4
16 %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
17 %l2 = load float, ptr %arrayidx.1, align 4
18 %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
19 %l4 = load float, ptr %arrayidx.2, align 4
20 %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
21 %l6 = load float, ptr %arrayidx.3, align 4
22 %l1 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l0)
23 %l3 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l2)
24 %l5 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l4)
25 %l7 = tail call i32 @llvm.fptosi.sat.i32.f32(float %l6)
26 store i32 %l1, ptr %y, align 4
27 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 1
28 store i32 %l3, ptr %arrayidx2.1, align 4
29 %arrayidx2.2 = getelementptr inbounds i32, ptr %y, i64 2
30 store i32 %l5, ptr %arrayidx2.2, align 4
31 %arrayidx2.3 = getelementptr inbounds i32, ptr %y, i64 3
32 store i32 %l7, ptr %arrayidx2.3, align 4
36 define void @unsigned(ptr %x, ptr %y, i32 %n) {
37 ; CHECK-LABEL: @unsigned(
39 ; CHECK-NEXT: [[TMP0:%.*]] = load <4 x float>, ptr [[X:%.*]], align 4
40 ; CHECK-NEXT: [[TMP1:%.*]] = call <4 x i32> @llvm.fptoui.sat.v4i32.v4f32(<4 x float> [[TMP0]])
41 ; CHECK-NEXT: store <4 x i32> [[TMP1]], ptr [[Y:%.*]], align 4
42 ; CHECK-NEXT: ret void
45 %l0 = load float, ptr %x, align 4
46 %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
47 %l2 = load float, ptr %arrayidx.1, align 4
48 %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
49 %l4 = load float, ptr %arrayidx.2, align 4
50 %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
51 %l6 = load float, ptr %arrayidx.3, align 4
52 %l1 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l0)
53 %l3 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l2)
54 %l5 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l4)
55 %l7 = tail call i32 @llvm.fptoui.sat.i32.f32(float %l6)
56 store i32 %l1, ptr %y, align 4
57 %arrayidx2.1 = getelementptr inbounds i32, ptr %y, i64 1
58 store i32 %l3, ptr %arrayidx2.1, align 4
59 %arrayidx2.2 = getelementptr inbounds i32, ptr %y, i64 2
60 store i32 %l5, ptr %arrayidx2.2, align 4
61 %arrayidx2.3 = getelementptr inbounds i32, ptr %y, i64 3
62 store i32 %l7, ptr %arrayidx2.3, align 4
66 declare i32 @llvm.fptosi.sat.i32.f32(float)
67 declare i32 @llvm.fptoui.sat.i32.f32(float)