Martin J. O'Riordan via llvm-dev
2018-Mar-01 18:15 UTC
[llvm-dev] [cfe-dev] Disabling vectorisation at '-O3'
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>
Martin J. O'Riordan via llvm-dev
2018-Mar-01 20:08 UTC
[llvm-dev] [cfe-dev] Disabling vectorisation at '-O3'
Please ignore this thread - I got myself confused, the code is fine - too many long days and nights staring at the screen. MartinO From: Martin J. O'Riordan [mailto:MartinO at theheart.ie] Sent: 01 March 2018 18:29 To: 'Martin J. O'Riordan' <MartinO at theheart.ie>; 'Richard Smith' <richard at metafoo.co.uk> Subject: RE: [llvm-dev] [cfe-dev] Disabling vectorisation at '-O3' Sorry about this, I accidentally cross posted to LLVM Dev, though as it happens I think that the problem is with LLVM after all. MartinO From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Martin J. O'Riordan via llvm-dev Sent: 01 March 2018 18:15 To: 'LLVM Developers' <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> >; 'Richard Smith' <richard at metafoo.co.uk <mailto:richard at metafoo.co.uk> > Subject: Re: [llvm-dev] [cfe-dev] Disabling vectorisation at '-O3' 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 <mailto:richard at metafoo.co.uk> > Cc: 'Clang Dev' <cfe-dev at lists.llvm.org <mailto: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/99533bc4/attachment.html>