Debian Codegraph @

llvm/test/CodeGen/SPIRV/debug-info/no-misplaced-opextinst.ll

raw
1 ; This test is to ensure that OpExtInst generated by NonSemantic_Shader_DebugInfo_100
2 ; are not mixed up with other OpExtInst instructions.
3 ; The code of the test is a reproducer, because "lgamma" has the same code (35)
4 ; inside OpenCL_std as DebugSource inside NonSemantic_Shader_DebugInfo_100.
5
6 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
7 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
8
9 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
10 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
11
12 ; CHECK: %[[#Ocl:]] = OpExtInstImport "OpenCL.std"
13 ; CHECK: OpName %[[#Fun:]] "__devicelib_lgammaf"
14 ; CHECK: %[[#Fun]] = OpFunction %[[#]] None %[[#]]
15 ; CHECK: OpFunctionParameter
16 ; CHECK: %[[#]] = OpExtInst %[[#]] %[[#Ocl]] lgamma %[[#]]
17
18 define weak_odr dso_local spir_kernel void @foo() {
19 entry:
20 %r = tail call spir_func noundef float @lgammaf(float noundef 0x7FF8000000000000)
21 ret void
22 }
23
24 define weak dso_local spir_func float @lgammaf(float noundef %x) {
25 entry:
26 %call = tail call spir_func float @__devicelib_lgammaf(float noundef %x)
27 ret float %call
28 }
29
30 define weak dso_local spir_func float @__devicelib_lgammaf(float noundef %x) {
31 entry:
32 %call = tail call spir_func noundef float @_Z18__spirv_ocl_lgammaf(float noundef %x)
33 ret float %call
34 }
35
36 declare dso_local spir_func noundef float @_Z18__spirv_ocl_lgammaf(float noundef)