<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 08/07/2013 01:52 PM, Michele
Scandale wrote:<br>
</div>
<blockquote cite="mid:5202B37A.2000807@gmail.com" type="cite"><br>
IMHO this information should be a plus that could be *safely*
ignored when not necessary and used where it can provide an
improvement in optimizations. This does not necessary mean the the
middle-end (and the back-ends) must be aware of the semantic of
these logical address spaces, it would be enough just to
distinguish between two logically different address spaces.
<br>
The first application I see is alias analysis: for targets that do
not have different physical address spaces (e.g. X86), meaning
that in the IR the 'addrspace' modifier *should* not be present,
the knowledge that two pointers refers to different logical
address spaces (e.g. OpenCL address spaces) can be used to decide
the aliasing.
<br>
<br>
<br>
</blockquote>
There was this patch from a long time ago that never went in to use
the address spaces for alias analysis:<br>
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<a
href="http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20111010/129728.html">http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20111010/129728.html</a><br>
<br>
The decision seems to be that LLVM addrspaces aren't required to not
alias. I was thinking of following the suggestion to make the
datalayout contain which address spaces can / cannot alias.
Alternatively, the tbaa metadata might be appropriate for this, but
I haven't looked at how that works.<br>
</body>
</html>