Add an AST expression representing the &-operator
commitf5fcba3fc0a1693079bbe2757b5cf4d39fd24a1d
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>
Sun, 10 Aug 2014 06:15:03 +0000 (9 23:15 -0700)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 15 Sep 2014 15:46:49 +0000 (15 17:46 +0200)
tree6205db690bff46969a578ca61223dadd80eb4dbc
parent2cbfd6179e9cf5c059c167b7be5c0ac8ea336dc3
Add an AST expression representing the &-operator

This patch adds the C-style "address of" operator (a.k.a. reference
operator) to the AST expressions. It is only applicable to access
expressions and is supposed to yield the address of the access.
Applied to an access such as "A[i + c - 1]" (namely "&A[i + c - 1]") the
address-of operator should yield the same result as the explicit
computation of the address, namely "A + (i + c - 1)".

This allows users to construct a single AST expression from several isl
generated AST expressions, with this single AST expression involving
addresses of accessed array elements. Such single AST expressions may be
easier to convert to other representations than having to convert each
isl generated AST expression separately and then combining them in the
this other representation.

In particular, this is useful for constructing aliasing checks in Polly where
it is easier to construct the check as an isl AST expression than it is to do
the same after conversion to LLVM IR. Also, taking the address of an accessed
element is preferred to pointer arithmetic because a straightforward
translation into IR results in simpler code.

Signed-off-by: Johannes Doerfert <doerfert@cs.uni-saarland.de>
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
doc/user.pod
include/isl/ast.h
include/isl/ast_type.h
isl_ast.c