How to get debug dump of candidate pairs selected in BBVectorizer?

Hi All,
I’m trying to understand BB Vectorizer and gone through
http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf

Wanted to know how to use bb-vectorize-debug-candidate-selection and bb-vectorize-debug-pair-selection command arguments.

I tried the command with debug build clang -

clang -O2 test.c -mllvm -vectorize \
-mllvm -debug-only=bb-vectorize \
-mllvm -bb-vectorize-debug-pair-selection \
-mllvm -bb-vectorize-debug-candidate-selection
as mentioned in [http://llvm.org/bugs/show_bug.cgi?id=11973](http://llvm.org/bugs/show_bug.cgi?id=11973) but it doesnt seem to dump the candidate pair info as shown in bug id.


Could someone help me out here with the command line argument to get candidate pair selected info.

Thanks for the help!
Regards
Karthik Bhat

From: "Karthik Bhat" <blitz.opensource@gmail.com>
To: llvmdev@cs.uiuc.edu
Sent: Thursday, April 24, 2014 6:23:15 AM
Subject: [LLVMdev] How to get debug dump of candidate pairs selected in BBVectorizer?

Hi All,
I'm trying to understand BB Vectorizer and gone through
http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf

Wanted to know how to use bb-vectorize-debug-candidate-selection and
bb-vectorize-debug-pair-selection command arguments.

I tried the command with debug build clang -
clang -O2 test.c -mllvm -vectorize \
-mllvm -debug-only=bb-vectorize \
-mllvm -bb-vectorize-debug-pair-selection \
-mllvm -bb-vectorize-debug-candidate-selection as mentioned in
http://llvm.org/bugs/show_bug.cgi?id=11973 but it doesnt seem to
dump the candidate pair info as shown in bug id.

A few things have changed since then. You'll need -vectorize-slp-aggressive instead of -vectorize.

From clang, there are now direct flags:

-fvectorize == loop vectorizer
-fslp-vectorize == SLP vectorizer
-fslp-vectorizer-aggressive == BB vectorizer

Also, in case you don't know, most of the active upstream development has moved to the SLP vectorizer. The BB vectorizer still does a more expensive search, and I think it is mostly useful at this point for isolating useful cases that the SLP vectorizer misses.

-Hal

> From: "Karthik Bhat" <blitz.opensource@gmail.com>
> To: llvmdev@cs.uiuc.edu
> Sent: Thursday, April 24, 2014 6:23:15 AM
> Subject: [LLVMdev] How to get debug dump of candidate pairs selected in
      BBVectorizer?
>
>
>
> Hi All,
> I'm trying to understand BB Vectorizer and gone through
> http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf
>
>
> Wanted to know how to use bb-vectorize-debug-candidate-selection and
> bb-vectorize-debug-pair-selection command arguments.
>
>
> I tried the command with debug build clang -
> clang -O2 test.c -mllvm -vectorize \
> -mllvm -debug-only=bb-vectorize \
> -mllvm -bb-vectorize-debug-pair-selection \
> -mllvm -bb-vectorize-debug-candidate-selection as mentioned in
> http://llvm.org/bugs/show_bug.cgi?id=11973 but it doesnt seem to
> dump the candidate pair info as shown in bug id.

A few things have changed since then. You'll need
-vectorize-slp-aggressive instead of -vectorize.

From clang, there are now direct flags:
-fvectorize == loop vectorizer
-fslp-vectorize == SLP vectorizer
-fslp-vectorizer-aggressive == BB vectorizer

Also, in case you don't know, most of the active upstream development has
moved to the SLP vectorizer. The BB vectorizer still does a more expensive
search, and I think it is mostly useful at this point for isolating useful
cases that the SLP vectorizer misses.

Thanks Hal for the info and heads-up. I have started to look into

SLPVectorizer and trying to understand the same.