44 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v < %s | FileCheck %s3@c = global [12 x i64] zeroinitializer4 5; FIXME: after minbitwidth analysis and i32 conv.., 65535 is transformed to6; and <4 x i16> , -1, which must be dropped.7; FIXME: need to adjust the cost of the final transformation, since the user is8; just a trunc to i16 (it must be free).9define i16 @test() {10; CHECK-LABEL: define i16 @test(11; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {12; CHECK-NEXT: entry:13; CHECK-NEXT: [[TMP0:%.*]] = call <4 x i64> @llvm.experimental.vp.strided.load.v4i64.p0.i64(ptr align 8 @c, i64 24, <4 x i1> splat (i1 true), i32 4)14; CHECK-NEXT: [[TMP1:%.*]] = trunc <4 x i64> [[TMP0]] to <4 x i16>15; CHECK-NEXT: [[TMP3:%.*]] = xor <4 x i16> [[TMP1]], splat (i16 -1)16; CHECK-NEXT: [[TMP4:%.*]] = call i16 @llvm.vector.reduce.umax.v4i16(<4 x i16> [[TMP3]])17; CHECK-NEXT: [[TMP5:%.*]] = zext i16 [[TMP4]] to i3218; CHECK-NEXT: [[T:%.*]] = trunc i32 [[TMP5]] to i1619; CHECK-NEXT: ret i16 [[T]]20;21entry:22 %0 = load i64, ptr @c, align 823 %conv = trunc i64 %0 to i3224 %conv3 = and i32 %conv, 6553525 %conv4 = xor i32 %conv3, 6553526 %1 = load i64, ptr getelementptr inbounds ([12 x i64], ptr @c, i64 0, i64 3), align 827 %conv.1 = trunc i64 %1 to i3228 %conv3.1 = and i32 %conv.1, 6553529 %conv4.1 = xor i32 %conv3.1, 6553530 %.conv4.1 = tail call i32 @llvm.umax.i32(i32 %conv4, i32 %conv4.1)31 %2 = load i64, ptr getelementptr inbounds ([12 x i64], ptr @c, i64 0, i64 6), align 832 %conv.2 = trunc i64 %2 to i3233 %conv3.2 = and i32 %conv.2, 6553534 %conv4.2 = xor i32 %conv3.2, 6553535 %.conv4.2 = tail call i32 @llvm.umax.i32(i32 %.conv4.1, i32 %conv4.2)36 %3 = load i64, ptr getelementptr inbounds ([12 x i64], ptr @c, i64 0, i64 9), align 837 %conv.3 = trunc i64 %3 to i3238 %conv3.3 = and i32 %conv.3, 6553539 %conv4.3 = xor i32 %conv3.3, 6553540 %.conv4.3 = tail call i32 @llvm.umax.i32(i32 %.conv4.2, i32 %conv4.3)41 %t = trunc i32 %.conv4.3 to i1642 ret i16 %t43}44