[PATCH] D79870: [RISCV] Add matching of codegen patterns to RISCV Bit Manipulation Zbb asm instructions

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 06:51:46 PDT 2020


lewis-revill added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:173
+
+bool RISCVDAGToDAGISel::SelectSLOI(SDValue N, SDValue &RS1, SDValue &Shamt) {
+  MVT XLenVT = Subtarget->getXLenVT();
----------------
Indentation within these Select functions is messed up, presumably due to a mix of tabs and spaces.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp:262
+bool RISCVDAGToDAGISel::SelectSLOIW(SDValue N, SDValue &RS1, SDValue &Shamt) {
+  if (N.getOpcode() == ISD::SIGN_EXTEND_INREG &&
+      cast<VTSDNode>(N.getOperand(1))->getVT() == MVT::i32) {
----------------
I'm not sure the convention other select functions for W instructions follow but perhaps an assert for IsRV64 should be added for completeness?


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoB.td:641
+def SROIPat  : ComplexPattern<XLenVT, 2, "SelectSROI", [or]>;
+def SLOIWPat  : ComplexPattern<XLenVT, 2, "SelectSLOIW", [sext_inreg]>;
+def SROIWPat  : ComplexPattern<XLenVT, 2, "SelectSROIW", [or]>;
----------------
Can these W selects be guarded for 64 bit only?


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

https://reviews.llvm.org/D79870





More information about the llvm-commits mailing list