[llvm-dev] [cfe-dev] Disabling vectorisation at '-O3'

Martin J. O'Riordan via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 1 10:15:27 PST 2018


Yes, it looks like passing ‘EnableVec’ and ‘EnableSLPVec’ to ‘Args.hasFlag’ should be replaced with ‘false’ and then it has the expected behaviour.

 

            MartinO

 

From: cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] On Behalf Of Martin J. O'Riordan via cfe-dev
Sent: 01 March 2018 18:02
To: 'Richard Smith' <richard at metafoo.co.uk>
Cc: 'Clang Dev' <cfe-dev at lists.llvm.org>
Subject: Re: [cfe-dev] Disabling vectorisation at '-O3'

 

Thanks Richard, I’ll do that - and I can add it as a bug.  It’s almost certainly easy enough to fix, but I wanted to be sure that I wasn’t just making a naïve mistake.

 

            MartinO

 

From: Richard Smith [mailto:richard at metafoo.co.uk] 
Sent: 01 March 2018 17:44
To: Martin J. O'Riordan <MartinO at theheart.ie <mailto:MartinO at theheart.ie> >
Cc: Clang Dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org> >
Subject: Re: [cfe-dev] Disabling vectorisation at '-O3'

 

On 1 Mar 2018 09:16, "Martin J. O'Riordan via cfe-dev" <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org> > wrote:

Hi CFE-Devs,

While debugging a problem in our back-end, I want to temporarily remove JUST ‘-vectorize’ and ‘-vectorize-slp’ from the flags passed with ‘-cc1’, but I want to leave all the other command-line options the same.  But when I use:

clang -S -O3 -fno-vectorize -fno-slp-vectorize foo.c

it is still inserting ‘-vectorize -vectorize-slp’.  The code in ‘Clang.cpp’ for this is at line #4858 (on the v6.0 branch):

This looks like a bug to me; I'd expect -fno-* to override the -O flag rather than meaning "use the default for this -O level". I'd suggest you look up who added these flags and check with them to make sure this wasn't the intent (it it was, we'll need further discussion), then fix the driver to do the "obvious" thing.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180301/3e289f51/attachment.html>


More information about the llvm-dev mailing list