r267764 - Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 27 12:12:56 PDT 2016
Author: jlebar
Date: Wed Apr 27 14:12:56 2016
New Revision: 267764
URL: http://llvm.org/viewvc/llvm-project?rev=267764&view=rev
Log:
Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.
Summary:
As of D18614, TargetMachine exposes a hook to add a set of passes that should
be run as early as possible. Invoke this hook from clang when setting up the
pass manager.
Reviewers: chandlerc
Subscribers: rnk, cfe-commits, tra
Differential Revision: http://reviews.llvm.org/D18617
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=267764&r1=267763&r2=267764&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Wed Apr 27 14:12:56 2016
@@ -354,6 +354,14 @@ void EmitAssemblyHelper::CreatePasses(Mo
return;
}
+ // Add target-specific passes that need to run as early as possible.
+ if (TM)
+ PMBuilder.addExtension(
+ PassManagerBuilder::EP_EarlyAsPossible,
+ [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) {
+ TM->addEarlyAsPossiblePasses(PM);
+ });
+
PMBuilder.addExtension(PassManagerBuilder::EP_EarlyAsPossible,
addAddDiscriminatorsPass);
More information about the cfe-commits
mailing list