[LLVMdev] RFC - Adding an optimization report facility?

Diego Novillo dnovillo at google.com
Fri Mar 7 06:04:16 PST 2014


On Thu, Mar 6, 2014 at 6:54 PM, Chris Lattner <clattner at apple.com> wrote:

>
> This is a great idea, and many people would welcome it.  Please write up a
> concrete proposals about how this will work, and we can iterate on that
> though.
>

Yup, working on one. Will send it out in the coming days.


My intent is to introduce an optimization report option to LLVM which
> passes will be able to use to indicate the major decisions they make.
> Initially, I am tempted to mimic GCC's -fopt-info (
> http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html#index-fopt-info-747
> ).
>
>
> I'm not sure if this is the best design or not (having never used it) -
> what feedback have you heard from (non-compiler-hacker) people trying to
> use it?
>

Used heavily in our optimization team. It's no altogether different from
what I've seen in other compilers in the past. I don't intend to mimic the
complete UI, I only want to convey the same information.


IMO, the hard part of doing something like this is getting the user
> experience right.  It does you no good to say "hey I unrolled a loop" if
> you don't have enough location information to tell the user *which* loop
> got unrolled.  The key is to give them actionable information, not just the
> output of -debug :-)
>

Absolutely.  Every note must always be emitted with location information on
the instruction that generates it. In GCC, the compiler keeps track of
source LOCs at all times.  But in Clang, we will want to turn on
-gline-tables-only when reports are requested.

The UI is based exclusively on source LOCs.  We want to preserve the exact
same formatting used for warnings/errors so that we can feed these notices
back to editors, IDEs, etc.


Diego.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140307/71a623c7/attachment.html>


More information about the llvm-dev mailing list