[clang] [llvm] [clang][llvm][SPIR-V] Explicitly encode native integer widths for SPIR-V (PR #110695)

Vyacheslav Levytskyy via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 10 22:18:59 PDT 2024


================
@@ -1,12 +1,14 @@
 ; This test aims to check ability to support "Arithmetic with Overflow" intrinsics
 ; in the special case when those intrinsics are being generated by the CodeGenPrepare;
-; pass during translations with optimization (note -O3 in llc arguments).
+; pass during translations with optimization (note -disable-lsr, to inhibit
+; strength reduction pre-empting with a more preferable match for this pattern
+; in llc arguments).
 
-; RUN: llc -O3 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
-; RUN: %if spirv-tools %{ llc -O3 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
+; RUN: llc -O3 -disable-lsr -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
----------------
VyacheslavLevytskyy wrote:

In this case you lose coverage, because

> Correctly selecting / lowering them should be independent of whether they were implicitly inserted by some optimisation pass, or explicitly inserted by the user.

it's a nice idea, I agree with you, but it's somewhat detached. There are two different conditions: (1) those intrinsics are present already and explicitly accessible for processing by SPIRV Backend code, and (2) those intrinsics appear during later passes and not accessible for processing. This test case is related to the very concrete improvement.


https://github.com/llvm/llvm-project/pull/110695


More information about the cfe-commits mailing list