This is an archive of the discontinued LLVM Phabricator instance.

[RegisterScavenging] Fix assert in scavengeRegisterBackwards
ClosedPublic

Authored by craigblackmore on Nov 25 2020, 8:02 AM.

Details

Summary

According to the documentation, if a spill is required to make a
register available and AllowSpill is false, then NoRegister should be
returned, however, this scenario was actually triggering an assertion
failure.

This patch moves the assertion after the handling of AllowSpill.

Authored by: Lewis Revill

Diff Detail

Event Timeline

craigblackmore created this revision.Nov 25 2020, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 25 2020, 8:02 AM
craigblackmore requested review of this revision.Nov 25 2020, 8:02 AM
arsenm added inline comments.Nov 30 2020, 7:16 AM
llvm/lib/CodeGen/RegisterScavenging.cpp
578–579

This debug message is going to be misleading since the scavenging failed

I have updated the patch so that Scavenged free register: will not be printed if no register is found.

craigblackmore added inline comments.Dec 11 2020, 9:34 AM
llvm/lib/CodeGen/RegisterScavenging.cpp
578–579

Thanks, I've pushed an update to fix this.

arsenm accepted this revision.Dec 12 2020, 6:49 AM
This revision is now accepted and ready to land.Dec 12 2020, 6:49 AM