diff options
author | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-01-26 16:49:08 +0000 |
---|---|---|
committer | Stanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com> | 2017-01-26 16:49:08 +0000 |
commit | be4948cead3feacba31e66a3c4c14846abf76eb0 (patch) | |
tree | 07b8662c7e30510a4b3d963da12424546145dd00 /tools/opt | |
parent | d9031ef908317e4f2303ea474efb53441aff2c29 (diff) |
Replace addEarlyAsPossiblePasses callback with adjustPassManager
This change introduces adjustPassManager target callback giving a
target an opportunity to tweak PassManagerBuilder before pass
managers are populated.
This generalizes and replaces addEarlyAsPossiblePasses target
callback. In particular that can be used to add custom passes to
extension points other than EP_EarlyAsPossible.
Differential Revision: https://reviews.llvm.org/D28336
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt')
-rw-r--r-- | tools/opt/opt.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp index a93c06c1d13..d5c74eef700 100644 --- a/tools/opt/opt.cpp +++ b/tools/opt/opt.cpp @@ -287,13 +287,8 @@ static void AddOptimizationPasses(legacy::PassManagerBase &MPM, Builder.SLPVectorize = DisableSLPVectorization ? false : OptLevel > 1 && SizeLevel < 2; - // Add target-specific passes that need to run as early as possible. if (TM) - Builder.addExtension( - PassManagerBuilder::EP_EarlyAsPossible, - [&](const PassManagerBuilder &, legacy::PassManagerBase &PM) { - TM->addEarlyAsPossiblePasses(PM); - }); + TM->adjustPassManager(Builder); if (Coroutines) addCoroutinePassesToExtensionPoints(Builder); |