This is an archive of the discontinued LLVM Phabricator instance.

llvm-reduce: Preserve frame index values when cloning function
ClosedPublic

Authored by arsenm on Apr 18 2022, 7:10 AM.

Details

Summary

Previously the specific values used for fixed frame indexes was in
reverse order in the cloned function from the original, and a map was
used to adjust all frame indexes to the potentially new values. Insert
the fixed objects in reverse to avoid this. This simplifies other
code, since now we don't need to track down all frame indexes. This
will allow targets that store frame indexes in MachineFunctionInfo to
simply copy the values.

Note this isn't directly observable in the test since the resulting
MIR print/parse can shuffle the IDs around (in particular the final
serialization implicitly strips out dead objects).

Diff Detail

Event Timeline

arsenm created this revision.Apr 18 2022, 7:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 7:10 AM
Herald added a subscriber: arphaman. · View Herald Transcript
arsenm requested review of this revision.Apr 18 2022, 7:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 7:10 AM
Herald added a subscriber: wdng. · View Herald Transcript
markus accepted this revision.Apr 24 2022, 10:40 PM

In general I am not too familiar with the frame index stuff so I cannot really comment much on that besides that it looks reasonable. From the point of view of the guy who did the initial MIR support work for llvm-reduce it looks like a good improvement and a step in the right direction.

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