[PATCH] D131508: [WIP][RISCV] Enable fixed length vectorization
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 9 15:41:08 PDT 2022
reames added a comment.
@barannikov88 - I don't see how your last comment connects to this review. If you want to ask a question on your hardware, please email me and we can chat briefly.
================
Comment at: llvm/test/CodeGen/RISCV/vec3-setcc-crash.ll:2
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s \
; RUN: | FileCheck %s --check-prefix=RV32
----------------
reames wrote:
> TODO: This test needs to be restricted to continue exercising scalar lowering.
Done
================
Comment at: llvm/test/Transforms/LoopVectorize/RISCV/inloop-reduction.ll:85
; INLOOP: for.body.preheader:
-; INLOOP-NEXT: [[TMP0:%.*]] = call i32 @llvm.vscale.i32()
-; INLOOP-NEXT: [[TMP1:%.*]] = mul i32 [[TMP0]], 8
-; INLOOP-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i32 [[N]], [[TMP1]]
+; INLOOP-NEXT: [[MIN_ITERS_CHECK:%.*]] = icmp ult i32 [[N]], 16
; INLOOP-NEXT: br i1 [[MIN_ITERS_CHECK]], label [[SCALAR_PH:%.*]], label [[VECTOR_PH:%.*]]
----------------
reames wrote:
> reames wrote:
> > TODO: We're deciding that fixed length vectorization is profitable over scalable vectorization when both are legal. That's odd, and probably indicates a problem in the cost model.
> This turns out to be a known issue in the cost model. So as to return a conservative correct cost, we're using an upper bound on VL. This results in scalable vectors (for which maximum VL is potentially quite large) appearing unprofitable. In this case, the cost is a function of log2(max-vl), but we have other instances - such as scatter/gather - where the cost is linear in max-VL and magnifies this effect even further.
>
> I don't think this is a blocking issue for enabling fixed length vectorization.
Fix out for review as D131519
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131508/new/
https://reviews.llvm.org/D131508
More information about the llvm-commits
mailing list