[PATCH] D72425: [OptRemark] RFC: Introduce a message table for OptRemarks

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 17:29:14 PST 2020


thegameg added a comment.

In D72425#1811150 <https://reviews.llvm.org/D72425#1811150>, @andrew.w.kaylor wrote:

> In D72425#1811118 <https://reviews.llvm.org/D72425#1811118>, @anemet wrote:
>
> > As Francis mentioned it before it would be good derive the pass name from the remark type (diag::remark_gvn_load_elim -> gvn) .  I.e. I would drop the DEBUG_TYPE argument.
>
>
> This is one of the things that I thought could be a field in the OptRemark class. I think it makes sense to have this kind of property tightly coupled with the message. Francis mentioned a potential problem with keeping that synchronized with where the remarks are emitted, but I think if we think of it in terms of a category of optimization rather than a pass name that isn't a problem, because the nature of the optimization being described won't change even if, for example, you move it from InstCombine to AggressiveInstCombine. Or perhaps I'm introducing a second concept here. There's a bit of a disconnect between compiler developers who want to use this feature and compiler users who want to use the feature. The latter group is probably more interested in being able to say, for example, show me all remarks related to loop optimization rather than show me remarks from the loop rotate pass.


I think making a distinction here is actually a good idea. We could make `foptimization-record-passes` allow such groups as well (or add another flag for groups specifically).

Adding it in the same way as the `Group<...>` in include/clang/Driver/Options.td would be great:

  def fsave_optimization_record : Flag<["-"], "fsave-optimization-record">,
    Group<f_Group>, HelpText<"Generate a YAML optimization record file">;



> It also occurs to me that we could move the Optimization/Missed/Analysis hierarchy into this table.

That would also be great.



================
Comment at: llvm/utils/TableGen/OptRemarkDiagEmitter.cpp:1
+//===- OptEmitter.cpp - Helper for emitting options.----------- -----------===//
+//
----------------
OptRemarkDiagEmitter.cpp


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72425/new/

https://reviews.llvm.org/D72425





More information about the llvm-commits mailing list