Skip to content

Commit ced105f

Browse files
authored
Update tests for vector splat insertelement LLVM change (#1807)
Update FileCheck patterns for llvm-project commit eae26b6640af ("[IRBuilder] Use canonical i64 type for insertelement index used by vector splats.", 2023-01-11).
1 parent 22fe285 commit ced105f

5 files changed

+26
-26
lines changed

test/matrix_times_matrix.spt

+16-16
Original file line numberDiff line numberDiff line change
@@ -42,103 +42,103 @@
4242
; CHECK-LLVM: %2 = load [4 x <4 x float>], ptr %rhs
4343
; CHECK-LLVM: %3 = extractvalue [4 x <4 x float>] %2, 0
4444
; CHECK-LLVM: %4 = extractelement <4 x float> %3, i32 0
45-
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %4, i32 0
45+
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %4, i64 0
4646
; CHECK-LLVM: %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
4747
; CHECK-LLVM: %5 = extractvalue [4 x <4 x float>] %1, 0
4848
; CHECK-LLVM: %6 = fmul <4 x float> %.splat, %5
4949
; CHECK-LLVM: %7 = fadd <4 x float> zeroinitializer, %6
5050
; CHECK-LLVM: %8 = extractelement <4 x float> %3, i32 1
51-
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %8, i32 0
51+
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %8, i64 0
5252
; CHECK-LLVM: %.splat2 = shufflevector <4 x float> %.splatinsert1, <4 x float> poison, <4 x i32> zeroinitializer
5353
; CHECK-LLVM: %9 = extractvalue [4 x <4 x float>] %1, 1
5454
; CHECK-LLVM: %10 = fmul <4 x float> %.splat2, %9
5555
; CHECK-LLVM: %11 = fadd <4 x float> %7, %10
5656
; CHECK-LLVM: %12 = extractelement <4 x float> %3, i32 2
57-
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %12, i32 0
57+
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %12, i64 0
5858
; CHECK-LLVM: %.splat4 = shufflevector <4 x float> %.splatinsert3, <4 x float> poison, <4 x i32> zeroinitializer
5959
; CHECK-LLVM: %13 = extractvalue [4 x <4 x float>] %1, 2
6060
; CHECK-LLVM: %14 = fmul <4 x float> %.splat4, %13
6161
; CHECK-LLVM: %15 = fadd <4 x float> %11, %14
6262
; CHECK-LLVM: %16 = extractelement <4 x float> %3, i32 3
63-
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %16, i32 0
63+
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %16, i64 0
6464
; CHECK-LLVM: %.splat6 = shufflevector <4 x float> %.splatinsert5, <4 x float> poison, <4 x i32> zeroinitializer
6565
; CHECK-LLVM: %17 = extractvalue [4 x <4 x float>] %1, 3
6666
; CHECK-LLVM: %18 = fmul <4 x float> %.splat6, %17
6767
; CHECK-LLVM: %19 = fadd <4 x float> %15, %18
6868
; CHECK-LLVM: %20 = insertvalue [4 x <4 x float>] undef, <4 x float> %19, 0
6969
; CHECK-LLVM: %21 = extractvalue [4 x <4 x float>] %2, 1
7070
; CHECK-LLVM: %22 = extractelement <4 x float> %21, i32 0
71-
; CHECK-LLVM: %.splatinsert7 = insertelement <4 x float> poison, float %22, i32 0
71+
; CHECK-LLVM: %.splatinsert7 = insertelement <4 x float> poison, float %22, i64 0
7272
; CHECK-LLVM: %.splat8 = shufflevector <4 x float> %.splatinsert7, <4 x float> poison, <4 x i32> zeroinitializer
7373
; CHECK-LLVM: %23 = extractvalue [4 x <4 x float>] %1, 0
7474
; CHECK-LLVM: %24 = fmul <4 x float> %.splat8, %23
7575
; CHECK-LLVM: %25 = fadd <4 x float> zeroinitializer, %24
7676
; CHECK-LLVM: %26 = extractelement <4 x float> %21, i32 1
77-
; CHECK-LLVM: %.splatinsert9 = insertelement <4 x float> poison, float %26, i32 0
77+
; CHECK-LLVM: %.splatinsert9 = insertelement <4 x float> poison, float %26, i64 0
7878
; CHECK-LLVM: %.splat10 = shufflevector <4 x float> %.splatinsert9, <4 x float> poison, <4 x i32> zeroinitializer
7979
; CHECK-LLVM: %27 = extractvalue [4 x <4 x float>] %1, 1
8080
; CHECK-LLVM: %28 = fmul <4 x float> %.splat10, %27
8181
; CHECK-LLVM: %29 = fadd <4 x float> %25, %28
8282
; CHECK-LLVM: %30 = extractelement <4 x float> %21, i32 2
83-
; CHECK-LLVM: %.splatinsert11 = insertelement <4 x float> poison, float %30, i32 0
83+
; CHECK-LLVM: %.splatinsert11 = insertelement <4 x float> poison, float %30, i64 0
8484
; CHECK-LLVM: %.splat12 = shufflevector <4 x float> %.splatinsert11, <4 x float> poison, <4 x i32> zeroinitializer
8585
; CHECK-LLVM: %31 = extractvalue [4 x <4 x float>] %1, 2
8686
; CHECK-LLVM: %32 = fmul <4 x float> %.splat12, %31
8787
; CHECK-LLVM: %33 = fadd <4 x float> %29, %32
8888
; CHECK-LLVM: %34 = extractelement <4 x float> %21, i32 3
89-
; CHECK-LLVM: %.splatinsert13 = insertelement <4 x float> poison, float %34, i32 0
89+
; CHECK-LLVM: %.splatinsert13 = insertelement <4 x float> poison, float %34, i64 0
9090
; CHECK-LLVM: %.splat14 = shufflevector <4 x float> %.splatinsert13, <4 x float> poison, <4 x i32> zeroinitializer
9191
; CHECK-LLVM: %35 = extractvalue [4 x <4 x float>] %1, 3
9292
; CHECK-LLVM: %36 = fmul <4 x float> %.splat14, %35
9393
; CHECK-LLVM: %37 = fadd <4 x float> %33, %36
9494
; CHECK-LLVM: %38 = insertvalue [4 x <4 x float>] %20, <4 x float> %37, 1
9595
; CHECK-LLVM: %39 = extractvalue [4 x <4 x float>] %2, 2
9696
; CHECK-LLVM: %40 = extractelement <4 x float> %39, i32 0
97-
; CHECK-LLVM: %.splatinsert15 = insertelement <4 x float> poison, float %40, i32 0
97+
; CHECK-LLVM: %.splatinsert15 = insertelement <4 x float> poison, float %40, i64 0
9898
; CHECK-LLVM: %.splat16 = shufflevector <4 x float> %.splatinsert15, <4 x float> poison, <4 x i32> zeroinitializer
9999
; CHECK-LLVM: %41 = extractvalue [4 x <4 x float>] %1, 0
100100
; CHECK-LLVM: %42 = fmul <4 x float> %.splat16, %41
101101
; CHECK-LLVM: %43 = fadd <4 x float> zeroinitializer, %42
102102
; CHECK-LLVM: %44 = extractelement <4 x float> %39, i32 1
103-
; CHECK-LLVM: %.splatinsert17 = insertelement <4 x float> poison, float %44, i32 0
103+
; CHECK-LLVM: %.splatinsert17 = insertelement <4 x float> poison, float %44, i64 0
104104
; CHECK-LLVM: %.splat18 = shufflevector <4 x float> %.splatinsert17, <4 x float> poison, <4 x i32> zeroinitializer
105105
; CHECK-LLVM: %45 = extractvalue [4 x <4 x float>] %1, 1
106106
; CHECK-LLVM: %46 = fmul <4 x float> %.splat18, %45
107107
; CHECK-LLVM: %47 = fadd <4 x float> %43, %46
108108
; CHECK-LLVM: %48 = extractelement <4 x float> %39, i32 2
109-
; CHECK-LLVM: %.splatinsert19 = insertelement <4 x float> poison, float %48, i32 0
109+
; CHECK-LLVM: %.splatinsert19 = insertelement <4 x float> poison, float %48, i64 0
110110
; CHECK-LLVM: %.splat20 = shufflevector <4 x float> %.splatinsert19, <4 x float> poison, <4 x i32> zeroinitializer
111111
; CHECK-LLVM: %49 = extractvalue [4 x <4 x float>] %1, 2
112112
; CHECK-LLVM: %50 = fmul <4 x float> %.splat20, %49
113113
; CHECK-LLVM: %51 = fadd <4 x float> %47, %50
114114
; CHECK-LLVM: %52 = extractelement <4 x float> %39, i32 3
115-
; CHECK-LLVM: %.splatinsert21 = insertelement <4 x float> poison, float %52, i32 0
115+
; CHECK-LLVM: %.splatinsert21 = insertelement <4 x float> poison, float %52, i64 0
116116
; CHECK-LLVM: %.splat22 = shufflevector <4 x float> %.splatinsert21, <4 x float> poison, <4 x i32> zeroinitializer
117117
; CHECK-LLVM: %53 = extractvalue [4 x <4 x float>] %1, 3
118118
; CHECK-LLVM: %54 = fmul <4 x float> %.splat22, %53
119119
; CHECK-LLVM: %55 = fadd <4 x float> %51, %54
120120
; CHECK-LLVM: %56 = insertvalue [4 x <4 x float>] %38, <4 x float> %55, 2
121121
; CHECK-LLVM: %57 = extractvalue [4 x <4 x float>] %2, 3
122122
; CHECK-LLVM: %58 = extractelement <4 x float> %57, i32 0
123-
; CHECK-LLVM: %.splatinsert23 = insertelement <4 x float> poison, float %58, i32 0
123+
; CHECK-LLVM: %.splatinsert23 = insertelement <4 x float> poison, float %58, i64 0
124124
; CHECK-LLVM: %.splat24 = shufflevector <4 x float> %.splatinsert23, <4 x float> poison, <4 x i32> zeroinitializer
125125
; CHECK-LLVM: %59 = extractvalue [4 x <4 x float>] %1, 0
126126
; CHECK-LLVM: %60 = fmul <4 x float> %.splat24, %59
127127
; CHECK-LLVM: %61 = fadd <4 x float> zeroinitializer, %60
128128
; CHECK-LLVM: %62 = extractelement <4 x float> %57, i32 1
129-
; CHECK-LLVM: %.splatinsert25 = insertelement <4 x float> poison, float %62, i32 0
129+
; CHECK-LLVM: %.splatinsert25 = insertelement <4 x float> poison, float %62, i64 0
130130
; CHECK-LLVM: %.splat26 = shufflevector <4 x float> %.splatinsert25, <4 x float> poison, <4 x i32> zeroinitializer
131131
; CHECK-LLVM: %63 = extractvalue [4 x <4 x float>] %1, 1
132132
; CHECK-LLVM: %64 = fmul <4 x float> %.splat26, %63
133133
; CHECK-LLVM: %65 = fadd <4 x float> %61, %64
134134
; CHECK-LLVM: %66 = extractelement <4 x float> %57, i32 2
135-
; CHECK-LLVM: %.splatinsert27 = insertelement <4 x float> poison, float %66, i32 0
135+
; CHECK-LLVM: %.splatinsert27 = insertelement <4 x float> poison, float %66, i64 0
136136
; CHECK-LLVM: %.splat28 = shufflevector <4 x float> %.splatinsert27, <4 x float> poison, <4 x i32> zeroinitializer
137137
; CHECK-LLVM: %67 = extractvalue [4 x <4 x float>] %1, 2
138138
; CHECK-LLVM: %68 = fmul <4 x float> %.splat28, %67
139139
; CHECK-LLVM: %69 = fadd <4 x float> %65, %68
140140
; CHECK-LLVM: %70 = extractelement <4 x float> %57, i32 3
141-
; CHECK-LLVM: %.splatinsert29 = insertelement <4 x float> poison, float %70, i32 0
141+
; CHECK-LLVM: %.splatinsert29 = insertelement <4 x float> poison, float %70, i64 0
142142
; CHECK-LLVM: %.splat30 = shufflevector <4 x float> %.splatinsert29, <4 x float> poison, <4 x i32> zeroinitializer
143143
; CHECK-LLVM: %71 = extractvalue [4 x <4 x float>] %1, 3
144144
; CHECK-LLVM: %72 = fmul <4 x float> %.splat30, %71

test/matrix_times_scalar.spt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
; CHECK-LLVM: %1 = load [4 x <4 x float>], ptr %lhs
77
; CHECK-LLVM: %2 = load float, ptr %rhs
8-
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %2, i32 0
8+
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %2, i64 0
99
; CHECK-LLVM: %3 = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
1010
; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %1, 0
1111
; CHECK-LLVM: %5 = fmul <4 x float> %4, %3

test/matrix_times_vector.spt

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,25 @@
4141
; CHECK-LLVM: %1 = load [4 x <4 x float>], ptr %lhs
4242
; CHECK-LLVM: %2 = load <4 x float>, ptr %rhs
4343
; CHECK-LLVM: %3 = extractelement <4 x float> %2, i32 0
44-
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i32 0
44+
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i64 0
4545
; CHECK-LLVM: %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
4646
; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %1, 0
4747
; CHECK-LLVM: %5 = fmul <4 x float> %.splat, %4
4848
; CHECK-LLVM: %6 = fadd <4 x float> zeroinitializer, %5
4949
; CHECK-LLVM: %7 = extractelement <4 x float> %2, i32 1
50-
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %7, i32 0
50+
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %7, i64 0
5151
; CHECK-LLVM: %.splat2 = shufflevector <4 x float> %.splatinsert1, <4 x float> poison, <4 x i32> zeroinitializer
5252
; CHECK-LLVM: %8 = extractvalue [4 x <4 x float>] %1, 1
5353
; CHECK-LLVM: %9 = fmul <4 x float> %.splat2, %8
5454
; CHECK-LLVM: %10 = fadd <4 x float> %6, %9
5555
; CHECK-LLVM: %11 = extractelement <4 x float> %2, i32 2
56-
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %11, i32 0
56+
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %11, i64 0
5757
; CHECK-LLVM: %.splat4 = shufflevector <4 x float> %.splatinsert3, <4 x float> poison, <4 x i32> zeroinitializer
5858
; CHECK-LLVM: %12 = extractvalue [4 x <4 x float>] %1, 2
5959
; CHECK-LLVM: %13 = fmul <4 x float> %.splat4, %12
6060
; CHECK-LLVM: %14 = fadd <4 x float> %10, %13
6161
; CHECK-LLVM: %15 = extractelement <4 x float> %2, i32 3
62-
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %15, i32 0
62+
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %15, i64 0
6363
; CHECK-LLVM: %.splat6 = shufflevector <4 x float> %.splatinsert5, <4 x float> poison, <4 x i32> zeroinitializer
6464
; CHECK-LLVM: %16 = extractvalue [4 x <4 x float>] %1, 3
6565
; CHECK-LLVM: %17 = fmul <4 x float> %.splat6, %16

test/vector_times_matrix.spt

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
; CHECK-LLVM: %1 = load <4 x float>, ptr %lhs
4242
; CHECK-LLVM: %2 = load [4 x <4 x float>], ptr %rhs
4343
; CHECK-LLVM: %3 = extractelement <4 x float> %1, i32 0
44-
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i32 0
44+
; CHECK-LLVM: %.splatinsert = insertelement <4 x float> poison, float %3, i64 0
4545
; CHECK-LLVM: %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
4646
; CHECK-LLVM: %4 = extractvalue [4 x <4 x float>] %2, 0
4747
; CHECK-LLVM: %5 = extractelement <4 x float> %4, i32 0
@@ -58,7 +58,7 @@
5858
; CHECK-LLVM: %16 = fmul <4 x float> %.splat, %15
5959
; CHECK-LLVM: %17 = fadd <4 x float> zeroinitializer, %16
6060
; CHECK-LLVM: %18 = extractelement <4 x float> %1, i32 1
61-
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %18, i32 0
61+
; CHECK-LLVM: %.splatinsert1 = insertelement <4 x float> poison, float %18, i64 0
6262
; CHECK-LLVM: %.splat2 = shufflevector <4 x float> %.splatinsert1, <4 x float> poison, <4 x i32> zeroinitializer
6363
; CHECK-LLVM: %19 = extractvalue [4 x <4 x float>] %2, 0
6464
; CHECK-LLVM: %20 = extractelement <4 x float> %19, i32 1
@@ -75,7 +75,7 @@
7575
; CHECK-LLVM: %31 = fmul <4 x float> %.splat2, %30
7676
; CHECK-LLVM: %32 = fadd <4 x float> %17, %31
7777
; CHECK-LLVM: %33 = extractelement <4 x float> %1, i32 2
78-
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %33, i32 0
78+
; CHECK-LLVM: %.splatinsert3 = insertelement <4 x float> poison, float %33, i64 0
7979
; CHECK-LLVM: %.splat4 = shufflevector <4 x float> %.splatinsert3, <4 x float> poison, <4 x i32> zeroinitializer
8080
; CHECK-LLVM: %34 = extractvalue [4 x <4 x float>] %2, 0
8181
; CHECK-LLVM: %35 = extractelement <4 x float> %34, i32 2
@@ -92,7 +92,7 @@
9292
; CHECK-LLVM: %46 = fmul <4 x float> %.splat4, %45
9393
; CHECK-LLVM: %47 = fadd <4 x float> %32, %46
9494
; CHECK-LLVM: %48 = extractelement <4 x float> %1, i32 3
95-
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %48, i32 0
95+
; CHECK-LLVM: %.splatinsert5 = insertelement <4 x float> poison, float %48, i64 0
9696
; CHECK-LLVM: %.splat6 = shufflevector <4 x float> %.splatinsert5, <4 x float> poison, <4 x i32> zeroinitializer
9797
; CHECK-LLVM: %49 = extractvalue [4 x <4 x float>] %2, 0
9898
; CHECK-LLVM: %50 = extractelement <4 x float> %49, i32 3

test/vector_times_scalar.spt

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o %t.bc
5555
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM
5656

57-
; CHECK-LLVM: %.splatinsert = insertelement <4 x double> poison, double %{{[0-9]*}}, i32 0
57+
; CHECK-LLVM: %.splatinsert = insertelement <4 x double> poison, double %{{[0-9]*}}, i64 0
5858
; CHECK-LLVM: %[[shufflevector:[0-9]+]] = shufflevector <4 x double> %.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer
5959
; CHECK-LLVM: %scale = fmul <4 x double> %{{[0-9]*}}, %[[shufflevector]]
6060

0 commit comments

Comments
 (0)