[LLVMdev] RFC - Adding an optimization report facility?

Xinliang David Li xinliangli at gmail.com
Thu Mar 6 13:45:29 PST 2014


On Thu, Mar 6, 2014 at 1:32 PM, Diego Novillo <dnovillo at google.com> wrote:

>
>
>
> On Thu, Mar 6, 2014 at 4:29 PM, Xinliang David Li <xinliangli at gmail.com>wrote:
>
>>
>>
>>
>> On Thu, Mar 6, 2014 at 12:22 PM, Diego Novillo <dnovillo at google.com>wrote:
>>
>>> On Thu, Mar 6, 2014 at 2:44 PM, Tobias Grosser <tobias at grosser.es>wrote:
>>>
>>> as others already pointed out, I committed the first piece of such an
>>>> infrastructure in LLVM commit 202474 and clang commit 202475. This is
>>>> mostly the backend and printing infrastructure.
>>>>
>>>
>>>
>>> Thanks, Tobias.  I've browsed the two patches and I think they're going
>>> to be exactly what I need. IIUC, the patches add two new LLVM instructions
>>> remark and note. These are inserted in the IL by the passes and the
>>> compiler emits them as diagnostic if the right -W flag is enabled?
>>>
>>> One question I have from the Clang patch. If I compile with
>>> -Weverything, will this enable all warnings *and* remarks? In this context,
>>> I only want to enable all remarks.  In fact, I want to enable a family of
>>> remarks: the optimization remarks.
>>>
>>> There will be other modifiers to these remarks as well:
>>>
>>>
>>>    1. Report *missed* optimizations, instead of the successful ones.
>>>    2. Increase verbosity of the report. This would be done using note
>>>    nodes, I expect. But we may want varying degrees of verbosity.
>>>    3. Group families of optimizations. For example, i want to report on
>>>    all loop-related optimizations.
>>>    4. IIRC, GCC's -fopt-info will also allow you to collect the reports
>>>    into a separate text file. Not sure how useful I find this feature myself.
>>>
>>>
>> Re. 4, to name a few that can be handy sometimes: 1) not contaminate
>> stderr; 2) per TU report; 3) Per opt-group report etc.
>>
>
> Ah, thanks.  The stderr and per-tu report thing is handy.  Your #3 seems
> similar to my #3 (group families of optimizations).
>

for 3), I mean you can redirect optimization report in this way:

$COMPILER  -fopt-info-loop=a.c.loop.report -fopt-info-vect=a.c.vect.report
   ... -c a.c

David

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


More information about the llvm-dev mailing list