109 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 52; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL %s3; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=ALL-SIZE %s4; END.5 6define ptr @ptrmask_p0_i64(ptr %ptr, i64 %mask) {7; ALL-LABEL: 'ptrmask_p0_i64'8; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 %mask)9; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret ptr %result10;11; ALL-SIZE-LABEL: 'ptrmask_p0_i64'12; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 %mask)13; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret ptr %result14;15 %result = call ptr @llvm.ptrmask.p0.i64(ptr %ptr, i64 %mask)16 ret ptr %result17}18 19define <2 x ptr> @ptrmask_v2p0_v2i64(<2 x ptr> %ptr, <2 x i64> %mask) {20; ALL-LABEL: 'ptrmask_v2p0_v2i64'21; ALL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %result = call <2 x ptr> @llvm.ptrmask.v2p0.v2i64(<2 x ptr> %ptr, <2 x i64> %mask)22; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret <2 x ptr> %result23;24; ALL-SIZE-LABEL: 'ptrmask_v2p0_v2i64'25; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %result = call <2 x ptr> @llvm.ptrmask.v2p0.v2i64(<2 x ptr> %ptr, <2 x i64> %mask)26; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x ptr> %result27;28 %result = call <2 x ptr> @llvm.ptrmask.v2p0.v2i64(<2 x ptr> %ptr, <2 x i64> %mask)29 ret <2 x ptr> %result30}31 32define ptr addrspace(1) @ptrmask_p1_i64(ptr addrspace(1) %ptr, i64 %mask) {33; ALL-LABEL: 'ptrmask_p1_i64'34; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1) %ptr, i64 %mask)35; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(1) %result36;37; ALL-SIZE-LABEL: 'ptrmask_p1_i64'38; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1) %ptr, i64 %mask)39; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(1) %result40;41 %result = call ptr addrspace(1) @llvm.ptrmask.p1.i64(ptr addrspace(1) %ptr, i64 %mask)42 ret ptr addrspace(1) %result43}44 45define ptr addrspace(5) @ptrmask_p5_i32(ptr addrspace(5) %ptr, i32 %mask) {46; ALL-LABEL: 'ptrmask_p5_i32'47; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(5) @llvm.ptrmask.p5.i32(ptr addrspace(5) %ptr, i32 %mask)48; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(5) %result49;50; ALL-SIZE-LABEL: 'ptrmask_p5_i32'51; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(5) @llvm.ptrmask.p5.i32(ptr addrspace(5) %ptr, i32 %mask)52; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(5) %result53;54 %result = call ptr addrspace(5) @llvm.ptrmask.p5.i32(ptr addrspace(5) %ptr, i32 %mask)55 ret ptr addrspace(5) %result56}57 58define ptr addrspace(3) @ptrmask_p3_i32(ptr addrspace(3) %ptr, i32 %mask) {59; ALL-LABEL: 'ptrmask_p3_i32'60; ALL-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)61; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(3) %result62;63; ALL-SIZE-LABEL: 'ptrmask_p3_i32'64; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %result = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)65; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(3) %result66;67 %result = call ptr addrspace(3) @llvm.ptrmask.p3.i32(ptr addrspace(3) %ptr, i32 %mask)68 ret ptr addrspace(3) %result69}70 71define <2 x ptr addrspace(5)> @ptrmask_v2p5_v2i32(<2 x ptr addrspace(5)> %ptr, <2 x i32> %mask) {72; ALL-LABEL: 'ptrmask_v2p5_v2i32'73; ALL-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %result = call <2 x ptr addrspace(5)> @llvm.ptrmask.v2p5.v2i32(<2 x ptr addrspace(5)> %ptr, <2 x i32> %mask)74; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret <2 x ptr addrspace(5)> %result75;76; ALL-SIZE-LABEL: 'ptrmask_v2p5_v2i32'77; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %result = call <2 x ptr addrspace(5)> @llvm.ptrmask.v2p5.v2i32(<2 x ptr addrspace(5)> %ptr, <2 x i32> %mask)78; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <2 x ptr addrspace(5)> %result79;80 %result = call <2 x ptr addrspace(5)> @llvm.ptrmask.v2p5.v2i32(<2 x ptr addrspace(5)> %ptr, <2 x i32> %mask)81 ret <2 x ptr addrspace(5)> %result82}83 84define <3 x ptr> @ptrmask_v3p0_v3i64(<3 x ptr> %ptr, <3 x i64> %mask) {85; ALL-LABEL: 'ptrmask_v3p0_v3i64'86; ALL-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %result = call <3 x ptr> @llvm.ptrmask.v3p0.v3i64(<3 x ptr> %ptr, <3 x i64> %mask)87; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret <3 x ptr> %result88;89; ALL-SIZE-LABEL: 'ptrmask_v3p0_v3i64'90; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %result = call <3 x ptr> @llvm.ptrmask.v3p0.v3i64(<3 x ptr> %ptr, <3 x i64> %mask)91; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <3 x ptr> %result92;93 %result = call <3 x ptr> @llvm.ptrmask.v3p0.v3i64(<3 x ptr> %ptr, <3 x i64> %mask)94 ret <3 x ptr> %result95}96 97define <3 x ptr addrspace(5)> @ptrmask_v3p5_v3i32(<3 x ptr addrspace(5)> %ptr, <3 x i32> %mask) {98; ALL-LABEL: 'ptrmask_v3p5_v3i32'99; ALL-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %result = call <3 x ptr addrspace(5)> @llvm.ptrmask.v3p5.v3i32(<3 x ptr addrspace(5)> %ptr, <3 x i32> %mask)100; ALL-NEXT: Cost Model: Found an estimated cost of 10 for instruction: ret <3 x ptr addrspace(5)> %result101;102; ALL-SIZE-LABEL: 'ptrmask_v3p5_v3i32'103; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %result = call <3 x ptr addrspace(5)> @llvm.ptrmask.v3p5.v3i32(<3 x ptr addrspace(5)> %ptr, <3 x i32> %mask)104; ALL-SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <3 x ptr addrspace(5)> %result105;106 %result = call <3 x ptr addrspace(5)> @llvm.ptrmask.v3p5.v3i32(<3 x ptr addrspace(5)> %ptr, <3 x i32> %mask)107 ret <3 x ptr addrspace(5)> %result108}109