This is an archive of the discontinued LLVM Phabricator instance.

[LegacyPassManager] Move structural hashing into Pass classes. NFC.
ClosedPublic

Authored by foad on Feb 18 2022, 5:48 AM.

Details

Summary

Move structural hashing into virtual methods on Pass. This will
allow MachineFunctionPass to override the method to add hashing of
the MachineFunction.

Diff Detail

Event Timeline

foad created this revision.Feb 18 2022, 5:48 AM
foad requested review of this revision.Feb 18 2022, 5:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2022, 5:48 AM

MMMh, I don't understand how this helps for MachineFunctionPass etc?

foad added a comment.Feb 24 2022, 4:58 AM

MMMh, I don't understand how this helps for MachineFunctionPass etc?

See D120124. This allows MachineFunctionPass to hash the MachineFunction, which it gets from the MachineModuleInfo analysis pass, which is easy to do inside MachineFunction but would be hard to do in LegacyPassManager. (Unless I have completely misunderstood and there is an easy way to get the MachineFunction for a Function without using MachineModuleInfo?)

See D120124. This allows MachineFunctionPass to hash the MachineFunction, which it gets from the MachineModuleInfo analysis pass, which is easy to do inside MachineFunction but would be hard to do in LegacyPassManager. (Unless I have completely misunderstood and there is an easy way to get the MachineFunction for a Function without using MachineModuleInfo?)

Thanks for the pointer, I'll check that :-)

myhsu added a subscriber: myhsu.Feb 25 2022, 11:19 AM
nikic accepted this revision.Mar 17 2022, 2:08 AM

LGTM

This revision is now accepted and ready to land.Mar 17 2022, 2:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 2:08 AM
This revision was landed with ongoing or failed builds.Mar 17 2022, 2:51 AM
This revision was automatically updated to reflect the committed changes.