[PATCH] D76445: [RISCV][GlobalISel] Select ALU GPR instructions

Lewis Revill via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 05:32:01 PDT 2022


lewis-revill added inline comments.
Herald added subscribers: sunshaoce, StephenFan, arichardson.
Herald added a project: All.


================
Comment at: llvm/lib/Target/RISCV/RISCVGISel.td:30
+class PatSExtOpWGI<SDPatternOperator OpNode, RVInst Inst>
+    : Pat<(i64 (sra (shl (OpNode GPR:$rs1, GPR:$rs2), (i64 32)), (i64 32))),
+          (Inst GPR:$rs1, GPR:$rs2)>;
----------------
arsenm wrote:
> Should sext_inreg be legal?
This is what I'm stuck on right now. It really should to match the SelectionDAG code, at least for i32 -> i64. However there is no way to map `G_SEXT_INREG` to `sext_inreg` because `sext_inreg` uses a value type as a DAG operand, whereas `G_SEXT_INREG` uses a constant which indicates the size of the original type. So no patterns defined which use `sext_inreg` will work for GlobalISel. I think my only option left is to do custom selection code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76445



More information about the llvm-commits mailing list