[llvm] [SPIR-V] Fix sub-byte argument type mismatch in call lowering (PR #189893)

Dmitry Sidorov via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 1 05:09:16 PDT 2026


================
@@ -0,0 +1,16 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
+; RUN: %if spirv-tools %{ llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
+
+; CHECK: %[[#CharTy:]] = OpTypeInt 8 0
+; CHECK: %[[#FnTy:]] = OpTypeFunction %[[#CharTy]] %[[#CharTy]] %[[#CharTy]]
+; CHECK: %[[#Fn:]] = OpFunction %[[#CharTy]] None %[[#FnTy]]
+; CHECK: %[[#A:]] = OpFunctionParameter %[[#CharTy]]
+; CHECK: %[[#B:]] = OpFunctionParameter %[[#CharTy]]
+; CHECK: %[[#Res:]] = OpIAdd %[[#CharTy]] %[[#A]] %[[#B]]
+; CHECK: OpReturnValue %[[#Res]]
+
+define spir_func i2 @add_i2(i2 %a, i2 %b) {
----------------
MrSidims wrote:

Lets add a comment in the test, explaining, what the type mismatch was.

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


More information about the llvm-commits mailing list