From d83284c19680927af836af5e7fc71469ef7ec596 Mon Sep 17 00:00:00 2001 From: Andrew Trick Date: Wed, 15 Feb 2012 05:13:47 +0000 Subject: [PATCH] Move PostRAMachineLICM into MachineLateOptimization. It now runs after PEI! llvm-svn: 150565 --- llvm/lib/CodeGen/Passes.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/lib/CodeGen/Passes.cpp b/llvm/lib/CodeGen/Passes.cpp index ec1f2b4c3b23..977ecaa7ecee 100644 --- a/llvm/lib/CodeGen/Passes.cpp +++ b/llvm/lib/CodeGen/Passes.cpp @@ -582,14 +582,8 @@ void TargetPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) { // // FIXME: Re-enable coloring with register when it's capable of adding // kill markers. - addPass(StackSlotColoringID); - - // Run post-ra machine LICM to hoist reloads / remats. - // - // FIXME: can this move into MachineLateOptimization? - addPass(PostRAMachineLICMID); - - printAndVerify("After StackSlotColoring and postra Machine LICM"); + if (addPass(StackSlotColoringID) != &NoPaddID) + printAndVerify("After StackSlotColoring"); } //===---------------------------------------------------------------------===// @@ -598,6 +592,10 @@ void TargetPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) { /// Add passes that optimize machine instructions after register allocation. void TargetPassConfig::addMachineLateOptimization() { + // Run post-ra machine LICM to hoist reloads / remats. + if (addPass(PostRAMachineLICMID) != &NoPassID) + printAndVerify("After postra Machine LICM"); + // Branch folding must be run after regalloc and prolog/epilog insertion. if (addPass(BranchFolderPassID) != &NoPassID) printNoVerify("After BranchFolding");