|
| 1 | +; This test checks that LowerESIMD pass adds alwaysinline attribute to |
| 2 | +; functions, except those marked with |
| 3 | +; - spir_kernel |
| 4 | +; - noinline |
| 5 | +; - "VCStackCall" |
| 6 | + |
| 7 | +; RUN: opt -passes=LowerESIMD -S < %s | FileCheck %s |
| 8 | + |
| 9 | +target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 10 | +target triple = "spir64-unknown-unknown" |
| 11 | + |
| 12 | +; Function w/o attributes, must be marked with "alwaysinline" |
| 13 | +define dso_local spir_func void @no_attrs_func(float addrspace(4)* %ptr) { |
| 14 | +; CHECK: define dso_local spir_func void @no_attrs_func(float addrspace(4)* %ptr) #[[ATTRS1:[0-9]+]] { |
| 15 | + store float 2.0, float addrspace(4)* %ptr |
| 16 | + ret void |
| 17 | +} |
| 18 | + |
| 19 | +; VCStackCall function, must not be marked with "alwaysinline" |
| 20 | +define dso_local spir_func void @vc_stack_call_func(float addrspace(4)* %ptr) #0 { |
| 21 | +; CHECK: define dso_local spir_func void @vc_stack_call_func(float addrspace(4)* %ptr) #[[ATTRS2:[0-9]+]] { |
| 22 | + store float 1.0, float addrspace(4)* %ptr |
| 23 | + ret void |
| 24 | +} |
| 25 | + |
| 26 | +; Function with "noinline" attribute", must not be marked with "alwaysinline" |
| 27 | +define dso_local spir_func void @noinline_func(float addrspace(4)* %ptr) #1 { |
| 28 | +; CHECK: define dso_local spir_func void @noinline_func(float addrspace(4)* %ptr) #[[ATTRS3:[0-9]+]] { |
| 29 | + store float 2.0, float addrspace(4)* %ptr |
| 30 | + ret void |
| 31 | +} |
| 32 | + |
| 33 | +; Kernel, must not be marked with "alwaysinline" |
| 34 | +define dso_local spir_kernel void @KERNEL(float addrspace(4)* %ptr) !sycl_explicit_simd !0 !intel_reqd_sub_group_size !1 { |
| 35 | +; CHECK: define dso_local spir_kernel void @KERNEL(float addrspace(4)* %ptr) #[[ATTRS4:[0-9]+]] !sycl_explicit_simd !{{.*}} !intel_reqd_sub_group_size !{{.*}} { |
| 36 | + store float 2.0, float addrspace(4)* %ptr |
| 37 | + ret void |
| 38 | +} |
| 39 | + |
| 40 | + |
| 41 | +attributes #0 = { "VCStackCall" } |
| 42 | +attributes #1 = { noinline } |
| 43 | +; CHECK-DAG: attributes #[[ATTRS1]] = { alwaysinline } |
| 44 | +; CHECK-DAG: attributes #[[ATTRS2]] = { "VCStackCall" } |
| 45 | +; CHECK-DAG: attributes #[[ATTRS3]] = { noinline } |
| 46 | +; CHECK-DAG: attributes #[[ATTRS4]] = { "CMGenxMain" "oclrt"="1" } |
| 47 | + |
| 48 | +!0 = !{} |
| 49 | +!1 = !{i32 1} |
0 commit comments