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

Kaylor, Andrew andrew.kaylor at intel.com
Wed Jan 22 13:41:19 PST 2014


OK.  Thanks for the extra explanation.  I just didn't want to have something I didn't understand added to MCJIT without at least asking about it. :-)

It sounds like this is all goodness.

-Andy

From: Juergen Ributzka [mailto:juergen at apple.com]
Sent: Wednesday, January 22, 2014 11:51 AM
To: Kaylor, Andrew
Cc: LLVM Commits
Subject: Re: [PATCH] Add target analysis passes to the codegen pipeline for MCJIT

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<mailto: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<mailto: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> [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<mailto: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/ef3e4a0e/attachment.html>


More information about the llvm-commits mailing list