[PATCH] D115861: [LoongArch 4/6] Add basic tablegen infra for LoongArch

WÁNG Xuěruì via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 7 01:00:38 PST 2022


xen0n added inline comments.


================
Comment at: llvm/lib/Target/LoongArch/LoongArchRegisterInfo.td:62
+  def R20 : LoongArchReg<20, "r20", ["t8"]>, DwarfRegNum<[20]>;
+  def R21 : LoongArchReg<21, "r21", ["r21"]>, DwarfRegNum<[21]>;
+  def R22 : LoongArchReg<22, "r22", ["fp"]>, DwarfRegNum<[22]>;
----------------
SixWeining wrote:
> xen0n wrote:
> > Is the "r21" alias needed, given it's identical to its canonical name?
> Right. This alias is unnecessary and I will remove it although other targets have similar usage, like the `CSKY`:
> 
> ```
>  78   def R26 : CSKYReg<26, "r26", ["r26"]>, DwarfRegNum<[26]>;
>  79   def R27 : CSKYReg<27, "r27", ["r27"]>, DwarfRegNum<[27]>;
> ```
Hmm, I wonder if `[""]` or `[]` is correct; perhaps this "duplication" is necessary for proper functioning after all, I'm not quite sure. Maybe others more familiar with tblgen could clarify this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115861/new/

https://reviews.llvm.org/D115861



More information about the llvm-commits mailing list