[LLVMdev] Alias Analysis accuracy

Liu, Yaxun (Sam) Yaxun.Liu at amd.com
Fri Sep 21 14:52:22 PDT 2012


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>


More information about the llvm-dev mailing list