[PATCH] Adding a timing option for IR parsing

Andrew Trick atrick at apple.com
Fri Mar 22 10:47:16 PDT 2013


On Mar 22, 2013, at 9:14 AM, Eli Bendersky <eliben at google.com> wrote:

> 
> On Thu, Mar 21, 2013 at 7:24 PM, Chandler Carruth <chandlerc at google.com> wrote:
> FYI, I reverted the patch in r177695 to fix our builds. We check that layering violations don't get any worse in our build system.
> 
> Can you explain what kind of build this breaks?
> 
> I understand the layering problem, but how do we still get to measure the time IR parsing took? Do you have plans to fix the IR Reader violation any time soon?

To answer your middle question. Just reuse -time-passes and expose the flag in LLVMContext.

On the last question, I would like to see an answer to Chandler's question about whether anyone cares if they now automatically link the IR parser. Maybe Chandler should re-ask on llvm-dev?

-Andy

> A temporary workaround would be to just add the measurement flag to llc.cpp - would anyone see a problem with that?
> 
> Eli
> 
> 
> 
>  
> Fundamentally, the existing layering problem is "worked around" but there being no implementation. As long as thats true, all the Support library is providing is a text header file. As long as it is only included into source files that are part of a library which will eventually get linked with the core library, the AsmParser library, and the BitcodeReader library, all is well. Including it into a source file in Support makes the layering violation actively worse.
> 
> I think the correct solution is to do one of two things:
> 
> 1) Create a new library which depends on both AsmParser and BitcodeReader and which can be used by opt and friends. Put IRReader here.
> 2) Fold AsmParser into the IR library (where AsmWriter already lives). Put IRReader into the BitcodeReader library.
> 
> I thought about a third option: put both AsmParser and IRReader into the BitcodeReader library. But increasingly that seems like a really gross layering.
> 
> -Chandler
> 
> 
> On Wed, Mar 20, 2013 at 9:59 PM, Chandler Carruth <chandlerc at google.com> wrote:
> 
> On Wed, Mar 20, 2013 at 8:23 PM, Andrew Trick <atrick at apple.com> wrote:
> I don't pretend to understand the layering rules. But how can someone use IRReader without linking LLVMCore? I'm not even sure why IRReader is in Support given that it needs a context.
> 
> IRReader is the layering violation. We should fix that, and then this becomes a non-problem.
> 
> And yea, I think putting the flag in the context makes a lot of sense.
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130322/40ce2b2b/attachment.html>


More information about the llvm-commits mailing list