The register bank is now entirely initialized in the constructor. However,
we still have the hardcoded number of register classes which will be
dealt with in the TableGen patch (D27338) since we do not have access
to this information to resolve this at this stage. The number of register
classes is known to the TRI and to TableGen but the RegisterBank
constructor is too early for the former and too late for the latter.
This will be fixed when the data is tablegen-erated.
Details
Diff Detail
- Build Status
Buildable 2849 Build 2849: arc lint + arc unit
Event Timeline
LGTM with microscopic nits.
include/llvm/CodeGen/GlobalISel/RegisterBank.h | ||
---|---|---|
46 | It's probably worthwhile to add the comment explaining why this is necessary here (instead of only in the commit message). | |
lib/CodeGen/GlobalISel/RegisterBank.cpp | ||
25 | Incomplete comment :) | |
lib/Target/AArch64/AArch64RegisterBankInfo.cpp | ||
45 | I think you should move the asserts checking that getRegBank returns the expected banks before this loop (I can see how this will make the loop a bit more "buried", but it seems like the proper thing to do). |
Fix incomplete comment.
Add comment about finishInit()
Check getRegBank() works before relying on it to finish initialisation().
lib/CodeGen/GlobalISel/RegisterBank.cpp | ||
---|---|---|
30 | We shouldn't need the TRI to do that. Indeed, eventually, TableGen shouldn't need this method, otherwise we missed something. That should be automatic as I expect something like this in the XXXRegisterBank.td:include XXXRegisterInfo.td def MyBank : RegisterBank<(list of register classes)> |
Rebased onto new D27808.
Finished moving to TargetRegisterClass initialization style.
RegisterBanks are now expected to be valid immediately after construction and
finishInit() is no longer needed.
It's probably worthwhile to add the comment explaining why this is necessary here (instead of only in the commit message).