[PATCH] Allow global structures to be vectorized

Arnold Schwaighofer aschwaighofer at apple.com
Wed Feb 6 10:40:54 PST 2013


On Feb 6, 2013, at 12:23 PM, Renato Golin <renato.golin at linaro.org> wrote:

> On 6 February 2013 18:16, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> If you want to use Alias analysis see MemoryDependenceAnalysis::getDependency(Instruction *QueryInst) for an example how-to query AA if two accesses might alias. In principle,  you query AA->getLocation(Inst) to obtain the location (ignoring special cases). You then use this info to query AA->alias(Loc1, Loc2).
> 
> Thanks! So it seems I was in the right direction...
> 
>  
> I am not sure the cases we would catch justify the added cost. This would have to be evaluated.
> 
> I'm trying to avoid it at all costs, this is why my initial attempt was to store the data and *ONLY* if they're the same, I then go on to run the AA.
> 
> Maybe an alternative is to store the Instruction and the Value (not just the Value) on the WriteObjects, and only when the Values match, I do AA on the Instructions. Then, I don't need the OffsetList at all. I think that has a good value, can you see anything wrong with it?

In principle, assuming that you return a conservative answer when you don't know whether something might alias (different or unknown Values), yes .
The devil is in the detail :). You ignore no alias information on pointers this way (which is safe, but conservative). Also, you need to look at the attributes of memory access instructions (volatile, atomic and whatnot, see getDependency for this).

And as Hal said, thanks for looking into this!

- Arnold

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130206/8d825c1b/attachment.html>


More information about the llvm-commits mailing list