[all-commits] [llvm/llvm-project] 7c917e: [SPIR-V] Implement correct zeroinitializer for ext...
Vyacheslav Levytskyy via All-commits
all-commits at lists.llvm.org
Wed May 29 03:53:58 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7c917e8268225735bf6fe0f7d8491fc944358e47
https://github.com/llvm/llvm-project/commit/7c917e8268225735bf6fe0f7d8491fc944358e47
Author: Vyacheslav Levytskyy <vyacheslav.levytskyy at intel.com>
Date: 2024-05-29 (Wed, 29 May 2024)
Changed paths:
M llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
M llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
A llvm/test/CodeGen/SPIRV/event-zero-const.ll
Log Message:
-----------
[SPIR-V] Implement correct zeroinitializer for extension types in SPIR-V Backend (#93607)
This PR implements correct zeroinitializer for extension types in SPIR-V
Backend.
Previous version has just created 0 of 32/64 integer type (depending on
target machine word size), that caused re-use and type re-write of the
corresponding integer constant 0 with a potential crash on wrong usage
of the constant (i.e., 0 of integer type expected but extension type
found). E.g., the following code would crash without the PR:
```
%r1 = icmp ne i64 %_arg_i, 0
%e1 = tail call spir_func target("spirv.Event") @__spirv_GroupAsyncCopy(i32 2, ptr addrspace(3) %_arg_local, ptr addrspace(1) %_arg_ptr, i64 1, i64 1, target("spirv.Event") zeroinitializer)
```
because 0 in icmp would eventually be of `Event` type.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list