[llvm-dev] Should `llvm.loop.unroll.disable` disable interleaving?

Bardia Mahjour via llvm-dev llvm-dev at lists.llvm.org
Tue Apr 27 09:17:59 PDT 2021


Thanks for your feedback.
I've put together the following patch to address this issue:
https://reviews.llvm.org/D101374.


Bardia Mahjour
Compiler Optimizations
IBM Toronto Software Lab




From:	Sjoerd Meijer <Sjoerd.Meijer at arm.com>
To:	"llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org>, Bardia
            Mahjour <bmahjour at ca.ibm.com>
Date:	2021/04/14 09:31 AM
Subject:	[EXTERNAL] Re: [llvm-dev] Should `llvm.loop.unroll.disable`
            disable interleaving?



Sounds very reasonable to me. From: llvm-dev
<llvm-dev-bounces at lists.llvm.org> on behalf of Bardia Mahjour via llvm-dev
<llvm-dev at lists.llvm.org> Sent: 13 April 2021 22:11 To:
llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org> ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Sounds very reasonable to me.


From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Bardia
Mahjour via llvm-dev <llvm-dev at lists.llvm.org>
Sent: 13 April 2021 22:11
To: llvm-dev at lists.llvm.org <llvm-dev at lists.llvm.org>
Subject: [llvm-dev] Should `llvm.loop.unroll.disable` disable interleaving?

Hi,

Currently the `#pragma clang loop unroll(disable)` directive has no impact
on loop vectorizer's decision to interleave or not. I think it would make
sense to avoid interleaving when the user specifically asked for no
unrolling. I'm just wondering what people think about having `#pragma clang
loop unroll(disable)` or `#pragma clang loop unroll_count(1)` imply
`#pragma clang loop interleave(disable)`?

> cat tmp.c
void foo(int n, int * A)
{
#pragma clang loop unroll(disable)
for (int i = 0; i < n; i++)
A[i] = i;
}
> clang -O3 tmp.c -S -emit-llvm -mllvm -debug-only=loop-vectorize 2>&1 |
grep -i interleave
LV: Interleave Count is 12


Bardia Mahjour
Compiler Optimizations
IBM Toronto Software Lab


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210427/5e96db49/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210427/5e96db49/attachment.gif>


More information about the llvm-dev mailing list