|
| 1 | +;=========================== begin_copyright_notice ============================ |
| 2 | +; |
| 3 | +; Copyright (C) 2023 Intel Corporation |
| 4 | +; |
| 5 | +; SPDX-License-Identifier: MIT |
| 6 | +; |
| 7 | +;============================ end_copyright_notice ============================= |
| 8 | + |
| 9 | +; RUN: igc_opt %s -S -o - -serialize-igc-metadata -igc-stateless-to-stateful-resolution -platformdg2 | FileCheck %s |
| 10 | + |
| 11 | +; This test verifies if raytracing implicit global buffer is not promoted to stateful, as only stateless mode is supported in the runtime. |
| 12 | + |
| 13 | +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32" |
| 14 | +target triple = "spir64-unknown-unknown" |
| 15 | + |
| 16 | +; Function Attrs: convergent nounwind |
| 17 | +define spir_kernel void @test_implicit_dg(i32 addrspace(1)* %out, i32 %offset, <8 x i32> %r0, <8 x i32> %payloadHeader, i8 addrspace(1)* %globalPointer, i32 %bufferOffset) #1 { |
| 18 | +entry: |
| 19 | + %mul = shl nsw i32 %offset, 4 |
| 20 | + %idx.ext = sext i32 %mul to i64 |
| 21 | + %add.ptr = getelementptr inbounds i8, i8 addrspace(1)* %globalPointer, i64 %idx.ext |
| 22 | + %0 = bitcast i8 addrspace(1)* %add.ptr to i32 addrspace(1)* |
| 23 | + ; CHECK-NOT: %{{.*}} = inttoptr i32 %{{.*}} to i32 addrspace(131073)* |
| 24 | + ; CHECK-NOT: %{{.*}} = load i32, i32 addrspace(131073)* %2, align 4 |
| 25 | + ; CHECK: %{{.*}} = load i32, i32 addrspace(1)* %0, align 4 |
| 26 | + %1 = load i32, i32 addrspace(1)* %0, align 4 |
| 27 | + store i32 %1, i32 addrspace(1)* %out, align 4 |
| 28 | + ret void |
| 29 | +} |
| 30 | + |
| 31 | +attributes #0 = { nounwind } |
| 32 | + |
| 33 | +!igc.functions = !{!300} |
| 34 | + |
| 35 | +!300 = !{void (i32 addrspace(1)*, i32, <8 x i32>, <8 x i32>, i8 addrspace(1)*, i32)* @test_implicit_dg, !301} |
| 36 | +!301 = !{!302, !303} |
| 37 | +!302 = !{!"function_type", i32 0} |
| 38 | +!303 = !{!"implicit_arg_desc", !304, !305, !306, !307} |
| 39 | +!304 = !{i32 0} |
| 40 | +!305 = !{i32 1} |
| 41 | +!306 = !{i32 53} |
| 42 | +!307 = !{i32 14, !308} |
| 43 | +!308 = !{!"explicit_arg_num", i32 0} |
0 commit comments