[cfe-dev] Why doesn't pragma vectorize warn by default on failure

Hal Finkel hfinkel at anl.gov
Wed Jul 22 09:39:21 PDT 2015


----- Original Message -----
> From: "Gonzalo BG" <gonzalobg88 at gmail.com>
> To: "cfe-dev at cs.uiuc.edu Developers" <cfe-dev at cs.uiuc.edu>
> Sent: Wednesday, July 22, 2015 11:29:28 AM
> Subject: [cfe-dev] Why doesn't pragma vectorize warn by default on failure
> 
> 
> 
> Right now when writing code like:
> 
> #pragma clang loop vectorize(enable) interleave(enable)
> while(...) {
> ...
> }
> 
> one has to:
> 
> 
> 1) pass the compiler the flags "-Rpass-missed=loop-vectorize
> -Rpass-analysis=loop-vectorize" to get a warning on all loops where
> vectorization failed.
> 2) grep that output (which might be huge in a moderately sized
> project) for that particular loop.
> 3) Check if vectorization worked.
> 4) Remove the compiler flags and recompile to keep working on
> something else.
> 
> This is really bad.
> 
> 
> A user specified that a loop has to be vectorized. When I do this, it
> is my intent that the loop gets vectorized. However, the current
> workflow discourages users from actually checking that vectorization
> worked. Furthermore, if months later something on that loop changes
> that breaks vectorization, this happens silently.
> 
> Why are things this way? Can something be done about this?

I agree, this seems like a nice idea. For loops that have the pragma, we should enable the pass "missed" informational messages from the vectorizer (unroller, etc.) by default. Patches are obviously welcome -- and/or, please file a bug report at https://llvm.org/bugs/

 -Hal

> 
> Could we get these warnings on by default for those loops explicitly
> marked with the vectorize pragma?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory



More information about the cfe-dev mailing list