brintos

brintos / llvm-project-archived public Read only

0
0
Text · 10.0 KiB · 00dbcff Raw
203 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,UNPACKEDID %s3; RUN: opt -passes='print<cost-model>' 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx942 < %s | FileCheck -check-prefixes=ALL,PACKEDID %s4 5; RUN: opt -passes='print<cost-model>' -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=SIZE,SIZE-UNPACKEDID %s6; RUN: opt -passes='print<cost-model>' -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx942 < %s | FileCheck -check-prefixes=SIZE,SIZE-PACKEDID %s7 8define i32 @workitem_id_x() {9; ALL-LABEL: 'workitem_id_x'10; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.x()11; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result12;13; SIZE-LABEL: 'workitem_id_x'14; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.x()15; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result16;17  %result = call i32 @llvm.amdgcn.workitem.id.x()18  ret i32 %result19}20 21define amdgpu_kernel void @kernel_workitem_id_x(ptr addrspace(1) %ptr) {22; ALL-LABEL: 'kernel_workitem_id_x'23; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.x()24; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 425; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void26;27; SIZE-LABEL: 'kernel_workitem_id_x'28; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.x()29; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 430; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void31;32  %result = call i32 @llvm.amdgcn.workitem.id.x()33  store i32 %result, ptr addrspace(1) %ptr34  ret void35}36 37define i32 @workitem_id_y() {38; ALL-LABEL: 'workitem_id_y'39; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()40; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result41;42; SIZE-LABEL: 'workitem_id_y'43; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()44; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result45;46  %result = call i32 @llvm.amdgcn.workitem.id.y()47  ret i32 %result48}49 50define amdgpu_kernel void @kernel_workitem_id_y(ptr addrspace(1) %ptr) {51; ALL-LABEL: 'kernel_workitem_id_y'52; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()53; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 454; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void55;56; SIZE-LABEL: 'kernel_workitem_id_y'57; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()58; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 459; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void60;61  %result = call i32 @llvm.amdgcn.workitem.id.y()62  store i32 %result, ptr addrspace(1) %ptr63  ret void64}65 66define i32 @workitem_id_z() {67; ALL-LABEL: 'workitem_id_z'68; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()69; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result70;71; SIZE-LABEL: 'workitem_id_z'72; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.y()73; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result74;75  %result = call i32 @llvm.amdgcn.workitem.id.y()76  ret i32 %result77}78 79define amdgpu_kernel void @kernel_workitem_id_z(ptr addrspace(1) %ptr) {80; ALL-LABEL: 'kernel_workitem_id_z'81; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.z()82; ALL-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 483; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void84;85; SIZE-LABEL: 'kernel_workitem_id_z'86; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workitem.id.z()87; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: store i32 %result, ptr addrspace(1) %ptr, align 488; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void89;90  %result = call i32 @llvm.amdgcn.workitem.id.z()91  store i32 %result, ptr addrspace(1) %ptr92  ret void93}94 95define i32 @workgroup_id_x() {96; ALL-LABEL: 'workgroup_id_x'97; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.x()98; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result99;100; SIZE-LABEL: 'workgroup_id_x'101; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.x()102; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result103;104  %result = call i32 @llvm.amdgcn.workgroup.id.x()105  ret i32 %result106}107 108define i32 @workgroup_id_y() {109; ALL-LABEL: 'workgroup_id_y'110; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.y()111; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result112;113; SIZE-LABEL: 'workgroup_id_y'114; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.y()115; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result116;117  %result = call i32 @llvm.amdgcn.workgroup.id.y()118  ret i32 %result119}120 121define i32 @workgroup_id_z() {122; ALL-LABEL: 'workgroup_id_z'123; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.y()124; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result125;126; SIZE-LABEL: 'workgroup_id_z'127; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.workgroup.id.y()128; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result129;130  %result = call i32 @llvm.amdgcn.workgroup.id.y()131  ret i32 %result132}133 134define i32 @lds_kernel_id() {135; ALL-LABEL: 'lds_kernel_id'136; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.lds.kernel.id()137; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 %result138;139; SIZE-LABEL: 'lds_kernel_id'140; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i32 @llvm.amdgcn.lds.kernel.id()141; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 %result142;143  %result = call i32 @llvm.amdgcn.lds.kernel.id()144  ret i32 %result145}146 147define ptr addrspace(4) @dispatch_ptr() {148; ALL-LABEL: 'dispatch_ptr'149; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()150; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(4) %result151;152; SIZE-LABEL: 'dispatch_ptr'153; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()154; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(4) %result155;156  %result = call ptr addrspace(4) @llvm.amdgcn.dispatch.ptr()157  ret ptr addrspace(4) %result158}159 160define i64 @dispatch_id_() {161; ALL-LABEL: 'dispatch_id_'162; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i64 @llvm.amdgcn.dispatch.id()163; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i64 %result164;165; SIZE-LABEL: 'dispatch_id_'166; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call i64 @llvm.amdgcn.dispatch.id()167; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i64 %result168;169  %result = call i64 @llvm.amdgcn.dispatch.id()170  ret i64 %result171}172 173define ptr addrspace(4) @implicitarg_ptr() {174; ALL-LABEL: 'implicitarg_ptr'175; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()176; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(4) %result177;178; SIZE-LABEL: 'implicitarg_ptr'179; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()180; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(4) %result181;182  %result = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()183  ret ptr addrspace(4) %result184}185 186define ptr addrspace(4) @queue_ptr() {187; ALL-LABEL: 'queue_ptr'188; ALL-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()189; ALL-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret ptr addrspace(4) %result190;191; SIZE-LABEL: 'queue_ptr'192; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %result = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()193; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret ptr addrspace(4) %result194;195  %result = call ptr addrspace(4) @llvm.amdgcn.queue.ptr()196  ret ptr addrspace(4) %result197}198;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:199; PACKEDID: {{.*}}200; SIZE-PACKEDID: {{.*}}201; SIZE-UNPACKEDID: {{.*}}202; UNPACKEDID: {{.*}}203