72 lines · plain
1; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s2 3; TODO: This test currently fails with LLVM_ENABLE_EXPENSIVE_CHECKS enabled4; XFAIL: expensive_checks5 6; CHECK-DAG: OpName [[SHFv4:%.+]] "shuffle_v4"7; CHECK-DAG: OpName [[INSv4:%.+]] "insert_v4"8; CHECK-DAG: OpName [[EXTv4:%.+]] "extract_v4"9; CHECK-DAG: OpName [[INSv4C:%.+]] "insert_v4C"10; CHECK-DAG: OpName [[EXTv4C:%.+]] "extract_v4C"11 12 13; CHECK: [[SHFv4]] = OpFunction14; CHECK-NEXT: [[A:%.+]] = OpFunctionParameter15; CHECK-NEXT: [[B:%.+]] = OpFunctionParameter16; CHECK: OpLabel17; CHECK: [[R:%.+]] = OpVectorShuffle {{%.+}} [[A]] [[B]] 0 4 3 618; CHECK: OpReturnValue [[R]]19; CHECK-NEXT: OpFunctionEnd20define <4 x float> @shuffle_v4(<8 x float> %A, <8 x float> %B) {21 %r = shufflevector <8 x float> %A, <8 x float> %B, <4 x i32> <i32 0, i32 4, i32 3, i32 6>22 ret <4 x float> %r23}24 25; CHECK: [[INSv4]] = OpFunction26; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter27; CHECK-NEXT: [[E:%.+]] = OpFunctionParameter28; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter29; CHECK: OpLabel30; CHECK: [[R:%.+]] = OpVectorInsertDynamic {{%.+}} [[V]] [[E]] [[C]]31; CHECK: OpReturnValue [[R]]32; CHECK-NEXT: OpFunctionEnd33define <4 x float> @insert_v4(<4 x float> %V, float %E, i32 %C) {34 %r = insertelement <4 x float> %V, float %E, i32 %C35 ret <4 x float> %r36}37 38; CHECK: [[EXTv4]] = OpFunction39; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter40; CHECK-NEXT: [[C:%.+]] = OpFunctionParameter41; CHECK: OpLabel42; CHECK: [[R:%.+]] = OpVectorExtractDynamic {{%.+}} [[V]] [[C]]43; CHECK: OpReturnValue [[R]]44; CHECK-NEXT: OpFunctionEnd45define float @extract_v4(<4 x float> %V, i32 %C) {46 %r = extractelement <4 x float> %V, i32 %C47 ret float %r48}49 50; CHECK: [[INSv4C]] = OpFunction51; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter52; CHECK-NEXT: [[E:%.+]] = OpFunctionParameter53; CHECK: OpLabel54; CHECK: [[R:%.+]] = OpCompositeInsert {{%.+}} [[E]] [[V]] 355; CHECK: OpReturnValue [[R]]56; CHECK-NEXT: OpFunctionEnd57define <4 x float> @insert_v4C(<4 x float> %V, float %E) {58 %r = insertelement <4 x float> %V, float %E, i32 359 ret <4 x float> %r60}61 62; CHECK: [[EXTv4C]] = OpFunction63; CHECK-NEXT: [[V:%.+]] = OpFunctionParameter64; CHECK: OpLabel65; CHECK: [[R:%.+]] = OpCompositeExtract {{%.+}} [[V]] 266; CHECK: OpReturnValue [[R]]67; CHECK-NEXT: OpFunctionEnd68define float @extract_v4C(<4 x float> %V) {69 %r = extractelement <4 x float> %V, i32 270 ret float %r71}72