[llvm] r305759 - [AMDGPU] Add infer address spaces pass before SROA

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 16:17:37 PDT 2017


Author: rampitec
Date: Mon Jun 19 18:17:36 2017
New Revision: 305759

URL: http://llvm.org/viewvc/llvm-project?rev=305759&view=rev
Log:
[AMDGPU] Add infer address spaces pass before SROA

It adds it for the target after inlining but before SROA where
we can get most out of it.

Differential Revision: https://reviews.llvm.org/D34366

Added:
    llvm/trunk/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll
Modified:
    llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Modified: llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp?rev=305759&r1=305758&r2=305759&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp Mon Jun 19 18:17:36 2017
@@ -342,6 +342,14 @@ void AMDGPUTargetMachine::adjustPassMana
         PM.add(createAMDGPUExternalAAWrapperPass());
       }
   });
+
+  Builder.addExtension(
+    PassManagerBuilder::EP_CGSCCOptimizerLate,
+    [](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
+      // Add infer address spaces pass to the opt pipeline after inlining
+      // but before SROA to increase SROA opportunities.
+      PM.add(createInferAddressSpacesPass());
+  });
 }
 
 //===----------------------------------------------------------------------===//

Added: llvm/trunk/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll?rev=305759&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll (added)
+++ llvm/trunk/test/CodeGen/AMDGPU/infer-addrpace-pipeline.ll Mon Jun 19 18:17:36 2017
@@ -0,0 +1,10 @@
+; RUN: opt -mtriple=amdgcn--amdhsa -disable-output -disable-verify -debug-pass=Structure -O2 %s 2>&1 | FileCheck -check-prefix=GCN %s
+
+; GCN: Function Integration/Inlining
+; GCN: FunctionPass Manager
+; GCN: Infer address spaces
+; GCN: SROA
+
+define void @empty() {
+  ret void
+}




More information about the llvm-commits mailing list