[PATCH] D101916: [LoopVectorize] Fix crash for predicated instructions with scalable VF
Sander de Smalen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 06:38:54 PDT 2021
sdesmalen added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:7768
+bool LoopVectorizationCostModel::loopHasScalarWithPredication(
+ ElementCount VF, bool StateFoldTailByMasking) {
----------------
I think it'd be good to give this a more generic name, so that we can use it to test for other cases as well. How about `loopCanBeWidenedWithScalableVectors` which implies the conditions should be negated, and you may want to return some message of why it did not vectorize, e.g.
LoopVectorizationCostModel::loopCanBeWidenedWithScalableVectors(ElementCount MaxVF, std::string &Message)
================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-predicate-instruction.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt < %s -loop-vectorize -force-target-supports-scalable-vectors -S | FileCheck %s
----------------
This is no longer true
================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-predicate-instruction.ll:17
+
+define void @loop_needs_predication_with_scalableVF(i32* %a, i32* %b, i32* %cond) #0 {
+; CHECK-LABEL: @loop_needs_predication_with_scalableVF
----------------
nit: predication_in_loop
================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-predicate-instruction.ll:63
+
+define void @no_epillogue_allowed_with_scalableVF(i32* %a, i32* %b) #0 {
+; CHECK-LABEL: @no_epillogue_allowed_with_scalableVF
----------------
nit: unpredicated_loop_predication_through_tailfolding
================
Comment at: llvm/test/Transforms/LoopVectorize/scalable-predicate-instruction.ll:90
+
+attributes #0 = {"target-cpu"="generic"}
+
----------------
unnecessary?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101916/new/
https://reviews.llvm.org/D101916
More information about the llvm-commits
mailing list