Yeah. Is there a way to specify noalias between these arguments? On Fri, Sep 21, 2012 at 2:46 PM, Krzysztof Parzyszek < kparzysz at codeaurora.org> wrote:> On 9/21/2012 4:35 PM, Welson Sun wrote: > >> Dear LLVM, >> >> I would like to understand how to improve the LLVM alias analysis >> accuracy. I am currently using llvmgcc 2.9 and llvm 3.0. Here is the C >> code: >> >> void foo(int a[SIZE], int b[SIZE], int c[SIZE]) >> { >> for(int i=0; i<SIZE; i++) >> c[i] = a[i] + b[i]; >> } >> > > This is equivalent to > void foo(int *a, int *b, int *c) > > { > for(int i=0; i<SIZE; i++) > c[i] = a[i] + b[i]; > } > > and so you can call this function with the same array for all parameters. > > -K > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-- Welson Phone: (408) 418-8385 Email: welson.sun at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120921/956f5b49/attachment.html>
I think you may add restrict type qualifier. Sam From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Welson Sun Sent: Friday, September 21, 2012 5:50 PM To: Krzysztof Parzyszek Cc: llvmdev at cs.uiuc.edu Subject: Re: [LLVMdev] Alias Analysis accuracy Yeah. Is there a way to specify noalias between these arguments? On Fri, Sep 21, 2012 at 2:46 PM, Krzysztof Parzyszek <kparzysz at codeaurora.org<mailto:kparzysz at codeaurora.org>> wrote: On 9/21/2012 4:35 PM, Welson Sun wrote: Dear LLVM, I would like to understand how to improve the LLVM alias analysis accuracy. I am currently using llvmgcc 2.9 and llvm 3.0. Here is the C code: void foo(int a[SIZE], int b[SIZE], int c[SIZE]) { for(int i=0; i<SIZE; i++) c[i] = a[i] + b[i]; } This is equivalent to void foo(int *a, int *b, int *c) { for(int i=0; i<SIZE; i++) c[i] = a[i] + b[i]; } and so you can call this function with the same array for all parameters. -K -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu<mailto:LLVMdev at cs.uiuc.edu> http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev -- Welson Phone: (408) 418-8385 Email: welson.sun at gmail.com<mailto:welson.sun at gmail.com> -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120921/16d7655f/attachment.html>
Can you give an example? And is this limited to C (not C++) only? On Fri, Sep 21, 2012 at 2:52 PM, Liu, Yaxun (Sam) <Yaxun.Liu at amd.com> wrote:> I think you may add restrict type qualifier.**** > > ** ** > > Sam**** > > ** ** > > *From:* llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] *On > Behalf Of *Welson Sun > *Sent:* Friday, September 21, 2012 5:50 PM > *To:* Krzysztof Parzyszek > *Cc:* llvmdev at cs.uiuc.edu > *Subject:* Re: [LLVMdev] Alias Analysis accuracy**** > > ** ** > > Yeah. Is there a way to specify noalias between these arguments?**** > > On Fri, Sep 21, 2012 at 2:46 PM, Krzysztof Parzyszek < > kparzysz at codeaurora.org> wrote:**** > > On 9/21/2012 4:35 PM, Welson Sun wrote:**** > > Dear LLVM, > > I would like to understand how to improve the LLVM alias analysis > accuracy. I am currently using llvmgcc 2.9 and llvm 3.0. Here is the C > code: > > void foo(int a[SIZE], int b[SIZE], int c[SIZE]) > { > for(int i=0; i<SIZE; i++) > c[i] = a[i] + b[i]; > }**** > > ** ** > > This is equivalent to > void foo(int *a, int *b, int *c)**** > > > { > for(int i=0; i<SIZE; i++) > c[i] = a[i] + b[i]; > }**** > > and so you can call this function with the same array for all parameters. > > -K > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev**** > > > > **** > > ** ** > > -- > Welson**** > > ** ** > > Phone: (408) 418-8385**** > > Email: welson.sun at gmail.com**** > > ** ** > > ** ** >-- Welson Phone: (408) 418-8385 Email: welson.sun at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120921/e443bd98/attachment.html>