Since we are in the area, what *should* O1 do? It's basically good for nothing, since it doesn't tune for size or performance. The only good I personally ever have for it is once in a while there is a miscompile at -O1 which narrows the problem. Would it be crazy to make -O1 equivalent to -Os? - Daniel On Wednesday, September 16, 2009, Chris Lattner <clattner at apple.com> wrote:> > On Sep 16, 2009, at 10:05 AM, Stefano Delli Ponti wrote: > >> Chris Lattner: >>> Comparing -O3 (and even -O4) is interesting, but we want all >>> optimization levels to perform better than GCC :). Lots of people >>> use -O2 and -Os, so comparing against other compiler's -O2 and -Os >>> levels is just as interesting as comparing -O3 vs -O3. >> >> My thinking was that, for instance, -02 for GCC and -02 for LLVM(- >> GCC) do not necessarily mean the same thing, they may be not / >> commensurable/. >> But perhaps, my ignorance, you are saying that they _are_, that LLVM >> assigns the same types of optimizations as GCC to the different >> levels. > > Right, we want them to be roughly comparable. > > O0 -> best debug experience, fastest compile times. > O2 -> optimize without bloating the code too much and without burning > *too* many cycles. > O3 -> take more time and produce fatter code to get faster code. > > O1 is something of a wasteland with no clear purpose :) > > -Chris > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Eric Christopher
2009-Sep-16 17:52 UTC
[LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks
On Sep 16, 2009, at 10:36 AM, Daniel Dunbar wrote:> Since we are in the area, what *should* O1 do? > > It's basically good for nothing, since it doesn't tune for size or > performance. The only good I personally ever have for it is once in a > while there is a miscompile at -O1 which narrows the problem. > > Would it be crazy to make -O1 equivalent to -Os?I've always used O1 for a quick cleanup so that my debug code doesn't completely suck, but hasn't been optimized into oblivion for gdb. Also makes looking at the resultant assembly dumps fairly easy. But yes, that'd be crazy :) -eric
Daniel Dunbar <daniel at zuster.org> writes:> Since we are in the area, what *should* O1 do?"Try to produce fast code but do not apply transformations that makes debugging hard" -- Óscar
On Sep 16, 2009, at 10:36 AM, Daniel Dunbar wrote:> Since we are in the area, what *should* O1 do? > > It's basically good for nothing, since it doesn't tune for size or > performance. The only good I personally ever have for it is once in a > while there is a miscompile at -O1 which narrows the problem. > > Would it be crazy to make -O1 equivalent to -Os?That works for me! :-)
2009/9/16 Eric Christopher <echristo at apple.com>:> Also makes looking at the resultant assembly dumps fairly easy. > > But yes, that'd be crazy :)My father prefers that to writing assembly code directly. Seems like a pretty normal thing to do... Crazy is producing assembly directly, which he still does most of the time... ;) cheers, --renato Reclaim your digital rights, eliminate DRM, learn more at http://www.defectivebydesign.org/what_is_drm
On Wed, Sep 16, 2009 at 10:52 AM, Eric Christopher <echristo at apple.com> wrote:> On Sep 16, 2009, at 10:36 AM, Daniel Dunbar wrote: >> Since we are in the area, what *should* O1 do? >> >> It's basically good for nothing, since it doesn't tune for size or >> performance. The only good I personally ever have for it is once in a >> while there is a miscompile at -O1 which narrows the problem. >> >> Would it be crazy to make -O1 equivalent to -Os? > > I've always used O1 for a quick cleanup so that my debug code doesn't > completely suck, but hasn't been optimized into oblivion for gdb. Also > makes looking at the resultant assembly dumps fairly easy.If this is from the compiler programmer perspective, we have better tools for that. If this is from the user perspective, currently they all are bad with LLVM for the former, and we should similarly fix all of them. :)> But yes, that'd be crazy :)Was that a -1 on doing it, though? :) - Daniel
Apparently Analagous Threads
- [LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks
- [LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks
- [LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks
- [LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks
- [LLVMdev] FYI: Phoronix GCC vs. LLVM-GCC benchmarks