[PATCH] D27338: [globalisel] Tablegen-erate current Register Bank Information

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 08:47:02 PST 2016


dsanders added inline comments.


================
Comment at: lib/Target/AArch64/AArch64RegisterBankInfo.cpp:46
   AlreadyInit = true;
-  // Initialize the GPR bank.
-  createRegisterBank(AArch64::GPRRegBankID, "GPR");
-  // The GPR register bank is fully defined by all the registers in
-  // GR64all + its subclasses.
-  addRegBankCoverage(AArch64::GPRRegBankID, AArch64::GPR64allRegClassID, TRI);
+  initGeneratedInfo(TRI);
+// Now, the content.
----------------
dsanders wrote:
> ab wrote:
> > How about:
> > - introduce an intermediate class, 'AArch64GenRegisterBankInfo'
> > - make the RegBanks array a member
> > - replace initGeneratedInfo with the ctor
> > - remove the AlreadyInit logic
> > - consolidate the now-redundant GET_REGBANK_*IFACE* into a single GET_REGBANK_IMPLEMENTATION to avoid having everything in the header
> > 
> > WDYT?
> That makes sense to me.
> consolidate the now-redundant GET_REGBANK_*IFACE* into a single GET_REGBANK_IMPLEMENTATION to avoid having everything in the header

On thinking about it a bit more, this step doesn't quite work. We can't merge the declaration and implementation together without putting the implementation in the header. I'll keep the declaration of AArch64GenRegisterBankInfo and the implementation separate to avoid putting everything in the header.


https://reviews.llvm.org/D27338





More information about the llvm-commits mailing list