llvmlite icon indicating copy to clipboard operation
llvmlite copied to clipboard

[WIP] Add support for optimization remarks in pass managers.

Open sklam opened this issue 6 years ago • 6 comments

This enables optimization passes to write diagnostic remarks to a YAML file. The remarks contains info about applied optimizations and missed opportunities with references to the source file if source location (debug info) is present.

The added feature is localized to pass managers. The .run() method of module and function pass-managers takes a new optional argument remarks_file for the filepath where the remark info will be stored. The feature is disabled if remarks_file is None (the default).

Related read: https://llvm.org/devmtg/2016-11/Slides/Nemet-Compiler-assistedPerformanceAnalysis.pdf

sklam avatar Mar 13 '18 20:03 sklam

Coverage Status

Coverage increased (+0.05%) to 93.553% when pulling 2dc6bf5c5d77e723208b2fc09e48bd05bf6690ee on sklam:enh/optremark into 46b4b5e288f3a175332ad68d8c3745c63fbb5701 on numba:master.

coveralls avatar Mar 13 '18 21:03 coveralls

Why a file and not a string?

whitequark avatar Mar 29 '18 10:03 whitequark

Why a file and not a string?

Right, I agree. It's better to have a string. The current implementation is based on some code I found in LLVM. I need to see if I can make the opt-remarks print to a string instead.

sklam avatar Apr 05 '18 17:04 sklam

What's the status on this? I've built something similar which works with the current version, should I open a PR?

alendit avatar Nov 22 '18 11:11 alendit

I'm spending some time going through the llvmlite PR backlog - this PR seems to be one that's been stuck for a while.

@sklam Do you think that you're likely to pick this up again?

@alendit If you still have something similar which works with the current version, opening a PR to replace this one would be great - it may well be easier for us to make further progress if you have something already working and ready-to-go (as I know that @sklam has many other Numba and llvmlite-related tasks at hand that push this down the priority list).

gmarkall avatar Dec 20 '21 15:12 gmarkall

sorry, i won't have time to finish this up

sklam avatar Feb 10 '22 17:02 sklam

Closing as #837 implemented the feature based on this PR. Thanks all!

stuartarchibald avatar Sep 06 '22 13:09 stuartarchibald