This is an archive of the discontinued LLVM Phabricator instance.

(Reland) [fastalloc] Support allocating specific register class in fastalloc
ClosedPublic

Authored by LuoYuanke on Aug 12 2022, 8:45 PM.

Details

Summary

Reland commit 719658d078c4

The base RA support infrastructure that only allow a specific register
class be allocated in RA pss. Since greedy RA, basic RA derived from
base RA, they all allow allocating specific register class. Fast RA
doesn't support allocating register for specific register class. This
patch is to enable ShouldAllocateClass in fast RA, so that it can
support allocating register for specific register class.

Diff Detail

Event Timeline

LuoYuanke created this revision.Aug 12 2022, 8:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 8:45 PM
LuoYuanke requested review of this revision.Aug 12 2022, 8:45 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 8:45 PM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 12 2022, 11:20 PM
This revision was automatically updated to reflect the committed changes.

@LuoYuanke This appears to be causing a AMDGPU test to fail on EXPENSIVE_CHECKS builds : https://github.com/llvm/llvm-project/issues/57149

LuoYuanke added a comment.EditedAug 15 2022, 4:37 AM

@LuoYuanke This appears to be causing a AMDGPU test to fail on EXPENSIVE_CHECKS builds : https://github.com/llvm/llvm-project/issues/57149

Yes. The root cause is related to "si-lower-sgpr-spills". With fast register allocation, LIS = getAnalysisIfAvailable<LiveIntervals>(); get nullptr, so the slot index is not created in the pass for new inserted instructions. When verifying the machine intruction, it fails on checking slot index. It can also be reproduced without my patch. However when I change the test to greedy, the test case runs very slowly. I would revert my patch first and file an issue the test case.

Revert the patch in 853bb192c407f.

foad added a subscriber: foad.Aug 19 2022, 2:04 AM