[PATCH] D18616: [NVPTX] Move NVVMReflect pass out of codegen passes.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 12:19:31 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL267765: [NVPTX] Run NVVMReflect at the beginning of IR passes. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D18616?vs=55278&id=55291#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D18616

Files:
  llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
  llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.h

Index: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.h
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.h
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.h
@@ -61,6 +61,7 @@
     return TLOF.get();
   }
 
+  void addEarlyAsPossiblePasses(PassManagerBase &PM) override;
   TargetIRAnalysis getTargetIRAnalysis() override;
 
 }; // NVPTXTargetMachine.
Index: llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetMachine.cpp
@@ -167,6 +167,10 @@
   return new NVPTXPassConfig(this, PM);
 }
 
+void NVPTXTargetMachine::addEarlyAsPossiblePasses(PassManagerBase &PM) {
+  PM.add(createNVVMReflectPass());
+}
+
 TargetIRAnalysis NVPTXTargetMachine::getTargetIRAnalysis() {
   return TargetIRAnalysis([this](const Function &F) {
     return TargetTransformInfo(NVPTXTTIImpl(this, F));
@@ -228,7 +232,12 @@
   disablePass(&FuncletLayoutID);
   disablePass(&PatchableFunctionID);
 
+  // NVVMReflectPass is added in addEarlyAsPossiblePasses, so hopefully running
+  // it here does nothing.  But since we need it for correctness when lowering
+  // to NVPTX, run it here too, in case whoever built our pass pipeline didn't
+  // call addEarlyAsPossiblePasses.
   addPass(createNVVMReflectPass());
+
   if (getOptLevel() != CodeGenOpt::None)
     addPass(createNVPTXImageOptimizerPass());
   addPass(createNVPTXAssignValidGlobalNamesPass());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18616.55291.patch
Type: text/x-patch
Size: 1569 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/35310a75/attachment.bin>


More information about the llvm-commits mailing list