[llvm-commits] [llvm] r164850 - /llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
Evan Cheng
evan.cheng at apple.com
Fri Sep 28 17:14:27 PDT 2012
It's not really a phase ordering issue per say. But I don't see a better place for it. Committed as r164867.
Evan
On Sep 28, 2012, at 2:32 PM, Chandler Carruth <chandlerc at google.com> wrote:
> On Fri, Sep 28, 2012 at 2:23 PM, Evan Cheng <evan.cheng at apple.com> wrote:
> Author: evancheng
> Date: Fri Sep 28 16:23:26 2012
> New Revision: 164850
>
> URL: http://llvm.org/viewvc/llvm-project?rev=164850&view=rev
> Log:
> GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://9142819
>
> Could you add a test case that shows the phase ordering problem and is fixed by this? I'm thinking something similar to those tests in test/Transforms/PhaseOrdering. We might already have tests that can just have their "-O3" switched to "-O2" or "-Os", but I'd like to have a test that fails if we ever mess this up in the future...
>
>
> Modified:
> llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
>
> Modified: llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp?rev=164850&r1=164849&r2=164850&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/PassManagerBuilder.cpp Fri Sep 28 16:23:26 2012
> @@ -211,13 +211,12 @@
> // FIXME: We shouldn't bother with this anymore.
> MPM.add(createStripDeadPrototypesPass()); // Get rid of dead prototypes
>
> - // GlobalOpt already deletes dead functions and globals, at -O3 try a
> + // GlobalOpt already deletes dead functions and globals, at -O2 try a
> // late pass of GlobalDCE. It is capable of deleting dead cycles.
> - if (OptLevel > 2)
> + if (OptLevel > 1) {
> MPM.add(createGlobalDCEPass()); // Remove dead fns and globals.
> -
> - if (OptLevel > 1)
> MPM.add(createConstantMergePass()); // Merge dup global constants
> + }
> }
> addExtensionsToPM(EP_OptimizerLast, MPM);
> }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120928/3a6e945a/attachment.html>
More information about the llvm-commits
mailing list