Skip to content

[NFC][SPIRV] New test for untested SPIRV backend case - #185686

Merged
mgcarrasco merged 8 commits into
llvm:mainfrom
ambergorzynski:spirv-backend-test
Mar 11, 2026
Merged

mgcarrasco merged 8 commits into
llvm:mainfrom
ambergorzynski:spirv-backend-test

Conversation

@ambergorzynski

@ambergorzynski ambergorzynski commented Mar 10, 2026 •

Copy link
Copy Markdown
Contributor

This line in the SPIRV backend is uncovered by the existing test suite (checked using coverage, and by asserting that no tests in the existing test suite fails if we insert an abort() at this line).

We propose a test that covers this line. We demonstrate the test by inserting an abort() at that line in commit #e37e88e. Running all tests shows that only our proposed test fails in the presence of the abort. We've removed the abort ahead of merging.

This is the only test that fails in the presence of the abort (which includes our new test): LLVM.CodeGen/SPIRV/instructions/icmp.ll

@github-actions

Copy link
Copy Markdown

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@github-actions

github-actions Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

🐧 Linux x64 Test Results

  • 192018 tests passed
  • 4908 tests skipped

✅ The build succeeded and all tests passed.

@github-actions

github-actions Bot commented Mar 10, 2026 •

Copy link
Copy Markdown

🪟 Windows x64 Test Results

  • 132105 tests passed
  • 2994 tests skipped

✅ The build succeeded and all tests passed.

@mgcarrasco
mgcarrasco marked this pull request as ready for review March 11, 2026 09:50
@mgcarrasco
mgcarrasco requested a review from jmmartinez March 11, 2026 09:50
@llvmbot

llvmbot commented Mar 11, 2026

Copy link
Copy Markdown
Member

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

Author: None (ambergorzynski)

Changes

This line in the SPIRV backend is uncovered by the existing test suite (checked using coverage, and by asserting that no tests in the existing test suite fails if we insert an abort() at this line).

We propose a test that covers this line. We demonstrate the test by inserting an abort() at that line in commit #e37e88e. Running all tests shows that only our proposed test fails in the presence of the abort. We've removed the abort ahead of merging.

This is the only test that fails in the presence of the abort (which includes our new test):

> # 🐧 Linux x64 Test Results
> * 171023 tests passed
> * 3024 tests skipped
> * 1 test failed
>
> ## Failed Tests
> (click on a test name to see its output)
>
> ### LLVM
> LLVM.CodeGen/SPIRV/instructions/icmp.ll
> &gt; Exit Code: 2 &gt; &gt; Command Output (stdout): &gt; -- &gt; # RUN: at line 1 &gt; /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll -o - | /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll &gt; # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll -o - &gt; # .---command stderr------------ &gt; # | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug. &gt; # | Stack dump: &gt; # | 0. Program arguments: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll -o - &gt; # | 1. Running pass 'Function Pass Manager' on module '/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll'. &gt; # | 2. Running pass 'InstructionSelect' on function '@<!-- -->test_v16_ne' &gt; # | #<!-- -->0 0x000000000853cfc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&amp;, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13 &gt; # | #<!-- -->1 0x0000000008539f31 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18 &gt; # | #<!-- -->2 0x000000000853dde1 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38 &gt; # | #<!-- -->3 0x00007f3755be2330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330) &gt; # | #<!-- -->4 0x00007f3755c3bb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c) &gt; # | #<!-- -->5 0x00007f3755be227e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e) &gt; # | #<!-- -->6 0x00007f3755bc58ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff) &gt; # | #<!-- -->7 0x00000000063c3f05 getICmpOpcode /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:2327:3 &gt; # | #<!-- -->8 0x00000000063c3f05 (anonymous namespace)::SPIRVInstructionSelector::selectICmp(llvm::Register, llvm::SPIRVTypeInst, llvm::MachineInstr&amp;) const /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:3281:14 &gt; # | #<!-- -->9 0x00000000063b0bd2 (anonymous namespace)::SPIRVInstructionSelector::spvSelect(llvm::Register, llvm::SPIRVTypeInst, llvm::MachineInstr&amp;) const /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:1295:5 &gt; # | #<!-- -->10 0x00000000063af4ce (anonymous namespace)::SPIRVInstructionSelector::select(llvm::MachineInstr&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:861:7 &gt; # | #<!-- -->11 0x0000000008c85377 llvm::InstructionSelect::selectMachineFunction(llvm::MachineFunction&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:0:0 &gt; # | #<!-- -->12 0x0000000008c84bfe operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:143:53 &gt; # | #<!-- -->13 0x0000000008c84bfe ~scope_exit /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/ScopeExit.h:43:7 &gt; # | #<!-- -->14 0x0000000008c84bfe llvm::InstructionSelect::runOnMachineFunction(llvm::MachineFunction&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp:155:1 &gt; # | #<!-- -->15 0x00000000071fa2a3 llvm::MachineFunctionPass::runOnFunction(llvm::Function&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:0:10 &gt; # | #<!-- -->16 0x0000000007768e38 llvm::FPPassManager::runOnFunction(llvm::Function&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:0:27 &gt; # | #<!-- -->17 0x00000000077708e2 llvm::FPPassManager::runOnModule(llvm::Module&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1444:13 &gt; # | #<!-- -->18 0x00000000077698ab runOnModule /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1513:27 &gt; # | #<!-- -->19 0x00000000077698ab llvm::legacy::PassManagerImpl::run(llvm::Module&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:531:44 &gt; # | #<!-- -->20 0x0000000004f51e7c compileModule(char**, llvm::SmallVectorImpl&lt;llvm::PassPlugin&gt;&amp;, llvm::LLVMContext&amp;, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt;&gt;&amp;) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llc/llc.cpp:871:17 &gt; # | #<!-- -->21 0x0000000004f4f143 main /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/tools/llc/llc.cpp:459:13 &gt; # | #<!-- -->22 0x00007f3755bc71ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca) &gt; # | #<!-- -->23 0x00007f3755bc728b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b) &gt; # | #<!-- -->24 0x0000000004f4ac65 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/llc+0x4f4ac65) &gt; # `----------------------------- &gt; # error: command failed with exit status: -6 &gt; # executed command: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll &gt; # .---command stderr------------ &gt; # | FileCheck error: '&lt;stdin&gt;' is empty. &gt; # | FileCheck command line: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/FileCheck /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/test/CodeGen/SPIRV/instructions/icmp.ll &gt; # `----------------------------- &gt; # error: command failed with exit status: 2 &gt; &gt; -- &gt;


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

1 Files Affected:

  • (modified) llvm/test/CodeGen/SPIRV/instructions/icmp.ll (+12)
diff --git a/llvm/test/CodeGen/SPIRV/instructions/icmp.ll b/llvm/test/CodeGen/SPIRV/instructions/icmp.ll
index bbf947f84c09a..157f1064dc07f 100644
--- a/llvm/test/CodeGen/SPIRV/instructions/icmp.ll
+++ b/llvm/test/CodeGen/SPIRV/instructions/icmp.ll
@@ -21,6 +21,7 @@
 ; CHECK-DAG: OpName [[v3SGT:%.*]] "test_v3_sgt"
 ; CHECK-DAG: OpName [[v3UGE:%.*]] "test_v3_uge"
 ; CHECK-DAG: OpName [[v3SGE:%.*]] "test_v3_sge"
+; CHECK-DAG: OpName [[v16NE:%.*]] "test_v16_ne"
 
 ; CHECK:      [[EQ]] = OpFunction
 ; CHECK-NEXT: [[A:%.*]] = OpFunctionParameter
@@ -261,3 +262,14 @@ define <3 x i1> @test_v3_sge(<3 x i32> %a, <3 x i32> %b) {
   %r = icmp sge <3 x i32> %a, %b
   ret <3 x i1> %r
 }
+
+; CHECK:      [[v16NE]] = OpFunction
+; CHECK-NEXT: OpLabel
+; CHECK-NEXT: [[R:%.*]] = OpLogicalNotEqual {{%.+}} {{%.*}} {{%.*}}
+; CHECK-NEXT: OpReturnValue [[R]]
+; CHECK-NEXT: OpFunctionEnd
+
+define spir_func <16 x i1> @test_v16_ne() addrspace(4) {
+  %A = icmp ne <16 x i1> zeroinitializer, zeroinitializer
+  ret <16 x i1> %A
+}

@ambergorzynski ambergorzynski changed the title [WIP][Don't merge] New test for untested SPIRV backend case [NFC][SPIRV] New test for untested SPIRV backend case Mar 11, 2026
@MrSidims

Copy link
Copy Markdown
Contributor

@ambergorzynski please shorten PR description, so when we merge with squash and merge we won't incidentally introduce overwhelming commit message to git log.

@ambergorzynski

Copy link
Copy Markdown
Contributor Author

Shortened - is that sufficient?

@mgcarrasco
mgcarrasco merged commit e45c8b6 into llvm:main Mar 11, 2026
9 checks passed
@github-actions

Copy link
Copy Markdown

@ambergorzynski Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@ambergorzynski
ambergorzynski deleted the spirv-backend-test branch March 12, 2026 07:42
@@ -1,4 +1,5 @@
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
; RUN: %if spirv-tools %{ llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry I'm a bit late, but should we test with Vulkan too? Or is there any reason not to do it?

ayasin-a pushed a commit to ayasin-a/llvm-project that referenced this pull request Apr 19, 2026
[This
line](https://github.com/ambergorzynski/llvm-project/blob/main/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp#L2362)
in the SPIRV backend is uncovered by the existing test suite (checked
using coverage, and by asserting that no tests in the existing test
suite fails if we insert an `abort()` at this line).

We propose a test that covers this line. We demonstrate the test by
inserting an `abort()` at that line in commit
[#e37e88e](llvm@e37e88e).
Running all tests shows that only our proposed test fails in the
presence of the `abort`. We've removed the `abort` ahead of merging.

This is the only test that fails in the presence of the abort (which
includes our new test): `LLVM.CodeGen/SPIRV/instructions/icmp.ll`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants