[PATCH] D129732: [RISCV] Add a RISCV specific CodeGenPrepare pass.

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 01:36:28 PDT 2022


asb accepted this revision.
asb added a comment.
This revision is now accepted and ready to land.

See my very minor comments inline, but this LGTM.



================
Comment at: llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp:28
+using namespace llvm;
+
+namespace {
----------------
Perhaps worth defining and updating a statistic. e.g. `STATISTIC(NumZExtToSExt, "Number of SExt instructions converted to ZExt")`


================
Comment at: llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp:68
+  // This often occurs with widened induction variables.
+  const DataLayout &DL = ZExt->getModule()->getDataLayout();
+  if (isImpliedByDomCondition(ICmpInst::ICMP_SGE, Src,
----------------
We already have the DL as a member of RISCVCodeGenPrepare, so just use `*DL` as an arg to isImpliedByDomCondition instead?


================
Comment at: llvm/test/CodeGen/RISCV/riscv-codegenprepare.ll:4
+
+target triple = "riscv64"
+
----------------
Trivial nit: slightly better to move this to `-mtriple=riscv64` in the RUN line like we do for other tests.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D129732



More information about the llvm-commits mailing list