[llvm] [NVPTX] Change the alloca address space in NVPTXLowerAlloca (PR #154814)

Theodoros Theodoridis via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 03:27:21 PDT 2025


================
@@ -371,6 +371,8 @@ void NVPTXPassConfig::addIRPasses() {
   if (getOptLevel() != CodeGenOptLevel::None) {
     addAddressSpaceInferencePasses();
     addStraightLineScalarOptimizationPasses();
+  } else {
+    addPass(createNVPTXLowerAllocaPass());
----------------
thetheodor wrote:

It's also part of `addAddressSpaceInferencePasses`, but since these passes are only added if `getOptLevel() != CodeGenOptLevel::None`, I also added it in the else branch of the check. 

I am wondering if `InferAddressSpaces` should also be run to remove the address space casts. Or maybe a simplified version of it.

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


More information about the llvm-commits mailing list