1 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
3 ; CHECK: 'test_br_cost'
4 ; CHECK: estimated cost of 10 for instruction: br i1
5 ; CHECK: estimated cost of 10 for instruction: br label
6 ; CHECK: estimated cost of 10 for instruction: ret void
7 define amdgpu_kernel void @test_br_cost(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
9 br i1 undef, label %bb1, label %bb2
12 %vec = load i32, i32 addrspace(1)* %vaddr
13 %add = add i32 %vec, %b
14 store i32 %add, i32 addrspace(1)* %out
22 ; CHECK: 'test_switch_cost'
23 ; CHECK: Unknown cost for instruction: switch
24 define amdgpu_kernel void @test_switch_cost(i32 %a) #0 {
26 switch i32 %a, label %default [
32 store volatile i32 undef, i32 addrspace(1)* undef
36 store volatile i32 undef, i32 addrspace(1)* undef
40 store volatile i32 undef, i32 addrspace(1)* undef