[clang] [llvm] [llvm][opt][Transforms][SPIR-V] Enable `InferAddressSpaces` for SPIR-V (PR #110897)

Alex Voicu via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 11:09:59 PDT 2024


================
@@ -178,6 +266,9 @@ void SPIRVPassConfig::addIRPasses() {
     addPass(createSPIRVStructurizerPass());
   }
 
+  if (TM.getOptLevel() > CodeGenOptLevel::None)
+    addPass(createInferAddressSpacesPass(AddressSpace::Generic));
----------------
AlexVlx wrote:

Because if one invokes the pass directly via opt there's no way but the TTI query to set Flat/Generic to anything but 0, and because making it explicit at the point of construction rather than relying on that seems somewhat more self documenting.

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


More information about the cfe-commits mailing list