This is a very preliminary proposal to introduce a message table that would let us replace hard-coded strings with an identifier. The basic idea is that instead of something like this:
ORE->emit([&]() {
return OptimizationRemark(DEBUG_TYPE, "LoadElim", LI)
<< "load of type " << NV("Type", LI->getType()) << " eliminated"
<< setExtraArgs() << " in favor of "
<< NV("InfavorOfValue", AvailableValue);
});We'd be able to have something like this:
ORE->emit([&]() {
return OptimizationRemark(DEBUG_TYPE, diag::remark_gvn_load_elim, LI)
<< NV("Type", LI->getType())
<< setExtraArgs() << NV("InfavorOfValue", AvailableValue);
});I think this opens up a lot of possibilities for more compact storage of remarks and more reliable identification of remarks in the DiagHandler. It also brings up a lot of questions about how much of the information that is currently part of the OptimizationRemark class (and its siblings) should be part of the message table. I hope to discuss that in this review.
I think a few places call this "Passed". Would that be better than "General"?