[LLVMdev] type qualifiers in LLVM
j-humphreys at ti.com
Fri Sep 7 13:48:26 PDT 2012
Still diving into LLVM... I noticed that the LLVM type system does not represent qualifers (const, volatile, restrict).
>From what I can gather,
- the back end cannot ignore volatile, so loads/stores are annotated as volatile when they load/store through a volatile qualified pointer.
- const qualifiers are noted in metadata (I think)
- top level restrict qualified function parameters are marked with a 'noalias' attribute
So it appears that the restrict-ness of global/local pointers are not represented in LLVM, and thus ignored.
int * restrict p2 = p1;
int * restrict q2 = q1;
Are there plans to add this (primarily to improve loop based alias analysis)?
And I'm just curious, what's the design philosophy behind not representing qualifiers in the LLVM type system? Were their semantics considered too language specific?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev