This is an archive of the discontinued LLVM Phabricator instance.

Add -pass-remarks flag to 'opt'.
ClosedPublic

Authored by dnovillo on Apr 4 2014, 11:37 AM.

Details

Reviewers
qcolombet
Summary

This adds support in 'opt' to filter pass remarks emitted by
optimization passes. A new flag -pass-remarks specifies which
passes should emit a diagnostic when LLVMContext::emitOptimizationRemark
is invoked.

This will allow the front end to simply pass along the regular
expression from its own -Rpass flag when launching the backend.

Depends on D3227.

Diff Detail

Event Timeline

dnovillo updated this revision to Unknown Object (????).Apr 4 2014, 12:25 PM
  • Make -pass-remarks additive when given multiple times.

    This implements the suggestion we discussed on IRC. To keep track of the patterns, I've had to introduce a separate string. Every pattern is added using parentheses and '|' to make sure that the sub-expressions are properly separated.
qcolombet accepted this revision.Apr 4 2014, 1:25 PM

Hi Diego,

The question I am about to ask may be beyond the scope of this patch but is the option setting thread safe?
The implication is do we have to do something special to access and modify:

  • OptimizationRemarkPattern.
  • OptimizationRemarkExpr.

Thanks,
-Quentin

lib/IR/LLVMContextImpl.cpp
53

Add = NULL.
I am a bit paranoid with default initializer.

dnovillo updated this revision to Unknown Object (????).Apr 4 2014, 2:15 PM
  • Initialize OptimizationRemarkPattern explicitly.
dnovillo closed this revision.Apr 11 2014, 3:05 PM