[llvm] [SPIR-V] Add InferAddrSpaces pass to the backend (PR #137766)
Steven Perron via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 29 13:04:46 PDT 2025
================
@@ -190,6 +191,14 @@ void SPIRVPassConfig::addIRPasses() {
TargetPassConfig::addIRPasses();
if (TM.getSubtargetImpl()->isVulkanEnv()) {
+ // The frontend has a tendency to quickly addrspacecast pointers to the
+ // default address space, and relies on addrspacecast instructions at the
+ // boundaries. Vulkan does not allow such things, and we must keep the
+ // pointer address space stable.
+ // This pass will determine real address space of a pointer, and patch
+ // instructions removing Addrspacecasts.
----------------
s-perron wrote:
I would make the comment more succinctly and precisely.
```suggestion
// Vulkan does not allow address space casts. This pass is run to remove address space casts that can be removed.
// If an address space cast is not removed while targeting Vulkan, <replace with what will happen>.
```
https://github.com/llvm/llvm-project/pull/137766
More information about the llvm-commits
mailing list