[LLVMdev] Pointer aliasing issue
Duncan Sands
baldrick at free.fr
Mon Oct 11 03:20:56 PDT 2010
Hi Artiom,
> I have following C code:
>
> void factorial(float **a, float **b)
> {
> b[2][2] = a[0][2];
> b[2][2] = a[0][1];
> }
...
> Assuming that a and b arrays contains pointers that are not aliased,
> is it possible to remove the first store by using some C or LLVM IR specific
> declarations?
try this:
void factorial(float ** __restrict a, float ** __restrict b)
{
b[2][2] = a[0][2];
b[2][2] = a[0][1];
}
Ciao,
Duncan.
PS: Did you mean to use b[2][2] in both lines?
More information about the llvm-dev
mailing list