New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a way for OptimizationRemarkEmitter::allowExtraAnalysis to check if (specific) remarks are enabled #31699
Comments
Moving the discussion from llvm-dev here. This was Vivek's question. Hi Adam, I looked into code related to above feature request and perhaps I am not yet clear about this.
However I am confused because there is one more class DiagnosticInfo in LLVM which handles same thing for opt's flags, but why those informations are not used in allowExtraAnalysis() ? Have I understood the purpose of allowExtraAnalysis or not ? Please guide here. Sincerely, |
Thanks for taking this on!
I think it will also need the remark kind (e.g. DK_OptRemarkAnalysis) unless we want to return all three in a structure. The latter may be useful since passes may want to cache these together in order to have zero-overhead checking to see whether the remarks are off.
I am assuming you were thinking of doing this to call isEnabled on the remark; unfortunately that does not work. (I know that is what WholeProgramDevirt does too.) isEnabled is not used in clang in llvm (opt/llc): https://github.com/llvm-mirror/clang/blob/master/lib/CodeGen/CodeGenAction.cpp#L598 I think that the new design should move isEnabled to the DiagnosticHandler in the context. DiagnosticHandler is only a callback now so it should probably become a class. Then clients can ask whether a kind of remark (OptRemark, OptRemarkMissed, OptRemarkAnalysis) is enabled for a pass specified by the pass name.
Yes.
As explained above. |
-Vivek
|
|
-mllvm options are for compiler development purposes only; they're not part of the user interface. Moreover, using command-line options to pass information between the frontend and the backend is highly discouraged. |
Work in progress patch is https://reviews.llvm.org/D33514 |
Vivek fixed this in r313382. Thanks Vivek! |
Extended Description
There is already a need for this. For example WholeProgramDevirt instantiates a remark just to check its Enabled field to see if remarks are on or not. This actually does not work because clang does not use the Enabled field only (opt's -pass-remarks* do).
Also GlobalISel wants to do something like this and it's currently using a cl::opt as a work-around.
The text was updated successfully, but these errors were encountered: