This is an archive of the discontinued LLVM Phabricator instance.

[StableHashing] Hash machine basic blocks and functions
ClosedPublic

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

Details

Summary

This adds very basic support for hashing MachineBasicBlock
and MachineFunction, for use in MachineFunctionPass to
detect passes that modify the MachineFunction wrongly.

Diff Detail

Event Timeline

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

You're missing a lot of little fields that a pass could potentially change. e.g. block/function alignment, stack objects etc.

foad added a comment.Feb 21 2022, 6:55 AM

You're missing a lot of little fields that a pass could potentially change. e.g. block/function alignment, stack objects etc.

Yes. The same is true of the IR level structural hashing that is used for the same purpose (D86589). I was hoping to start with something simple like this, and it can always be improved in the future.

You're missing a lot of little fields that a pass could potentially change. e.g. block/function alignment, stack objects etc.

Yes. The same is true of the IR level structural hashing that is used for the same purpose (D86589). I was hoping to start with something simple like this, and it can always be improved in the future.

Can you add a TODO for these sorts of things? I think it's too easy to not notice them here

foad updated this revision to Diff 410489.Feb 22 2022, 2:26 AM

Add TODOs.

arsenm accepted this revision.Feb 22 2022, 7:05 AM
This revision is now accepted and ready to land.Feb 22 2022, 7:05 AM
This revision was landed with ongoing or failed builds.Feb 22 2022, 9:41 AM
This revision was automatically updated to reflect the committed changes.