[PATCH] D155772: [RISCV][GlobalISel] Legalize bitshift instructions for narrow types

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 16:04:12 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp:38
+  // Extensions
+  auto ExtLegalFunc = [=](const LegalityQuery &Query) {
+    unsigned DstSize = Query.Types[0].getSizeInBits();
----------------
Do you actually need to permit anything besides XLenVT? I would hope if all of these were illegal the artifact combiner would eliminate all the casts in your examples


================
Comment at: llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp:46
+
+    const LLT &SrcTy = Query.Types[1];
+
----------------
Don't use references with LLT


================
Comment at: llvm/test/CodeGen/RISCV/GlobalISel/legalizer/rv32/legalize-ashr.mir:3
+# RUN: llc -mtriple=riscv32 -run-pass=legalizer %s -o - \
+# RUN: | FileCheck %s
+---
----------------
Need some < 8 bit and odd intermediate sizes too


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155772



More information about the llvm-commits mailing list