use of 'restrict' pointer


I have C source code which qualifies some of the pointers using the ‘restrict’ keyword and used clang to generate the llvm IR code.

Here is the C source code:

int restrict1(void)


int* restrict a;

int* restrict b;

int x[10];

int y[10];

*a = x[2];

*b = x[3];



The ‘restrict’ information seems to be lost in the generated IR code. Am I doing something wrong here?



I think 'restrict' works in LLVM only when the keyword is used with
function arguments. At least that was the case with LLVM 2.6.

In addition, Clang had some troubles with 'restrict' in LLVM 2.7,
but it seems to work again in Clang trunk, at least for me. See: