[PATCH] D66752: [RISCV] Implement RISCVRegisterInfo::getPointerRegClass

Luís Marques via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 10:20:09 PDT 2019


luismarques created this revision.
luismarques added reviewers: asb, lenary, reshabh.
Herald added subscribers: llvm-commits, pzheng, s.egerton, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, MaskRay, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: LLVM.

`TargetRegisterInfo::getPointerRegClass` is used, directly and indirectly, by several passes and CodeGen so it should be implemented (overridden) for RISC-V too.

@reshabh This will probably affect your GSoC work implementing 64-bit pointers on RV32. Not sure what the status of that is and how you want to proceed, but I imagine you'll just tweak this method once this patch is committed?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D66752

Files:
  llvm/lib/Target/RISCV/RISCVRegisterInfo.h


Index: llvm/lib/Target/RISCV/RISCVRegisterInfo.h
===================================================================
--- llvm/lib/Target/RISCV/RISCVRegisterInfo.h
+++ llvm/lib/Target/RISCV/RISCVRegisterInfo.h
@@ -52,6 +52,12 @@
   bool trackLivenessAfterRegAlloc(const MachineFunction &) const override {
     return true;
   }
+
+  const TargetRegisterClass *
+  getPointerRegClass(const MachineFunction &MF,
+                     unsigned Kind = 0) const override {
+    return &RISCV::GPRRegClass;
+  }
 };
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66752.217185.patch
Type: text/x-patch
Size: 515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190826/d206cc81/attachment-0001.bin>


More information about the llvm-commits mailing list