[PATCH] D97549: [RISCV] Improve support of LoopVectorizer for RISC-V Vector

Luke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 06:03:16 PST 2021


luke957 created this revision.
Herald added subscribers: vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
luke957 requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.

Improve support of LoopVectorizer for RISC-V Vector by implementing unsigned RISCVTTIImpl::getRegisterBitWidth(bool Vector).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97549

Files:
  llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h


Index: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
===================================================================
--- llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
+++ llvm/lib/Target/RISCV/RISCVTargetTransformInfo.h
@@ -51,6 +51,16 @@
   bool shouldExpandReduction(const IntrinsicInst *II) const;
   bool supportsScalableVectors() const { return ST->hasStdExtV(); }
   Optional<unsigned> getMaxVScale() const;
+
+  unsigned getRegisterBitWidth(bool Vector) const {
+    if (Vector) {
+      if (ST->hasStdExtV())
+        return std::max(ST->getMinRVVVectorSizeInBits(), 128u);
+      return 0;
+    }
+    return ST->getXLen();
+  }
+
 };

 } // end namespace llvm


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97549.326662.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/1d87b410/attachment.bin>


More information about the llvm-commits mailing list