diff options
author | Vyacheslav Levytskyy <vyacheslav.levytskyy@intel.com> | 2024-04-17 11:50:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 11:50:55 +0200 |
commit | 42d801d4e42ff8c47c3a24d562774851e3a424f5 (patch) | |
tree | dff4619b379c2b3e0e75c94f07315e423c3380fa /llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp | |
parent | b512df660ef136f8bbd0895bf862a827923a6714 (diff) | |
download | llvm-42d801d4e42ff8c47c3a24d562774851e3a424f5.zip llvm-42d801d4e42ff8c47c3a24d562774851e3a424f5.tar.gz llvm-42d801d4e42ff8c47c3a24d562774851e3a424f5.tar.bz2 |
[SPIR-V] Account for zext in a llvm intrinsic call (#88903)
This PR addresses an issue that may arise when an integer argument size
differs from a machine word size for the target in a call to llvm
intrinsic. The following example demonstrates the issue:
```
@__const.test.arr = private unnamed_addr addrspace(2) constant [3 x i32] [i32 1, i32 2, i32 3]
define spir_func void @test() {
entry:
%arr = alloca [3 x i32], align 4
%dest = bitcast ptr %arr to ptr
call void @llvm.memcpy.p0.p2.i32(ptr align 4 %dest, ptr addrspace(2) align 4 @__const.test.arr, i32 1024, i1 false)
ret void
}
declare void @llvm.memcpy.p0.p2.i32(ptr nocapture writeonly, ptr addrspace(2) nocapture readonly, i32, i1)
```
Depending on the target this code may work or may fail without this PR
due to the fact that IR Translation step introduces additional `zext`
when type of the 3rd argument of `@llvm.memcpy.p0.p2.i32` differs from
machine word.
This PR addresses the issue by adding type deduction for a newly
inserted G_ZEXT generic opcode.
Diffstat (limited to 'llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp')
0 files changed, 0 insertions, 0 deletions