[SPIR-V] Support TargetExtType for SPIR-V builtin types
authorMichal Paszkowski <michal.paszkowski@outlook.com>
Mon, 27 Feb 2023 20:26:09 +0000 (21:26 +0100)
committerMichal Paszkowski <michal.paszkowski@outlook.com>
Mon, 27 Feb 2023 20:39:25 +0000 (21:39 +0100)
commit5ac69674bf4fbe4adaca4170a2ad60c8a32613ed
treeb173355254f844484728ba028339abf336977f7d
parenta700fb3d9b31dbcfc9d173c396c1ec644ea40c6d
[SPIR-V] Support TargetExtType for SPIR-V builtin types

This patch adds support for TargetExtType/target(...) representing
SPIR-V builtin types. After D135202, target(...) is the preferred way
for representing SPIR-V builtin types in LLVM IR and the only working
in the opaque pointer mode.

In order to maintain compatibility with LLVM IR generated by older
versions of Clang and LLVM/SPIR-V Translator, pointers-to-opaque-structs
denoting SPIR-V/OpenCL builtin types will be translated to equivalent
SPIR-V target extension types. This translation is only available in the
typed pointer mode (-opaque-pointers=0).

The relevant LIT tests with SPIR-V builtins were converted to use the
new target(...) notation.

Differential Revision: https://reviews.llvm.org/D144494
llvm/lib/CodeGen/ValueTypes.cpp
llvm/lib/IR/Type.cpp
llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp
llvm/lib/Target/SPIRV/SPIRVBuiltins.h
llvm/lib/Target/SPIRV/SPIRVBuiltins.td
llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
llvm/lib/Target/SPIRV/SPIRVUtils.cpp
llvm/test/CodeGen/SPIRV/image_store.ll
llvm/test/CodeGen/SPIRV/spirv.Queue.ll
llvm/test/CodeGen/SPIRV/transcoding/spirv-types.ll