[LLVMdev] Pointer aliasing

Dan Gohman gohman at apple.com
Thu Jan 26 11:07:49 PST 2012


On Jan 24, 2012, at 8:58 PM, Brent Walker wrote:

> Thank you for your reply.  The compromise you describe below, is it a
> compromise in the LLVM back end or in clang?  I run into this while
> building a compiler for a small DSL language for which I generate
> functions that receive a context from which they extract a bunch of
> pointers to doubles from which inputs are passed to the function (I
> just used C/clang in my examples to illustrate the problem).

For restrict-style alias information, the limitation is in LLVM.

Since you're not using clang, you might be able to use a custom TBAA
type tree instead. TBAA works differently from restrict; it applies
to loads and stores, rather than to pointers. But if you can frame
your aliasing property as a type-oriented property, saying for
example that each array element is a pointer to a distinct type, it
may suffice.

Dan




More information about the llvm-dev mailing list