This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Support multiple MachineFunctions
ClosedPublic

Authored by arsenm on Apr 19 2022, 8:42 AM.

Details

Summary

The current testcase I'm trying to reduce only reproduces with IPRA
enabled and requires handling multiple functions.

The only real difference vs. the IR is the extra indirect to look for
the underlying MachineFunction, so treat the ReduceWorkItem as the
module instead of the function.

The ugliest piece of this is really the ugliness of
MachineModuleInfo. It not only tracks actual module state, but has a
number of transient fields used for isel and/or the asm printer. These
shouldn't do any harm for the use here, though they should be
separated out.

Diff Detail

Event Timeline

arsenm created this revision.Apr 19 2022, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 8:42 AM
arsenm requested review of this revision.Apr 19 2022, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 8:42 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm updated this revision to Diff 423795.Apr 19 2022, 7:48 PM

Fix creating new functions with wrong MMI

Looks fine to me though someone with better insight into MMI could probably provide better feedback.

MatzeB accepted this revision.Apr 26 2022, 9:10 PM

Looks fine to me though someone with better insight into MMI could probably provide better feedback.

Don't be afraid and press the accept button ;-) I know it's always a balancing act but it feels to me that newcomers tend to be too cautious... Given that this seems to be a less critical component of LLVM. (Speaking as a person who has way too many reviews in his phabricator list...).

Anyway this change LGTM.

llvm/tools/llvm-reduce/deltas/ReduceInstructionsMIR.cpp
132

avoid auto?

This revision is now accepted and ready to land.Apr 26 2022, 9:10 PM