This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] isPassEnabled() helper to check cl::opt and OptLevel
ClosedPublic

Authored by rampitec on Jul 6 2021, 4:16 PM.

Details

Summary

We have several checks for both cl::opt and OptLevel over our
pass config, although these checks do not properly work if
default value of a cl::opt will be false. Create a helper to
use instead and properly handle it. NFC for now.

Diff Detail

Event Timeline

rampitec created this revision.Jul 6 2021, 4:16 PM
rampitec requested review of this revision.Jul 6 2021, 4:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 4:16 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added inline comments.Jul 6 2021, 4:28 PM
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
789

Should add a documentation comment

790

Don't see the point of the parameter if it's never used

967

Not passing CodeGenOpt::Less?

rampitec added inline comments.Jul 6 2021, 4:33 PM
llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
790

I want to clean -O0 pipeline some more, so I will pass CodeGenOpt::Less there. Right now all such checks are done to distinguish between -O1 and -O2/-O3, so it is unused for a moment.

967

Nope, default is CodeGenOpt::Default, which means >= Default, same as > Less.

rampitec updated this revision to Diff 356834.Jul 6 2021, 4:38 PM
rampitec marked an inline comment as done.

Added documentation comment.

arsenm accepted this revision.Jul 6 2021, 6:27 PM
This revision is now accepted and ready to land.Jul 6 2021, 6:27 PM