This is an archive of the discontinued LLVM Phabricator instance.

[RegisterClassInfo] Invalidate the register pressure set limit cache when reserved regs or callee saved regs change
ClosedPublic

Authored by craig.topper on Feb 13 2018, 8:03 PM.

Details

Summary

Currently we only invalidate the pressure set limit cached when the TargetRegisterInfo pointer changes. But as reserved regs and callee saved regs are used as part of calculating the limits we should invalidate when those change too.

I encountered this when reverting a patch from the 6.0 branch. One of the x86 test files had a function that used rbp as a frame pointer, making it reserved. It was followed by another function which didn't use rbp but had the same TRI so the pressure set limit cache was not invalidated. If i removed the function that used rbp as a frame pointer from the file, the remaining function then got a different register pressure limit for the GR16 pressure set. This caused the machine scheduler to change the scheduling for the function. This was an unexpected change from just deleting a function.

I don't have a test case for trunk because the particular x86 test case is different enough from the 6.0 branch to not be affected now.

Diff Detail

Event Timeline

craig.topper created this revision.Feb 13 2018, 8:03 PM
MatzeB accepted this revision.Feb 14 2018, 10:28 AM

LGTM

This revision is now accepted and ready to land.Feb 14 2018, 10:28 AM
This revision was automatically updated to reflect the committed changes.