[PATCH] Add target analysis passes to the codegen pipeline for MCJIT

Juergen Ributzka juergen at apple.com
Wed Jan 22 11:51:00 PST 2014


Hi Andy,

yes, it could be gated by the optimization level, but I wouldn’t do it for this primitive analysis passes for several reasons:

- They only provide better answers to target hooks like the cost of an immediate, instructions, etc. The overhead of calling into NoTTI or Basic is pretty much the same as i.e. into the X86TTI.
  I would’t worry about these passes at all when it comes to compile time.

- Consistency - all other tools include these passes unconditionally. If the JIT does something different here it might lead to unexpected results.

- Don’t blame the cheap analysis - shot the expensive transformation pass instead ;-) I did a quick scan of the passes that depend during codegen on TargetTransformInfo and the heaviest users are LSR and SCEV. They are already gated by the optimization level, so they shouldn’t be a problem. The other user is SelectionDAG and that is just a very simple query, where I don’t see any noteworthy overhead.

I don’t think we have to worry about compile time overhead if we add add the target-specific TargetTransformInfo pass by default.

Cheers,
Juergen

On Jan 22, 2014, at 9:25 AM, Kaylor, Andrew <andrew.kaylor at intel.com> wrote:

> Is it possible to turn those passes off based on optimization level?
>  
> My concern is that a lot of MCJIT users are much more concerned about compilation time than they are about optimization.  At some point MCJIT should probably provide a finer grained control over what does and does not happen.  Right now I think setting the optimization level is the closest we come to that.
>  
> -Andy
>  
>  
> From: Juergen Ributzka [mailto:juergen at apple.com] 
> Sent: Tuesday, January 21, 2014 6:53 PM
> To: Kaylor, Andrew
> Cc: LLVM Commits
> Subject: Re: [PATCH] Add target analysis passes to the codegen pipeline for MCJIT
>  
> The only passes targets placed so far into “addAnalysisPasses” are the target specific TargetTransformInfo passes. They only provide more accurate answers to target hooks and cost models. Of course this might lead to different code paths taken by optimization passes that depend on it, but I don’t know what the actual overhead of that is. 
>  
> On Jan 21, 2014, at 4:47 PM, Kaylor, Andrew <andrew.kaylor at intel.com> wrote:
> 
> 
> What’s the impact of these passes on compile time?
>  
> From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Juergen Ributzka
> Sent: Tuesday, January 21, 2014 10:30 AM
> To: LLVM Commits
> Subject: [PATCH] Add target analysis passes to the codegen pipeline for MCJIT
>  
> Hi @ll,
> 
> for some reason we forgot to add the target specific analysis passes to the codgen pipeline of MCJIT. All other tools (llc, etc) use these passes and so should MCJIT.
> 
> This patch adds the missing passes to the codegen pipeline. It also exposes the AddAnalysisPasses method through the C API, because the optimizer passes could also benefit from it.
> 
> Cheers,
> Juergen
> 
> 
> 
> 
> 
> _______________________________________________
> 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/20140122/4ec9fd35/attachment.html>


More information about the llvm-commits mailing list