[PATCH] D113798: Add loop unrolling and peeling preferences for RISCV

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 15 02:00:36 PST 2021


frasercrmck added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:204
+    for (auto &I : *BB) {
+      // Don't unroll vectorized loop. Vectorization does not benefit from it as
+      // much as scalar code.
----------------
Is this truly checking "vectorized loops" or just loops containing vector instructions? We've already checked that the loop isn't vectorized according to metadata. What about code written using RVV intrinsics, or with OpenCL/SYCL/etc? We might want to unroll those loops, right?


================
Comment at: llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp:217
+
+      SmallVector<const Value *, 4> Operands(I.operand_values());
+      Cost +=
----------------
Does the explicit size of `4` help much or should we just use `SmallVector<const Value*>`?


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

https://reviews.llvm.org/D113798



More information about the llvm-commits mailing list