[llvm] 99b86d7 - [PassManager] add tests for vector pass enabling; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 29 06:03:16 PST 2020


If it exists as part of 'opt' testing, I'm not seeing it. There is a clang
file at llvm-project/clang/test/CodeGen/loop-unroll.c that runs the -O1
pipeline (which we don't like very much...).
The vector options are especially confusing because the names change from
clang to LLVM, and loop vs. SLP is handled differently (one option defaults
to false, the other to true).
I'm going to change the patch proposal slightly in
https://reviews.llvm.org/D75145, so I'm not adding to this mess at least.

On Sat, Feb 29, 2020 at 8:10 AM Roman Lebedev <lebedev.ri at gmail.com> wrote:

> Now that i think about it, do we have similar -fno-unroll-loops test
> coverage? Anything else?
>
> On Sat, Feb 29, 2020 at 4:07 PM Sanjay Patel via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
> >
> >
> > Author: Sanjay Patel
> > Date: 2020-02-29T07:56:41-05:00
> > New Revision: 99b86d76b5e13e2257d791c66f45dd679b7bd92e
> >
> > URL:
> https://github.com/llvm/llvm-project/commit/99b86d76b5e13e2257d791c66f45dd679b7bd92e
> > DIFF:
> https://github.com/llvm/llvm-project/commit/99b86d76b5e13e2257d791c66f45dd679b7bd92e.diff
> >
> > LOG: [PassManager] add tests for vector pass enabling; NFC
> >
> > Added:
> >     llvm/test/Other/opt-pipeline-vector-passes.ll
> >
> > Modified:
> >
> >
> > Removed:
> >
> >
> >
> >
> ################################################################################
> > diff  --git a/llvm/test/Other/opt-pipeline-vector-passes.ll
> b/llvm/test/Other/opt-pipeline-vector-passes.ll
> > new file mode 100644
> > index 000000000000..1a1ad56c88e7
> > --- /dev/null
> > +++ b/llvm/test/Other/opt-pipeline-vector-passes.ll
> > @@ -0,0 +1,52 @@
> > +; RUN: opt -O1                    -debug-pass=Structure  < %s -o
> /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1
> > +; RUN: opt -O2                    -debug-pass=Structure  < %s -o
> /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2
> > +; RUN: opt -O1 -vectorize-loops=0 -debug-pass=Structure  < %s -o
> /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O1_FORCE_OFF
> > +; RUN: opt -O2 -vectorize-loops=0 -debug-pass=Structure  < %s -o
> /dev/null 2>&1 | FileCheck %s --check-prefixes=OLDPM_O2_FORCE_OFF
> > +; RUN: opt -disable-verify -debug-pass-manager -passes='default<O1>' -S
> %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O1
> > +; RUN: opt -disable-verify -debug-pass-manager -passes='default<O2>' -S
> %s 2>&1 | FileCheck %s --check-prefixes=NEWPM_O2
> > +
> > +; REQUIRES: asserts
> > +
> > +; SLP does not run at -O1. Loop vectorization runs, but it only
> > +; works on loops explicitly annotated with pragmas.
> > +
> > +; OLDPM_O1-LABEL:  Pass Arguments:
> > +; OLDPM_O1:        Loop Vectorization
> > +; OLDPM_O1:        Optimize scalar/vector ops
> > +; OLDPM_O1-NOT:    SLP Vectorizer
> > +
> > +; Everything runs at -O2.
> > +
> > +; OLDPM_O2-LABEL:  Pass Arguments:
> > +; OLDPM_O2:        Loop Vectorization
> > +; OLDPM_O2:        Optimize scalar/vector ops
> > +; OLDPM_O2:        SLP Vectorizer
> > +
> > +; The loop vectorizer still runs at both -O1/-O2 even with the
> > +; debug flag, but it only works on loops explicitly annotated
> > +; with pragmas.
> > +
> > +; OLDPM_O1_FORCE_OFF-LABEL:  Pass Arguments:
> > +; OLDPM_O1_FORCE_OFF:        Loop Vectorization
> > +; OLDPM_O1_FORCE_OFF:        Optimize scalar/vector ops
> > +; OLDPM_O1_FORCE_OFF-NOT:    SLP Vectorizer
> > +
> > +; OLDPM_O2_FORCE_OFF-LABEL:  Pass Arguments:
> > +; OLDPM_O2_FORCE_OFF:        Loop Vectorization
> > +; OLDPM_O2_FORCE_OFF:        Optimize scalar/vector ops
> > +; OLDPM_O2_FORCE_OFF:        SLP Vectorizer
> > +
> > +; There should be no
> > diff erence with the new pass manager.
> > +; This is tested more thoroughly in other test files.
> > +
> > +; NEWPM_O1-LABEL:  Running pass: LoopVectorizePass
> > +; NEWPM_O1:        Running pass: VectorCombinePass
> > +; NEWPM_O1-NOT:    Running pass: SLPVectorizerPass
> > +
> > +; NEWPM_O2-LABEL:  Running pass: LoopVectorizePass
> > +; NEWPM_O2:        Running pass: VectorCombinePass
> > +; NEWPM_O2:        Running pass: SLPVectorizerPass
> > +
> > +define void @f() {
> > +  ret void
> > +}
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200229/b3f80e9f/attachment.html>


More information about the llvm-commits mailing list