[llvm] [SPIR-V][Codegen] Represent the property of the target to declare and use typed pointers and update MachineVerifier to use it (PR #110270)

Vyacheslav Levytskyy via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 09:36:53 PDT 2024


================
@@ -455,6 +455,12 @@ class TargetLoweringBase {
     return true;
   }
 
+  /// Return true if the target can handle the declaration and use of pointers
+  /// that specify the type of data they point to, meaning that interpretation
+  /// of the data type is not left to instructions that utilize the pointer, but
+  /// encoded by the pointer declaration.
+  virtual bool hasTypedPointer() const { return false; }
----------------
VyacheslavLevytskyy wrote:

I don't know what is the best option. After some reflection I decided that the notion of typed pointers seems to be more of a target lowering property than property of the SPIRV target machine itself, especially given the recent appearance of untyped pointers (https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/extensions/KHR/SPV_KHR_untyped_pointers.html) that do not specify the type of data they point to. Although we can't lower without typed pointers at the moment, probably this property belongs to lowering rather than to target machine. I'm not 100% sure though.

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


More information about the llvm-commits mailing list