1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S --passes=slp-vectorizer -mtriple=riscv64-unknown-linux-gnu -mattr=+v < %s | FileCheck %s
define i16 @test(ptr %i) {
; CHECK-LABEL: define i16 @test(
; CHECK-SAME: ptr [[I:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x ptr> poison, ptr [[I]], i32 0
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x ptr> [[TMP0]], <2 x ptr> poison, <2 x i32> zeroinitializer
; CHECK-NEXT: [[TMP2:%.*]] = getelementptr i8, <2 x ptr> [[TMP1]], <2 x i64> <i64 132860, i64 137774>
; CHECK-NEXT: [[TMP3:%.*]] = shufflevector <2 x ptr> [[TMP2]], <2 x ptr> poison, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
; CHECK-NEXT: [[GEP_US154_2:%.*]] = getelementptr i8, ptr [[I]], i64 142688
; CHECK-NEXT: br label %[[FOR_COND5_US:.*]]
; CHECK: [[FOR_COND5_US]]:
; CHECK-NEXT: [[TMP4:%.*]] = call <4 x i16> @llvm.experimental.vp.strided.load.v4i16.p0.i64(ptr align 2 [[GEP_US154_2]], i64 4914, <4 x i1> splat (i1 true), i32 4)
; CHECK-NEXT: [[TMP5:%.*]] = call <4 x i16> @llvm.masked.gather.v4i16.v4p0(<4 x ptr> [[TMP3]], i32 2, <4 x i1> splat (i1 true), <4 x i16> poison)
; CHECK-NEXT: [[TMP6:%.*]] = shufflevector <4 x i16> [[TMP4]], <4 x i16> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <4 x i16> [[TMP5]], <4 x i16> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison>
; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x i16> [[TMP4]], <4 x i16> [[TMP5]], <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
; CHECK-NEXT: [[TMP8:%.*]] = call i16 @llvm.vector.reduce.umax.v8i16(<8 x i16> [[TMP7]])
; CHECK-NEXT: [[TMP9:%.*]] = call i16 @llvm.umax.i16(i16 [[TMP8]], i16 0)
; CHECK-NEXT: ret i16 [[TMP9]]
;
entry:
%gep.us154 = getelementptr i8, ptr %i, i64 132860
%gep.us154.1 = getelementptr i8, ptr %i, i64 137774
%gep.us154.2 = getelementptr i8, ptr %i, i64 142688
%gep.us154.3 = getelementptr i8, ptr %i, i64 147602
%gep.us154.4 = getelementptr i8, ptr %i, i64 152516
%gep.us154.5 = getelementptr i8, ptr %i, i64 157430
br label %for.cond5.us
for.cond5.us:
%0 = load i16, ptr %gep.us154, align 2
%1 = load i16, ptr %gep.us154.1, align 2
%2 = load i16, ptr %gep.us154.2, align 2
%3 = load i16, ptr %gep.us154.3, align 2
%4 = load i16, ptr %gep.us154.4, align 2
%5 = load i16, ptr %gep.us154.5, align 2
%6 = call i16 @llvm.umax.i16(i16 %5, i16 0)
%7 = call i16 @llvm.umax.i16(i16 %0, i16 %6)
%8 = call i16 @llvm.umax.i16(i16 %1, i16 %7)
%9 = call i16 @llvm.umax.i16(i16 %2, i16 %8)
%10 = call i16 @llvm.umax.i16(i16 %3, i16 %9)
%11 = call i16 @llvm.umax.i16(i16 %2, i16 %10)
%12 = call i16 @llvm.umax.i16(i16 %3, i16 %11)
%13 = call i16 @llvm.umax.i16(i16 %4, i16 %12)
%14 = load i16, ptr %gep.us154, align 2
%15 = call i16 @llvm.umax.i16(i16 %14, i16 %13)
%16 = load i16, ptr %gep.us154.1, align 2
%17 = call i16 @llvm.umax.i16(i16 %16, i16 %15)
%18 = call i16 @llvm.umax.i16(i16 %4, i16 %17)
ret i16 %18
}
declare i16 @llvm.umax.i16(i16, i16) #1
|