Skip to content

Conversation

@aadeshps-mcw
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented May 30, 2025

@llvm/pr-subscribers-backend-spir-v

Author: Aadesh Premkumar (aadeshps-mcw)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/142097.diff

2 Files Affected:

  • (added) llvm/test/CodeGen/SPIRV/llvm-intrinsics/tan.ll (+24)
  • (added) llvm/test/CodeGen/SPIRV/zero-length-array.ll (+12)
diff --git a/llvm/test/CodeGen/SPIRV/llvm-intrinsics/tan.ll b/llvm/test/CodeGen/SPIRV/llvm-intrinsics/tan.ll new file mode 100644 index 0000000000000..6d28816d86bc2 --- /dev/null +++ b/llvm/test/CodeGen/SPIRV/llvm-intrinsics/tan.ll @@ -0,0 +1,24 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK-DAG: %[[#ext:]] = OpExtInstImport "OpenCL.std" + +; CHECK-DAG: %[[#type_f32:]] = OpTypeFloat 32 +; CHECK-DAG: %[[#type_f64:]] = OpTypeFloat 64 + +; CHECK: %[[#extinst_f32:]] = OpExtInst %[[#type_f32]] %[[#ext]] tan %[[#]] +; CHECK: %[[#extinst_f64:]] = OpExtInst %[[#type_f64]] %[[#ext]] tan %[[#]] + + +define float @test_tan_f32(float %x) { + %res = call float @llvm.tan.f32(float %x) + ret float %res +} + +define double @test_tan_f64(double %x) { + %res = call double @llvm.tan.f64(double %x) + ret double %res +} + +declare float @llvm.tan.f32(float) +declare double @llvm.tan.f64(double) diff --git a/llvm/test/CodeGen/SPIRV/zero-length-array.ll b/llvm/test/CodeGen/SPIRV/zero-length-array.ll new file mode 100644 index 0000000000000..668bf2018dec7 --- /dev/null +++ b/llvm/test/CodeGen/SPIRV/zero-length-array.ll @@ -0,0 +1,12 @@ +; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s +; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %} + +; CHECK: %[[#type:]] = OpTypeInt 32 0 +; CHECK: %[[#ext:]] = OpTypeRuntimeArray %[[#type]] +; CHECK: %[[#]] = OpTypePointer Function %[[#ext]] + +define spir_func void @_Z3foov() { +entry: + %i = alloca [0 x i32], align 4 + ret void +} 
@michalpaszkowski michalpaszkowski merged commit 29d9c4a into llvm:main Aug 3, 2025
10 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 3, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building llvm at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/22046

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure) ... PASS: lldb-api :: commands/memory/write/TestMemoryWrite.py (191 of 2294) PASS: lldb-api :: commands/platform/file/close/TestPlatformFileClose.py (192 of 2294) PASS: lldb-api :: commands/platform/file/read/TestPlatformFileRead.py (193 of 2294) PASS: lldb-api :: commands/memory/read/TestMemoryRead.py (194 of 2294) UNSUPPORTED: lldb-api :: commands/platform/sdk/TestPlatformSDK.py (195 of 2294) PASS: lldb-api :: commands/platform/connect/TestPlatformConnect.py (196 of 2294) PASS: lldb-api :: commands/plugin/TestPlugin.py (197 of 2294) PASS: lldb-api :: commands/platform/process/launch/TestPlatformProcessLaunch.py (198 of 2294) PASS: lldb-api :: commands/platform/process/list/TestProcessList.py (199 of 2294) UNRESOLVED: lldb-api :: commands/gui/spawn-threads/TestGuiSpawnThreads.py (200 of 2294) ******************** TEST 'lldb-api :: commands/gui/spawn-threads/TestGuiSpawnThreads.py' FAILED ******************** Script: -- /usr/bin/python3.10 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --cmake-build-type Release /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/commands/gui/spawn-threads -p TestGuiSpawnThreads.py -- Exit Code: 1 Command Output (stdout): -- lldb version 22.0.0git (https://github.com/llvm/llvm-project.git revision 29d9c4a6fe869a1800bb44f125c09a9442413451) clang revision 29d9c4a6fe869a1800bb44f125c09a9442413451 llvm revision 29d9c4a6fe869a1800bb44f125c09a9442413451 Skipping the following test categories: ['libc++', 'msvcstl', 'dsym', 'gmodules', 'debugserver', 'objc'] -- Command Output (stderr): -- FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_gui (TestGuiSpawnThreads.TestGuiSpawnThreadsTest) ====================================================================== ERROR: test_gui (TestGuiSpawnThreads.TestGuiSpawnThreadsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/decorators.py", line 151, in wrapper return func(*args, **kwargs) File "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/commands/gui/spawn-threads/TestGuiSpawnThreads.py", line 44, in test_gui self.child.expect_exact(f"thread #{i + 2}: tid =") File "/usr/local/lib/python3.10/dist-packages/pexpect/spawnbase.py", line 432, in expect_exact return exp.expect_loop(timeout) File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 179, in expect_loop return self.eof(e) File "/usr/local/lib/python3.10/dist-packages/pexpect/expect.py", line 122, in eof raise exc pexpect.exceptions.EOF: End Of File (EOF). Exception style platform. <pexpect.pty_spawn.spawn object at 0xff78c11ba050> command: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/lldb args: ['/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/lldb', '--no-lldbinit', '--no-use-colors', '-O', 'settings clear --all', '-O', 'settings set symbols.enable-external-lookup false', '-O', 'settings set target.inherit-tcc true', '-O', 'settings set target.disable-aslr false', '-O', 'settings set target.detach-on-error false', '-O', 'settings set target.auto-apply-fixits false', '-O', 'settings set plugin.process.gdb-remote.packet-timeout 60', '-O', 'settings set symbols.clang-modules-cache-path "/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api"', '-O', 'settings set use-color false', '-O', 'settings set show-statusline false', '--file', '/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/commands/gui/spawn-threads/TestGuiSpawnThreads.test_gui/a.out'] buffer (last 100 chars): b'' before (last 100 chars): b'thread_create.c:442:8\n#23 0x0000fc55b9795edc ./misc/../sysdeps/unix/sysv/linux/aarch64/clone.S:82:0\n' after: <class 'pexpect.exceptions.EOF'> 
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}

; CHECK: %[[#type:]] = OpTypeInt 32 0
; CHECK: %[[#ext:]] = OpTypeRuntimeArray %[[#type]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is wrong: OpTypeRuntimeArray requires Shader capability, but the triple makes this run for Kernel. @aadeshps-mcw can you please help me understand what are you trying to test here? If we change the triple to spirv-unknown-vulkan-compute, which would run for Shader, there is no OpTypeRuntimeArray, instead there is an OpConstant, which I assume comes from some optimization/pass. @Keenuts can you confirm?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked, mem2reg is getting rid of the alloca, so no array after that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize the mistake was on my part due to a misunderstanding of the test. I’ll address it and submit a new PR at the earliest.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated it in #149522. Let me know if that works for you, otherwise I can just mark it as XFAIL in the PR, so you can address it later in a different PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

5 participants