[PATCH] Vectorizing Global Structures - Take 2

Renato Golin renato.golin at linaro.org
Mon Feb 11 08:40:36 PST 2013


Hi all,

Second attempt, using Alias Analysis and trying to avoid extra work for
previous behaviour at all costs.

Disclaimer: It's still not good enough, I'm not paying much attention to
details (containers, iterations, variable names, formatting), but to make
sure the code is sensible and not adding too much extra cost. I'll create
more tests when at least I know that the path is correct.

The extra costs are mainly memory, not CPU. For instance, I'm now using
multimap<Value*, Instruction*> instead of SmallVector<Value*>, because I
need to know the original store instructions associated with a particular
value (pointer operand). Do I need this? Or just iterating over all uses is
more efficient?

Another issue is that I'm trying to drop as early as possible, so I test if
the value is a GlobalValue or not, and only when it is, I try the
AA->alias(), failing if not (safe bet). Again, GlobalValue could be too
generic, and maybe I need to be more specific (a global struct, for
instance).

I thought about using a Location cache (between write loop and read loop),
but calculating the location doesn't seem too complicated...

Finally, the part that checks for alias is similar on Write and Read loops,
but extracting it would require me to typedef the multimap outside the
class. If the code ends up identical, I'll move the typedef to a private
part of the class.

Comments welcome! ;)

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130211/6264a365/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: global_vectorize.patch
Type: application/octet-stream
Size: 12258 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130211/6264a365/attachment.obj>


More information about the llvm-commits mailing list