[PATCH] D79783: [LoopVectorize] Fallback to a scalar epilogue when TP fails
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 12 08:34:50 PDT 2020
SjoerdMeijer added a comment.
A follow up question inlined.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4964
+ // If a hint/switch to use tail-predication is found, check early if
+ // tail-predication is actually possible. Else, fallback to a scalar epilogue.
+ if (ScalarEpilogueStatus == CM_ScalarEpilogueNotNeededUsePredicate) {
----------------
nit: tail-predication -> tail-folding
================
Comment at: llvm/test/Transforms/LoopVectorize/ARM/tail-folding-scalar-epilogue-fallback.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -loop-vectorize -mattr=+armv8.1-m.main,+mve.fp -disable-mve-tail-predication=false < %s | FileCheck %s
+; RUN: opt -S -loop-vectorize -mattr=+armv8.1-m.main,+mve.fp -disable-mve-tail-predication=true < %s | FileCheck %s
----------------
SjoerdMeijer wrote:
> Sorry for being a bit lazy, but this is a big example, but why is this rejected for tail-predication? Would be good to indicate the reason somewhere, e.g. function name, in the IR.
> And could this example be reduced?
This test is enabling MVE tail-predication, meaning that here we "enable" masked loads/stores that enable tail-folding. Thus, since no other options are used, this relies on TTI hook preferPredicateOverEpilogue to set CM_ScalarEpilogueNotNeededUsePredicate. And so, this hook determines for this test that tail-folding was possible, which we then overrule later, is that correct?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D79783/new/
https://reviews.llvm.org/D79783
More information about the llvm-commits
mailing list