This is an archive of the discontinued LLVM Phabricator instance.

MIR: Freeze reserved regs after parsing everything
ClosedPublic

Authored by arsenm on Mar 26 2019, 4:22 PM.

Details

Reviewers
thegameg
Summary

The AMDGPU implementation of getReservedRegs depends on
MachineFunctionInfo fields that are parsed from the YAML section. This
was reserving the wrong register since it was setting the reserved
regs before parsing the correct one.

Some tests were relying on the default reserved set for the assumed
default calling convention.

Diff Detail

Event Timeline

arsenm created this revision.Mar 26 2019, 4:22 PM
thegameg accepted this revision.Mar 26 2019, 6:46 PM

This LGTM with one comment.

Also I'm not sure if there is a way to avoid this kind of bugs in the future but maybe we want to at least make sure MFI is not depending on parsing the other bits.

lib/CodeGen/MIRParser/MIRParser.cpp
430

Can you add a comment on why this needs to be set after parsing the MFI?

This revision is now accepted and ready to land.Mar 26 2019, 6:46 PM
arsenm closed this revision.Mar 27 2019, 9:11 AM
arsenm marked an inline comment as done.

r357083