Repository navigation
[NFC][SPIRV] New test for untested SPIRV backend case - #185686
Conversation
|
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 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. |
🐧 Linux x64 Test Results
✅ The build succeeded and all tests passed. |
🪟 Windows x64 Test Results
✅ The build succeeded and all tests passed. |
|
@llvm/pr-subscribers-backend-spir-v Author: None (ambergorzynski) ChangesThis 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 1 Files Affected:
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 please shorten PR description, so when we merge with squash and merge we won't incidentally introduce overwhelming commit message to git log. |
|
Shortened - is that sufficient? |
|
@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! |
| @@ -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 %} | |||
There was a problem hiding this comment.
Sorry I'm a bit late, but should we test with Vulkan too? Or is there any reason not to do it?
[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`
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 theabort. We've removed theabortahead 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