This is an archive of the discontinued LLVM Phabricator instance.

[llvm-stress] Remove dependency to legacy pass manager
ClosedPublic

Authored by bjope on Sep 28 2022, 4:02 AM.

Details

Summary

This patch removes the dependency to the legacy pass manager when
building llvm-stress.

Instead of setting up a pass manager at all we just run verifyModule()
to check that the generated IR satisfies the verifier, and then
we use Module::print() to output the IR. No need to setup passes and
populating a pass manager since we aren't doing anything more fancy
than that.

Diff Detail

Event Timeline

bjope created this revision.Sep 28 2022, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2022, 4:02 AM
bjope requested review of this revision.Sep 28 2022, 4:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 28 2022, 4:02 AM
aeubanks added inline comments.Sep 28 2022, 8:53 AM
llvm/tools/llvm-stress/llvm-stress.cpp
766

can't we just WriteBitcodeToFile without a pass manager?

bjope planned changes to this revision.Sep 28 2022, 9:18 AM
bjope added inline comments.
llvm/tools/llvm-stress/llvm-stress.cpp
766

Oh, yes. Why didn't I go all the way like that. No need to create the PrintModulePass just to do the WriteBircodeToFile. It should be possible to just call that helper directly. I'll try to update the patch that way.

bjope updated this revision to Diff 463619.Sep 28 2022, 10:47 AM

Now using M->print() directly to output the IR.

aeubanks accepted this revision.Sep 28 2022, 10:48 AM

description needs updating, otherwise lgtm

This revision is now accepted and ready to land.Sep 28 2022, 10:48 AM
bjope edited the summary of this revision. (Show Details)Sep 28 2022, 11:23 PM
This revision was landed with ongoing or failed builds.Sep 28 2022, 11:25 PM
This revision was automatically updated to reflect the committed changes.