[PATCH] D76051: [RISCV][GlobalISel] Select register banks for GPR ALU instructions

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 18 16:05:03 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVRegisterBankInfo.cpp:123
+    LLT Ty = MRI.getType(MI.getOperand(0).getReg());
+    OperandsMapping =
+        getOperandsMapping({getGPRValueMapping(Ty.getSizeInBits()), nullptr});
----------------
nitinjohnraj wrote:
> Should we consider adding new entries to ValueMappings so that we don't create this array locally? All the binary operations above don't create local arrays for this (though they could).
This implementation is consistent with ARM, AArch64, and Mips. I don't think it is possible to put a nullptr entry in the table. It needs to be a null `RegisterBankInfo::ValueMapping*` but the table row is an array of `RegisterBankInfo::ValueMapping`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76051



More information about the llvm-commits mailing list