[PATCH] D116333: [RISCV] Initial support for scalable vectorization
Alex via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 09:25:44 PST 2022
alextsao1999 added a comment.
In D116333#3219308 <https://reviews.llvm.org/D116333#3219308>, @sdesmalen wrote:
> The commit message seems wrong, because this patch is about tuning the cost-model, not about enabling scalable vectorization.
That's because if you can't get the cost of some cast instructions, you will not force some instructions a specific cost...Maybe a better way is to make the cast instruction legal...
================
Comment at: llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll:2
+; REQUIRES: asserts
+; RUN: opt -mtriple=riscv64-linux-gnu -mattr=+experimental-v -riscv-v-vector-bits-min=128 -force-target-instruction-cost=1 -loop-vectorize -S -debug-only=loop-vectorize -scalable-vectorization=off < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK_SCALABLE_DISABLED
+; RUN: opt -mtriple=riscv64-linux-gnu -mattr=+experimental-v -riscv-v-vector-bits-min=128 -force-target-instruction-cost=1 -loop-vectorize -S -debug-only=loop-vectorize -scalable-vectorization=on < %s 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK_SCALABLE_ON
----------------
jrtc27 wrote:
> jrtc27 wrote:
> > Use update_test_checks.py, and preferably show the changes to the test case with this patch, not the whole test case, so it's clear what's been improved.
> Don't use -linux-gnu targets when it's not OS-specific, just use riscv64 (aka riscv64-unknown-elf)
thx, I will fix it
================
Comment at: llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll:7
+; Test that the MaxVF for the following loop, that has no dependence distances,
+; is calculated as vscale x 4 (max legal SVE vector size) or vscale x 16
+; (maximized bandwidth for i8 in the loop).
----------------
craig.topper wrote:
> This says SVE and the numbers weren't updated to match what is shown on the CHECK lines.
Thx...I have fixed it
================
Comment at: llvm/test/Transforms/LoopVectorize/RISCV/scalable-vectorization.ll:10
+define void @test0(i32* %a, i8* %b, i32* %c) #0 {
+; CHECK: LV: Checking a loop in "test0"
+; CHECK_SCALABLE_ON: LV: Found feasible scalable VF = vscale x 2
----------------
jrtc27 wrote:
> Not actually showing the code generated? Debug output is generally not great for testing, it's often unclear what's actually going on, it can only run in builds that have debugging built in and you have to write the CHECK lines by hand.
The test case is from sve, so I think it's better to be consistent with sve...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D116333/new/
https://reviews.llvm.org/D116333
More information about the llvm-commits
mailing list