[PATCH 70/79] [Backport to 15][OpaquePointers] Handle llvm.memset intrinsic mangling...
authorViktoria Maximova <viktoria.maksimova@intel.com>
Wed, 25 Oct 2023 15:14:00 +0000 (17:14 +0200)
committerAndreas Beckmann <anbe@debian.org>
Thu, 14 Mar 2024 19:01:08 +0000 (20:01 +0100)
commit7e9239926c0d21396a26c253ac15a5b6ae157415
treeee997a4c7bea4a478e3710f102394822c2f7411e
parenta0e8f1ebee037c9ad1c70e371503218086472940
[PATCH 70/79] [Backport to 15][OpaquePointers] Handle llvm.memset intrinsic mangling mismatches. (#2183)

Original change:
https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/bdd765263a0a7184dbd18fe5396313802f731e25

Non-constant @llvm.memset calls are presently lowered by generating synthetic
functions with the mangled name of memset. However, the reader tries to use this
name to generate the intrinsic call again. This causes verification issues if
the SPIRVWriter and SPIRVReader do not agree on whether or not to use opaque
pointers. This change uses the actual type of the function (which will take into
account whether or not it is in opaque pointer mode) to generate the LLVM
intrinsic name, fixing the mismatch issues.

Co-authored-by: Joshua Cranmer <joshua.cranmer@intel.com>
Gbp-Pq: Name 0070-Backport-to-15-OpaquePointers-Handle-llvm.memset-int.patch
lib/SPIRV/SPIRVReader.cpp
test/llvm-intrinsics/memset-opaque.spt [new file with mode: 0644]
test/llvm-intrinsics/memset.ll