[LLVMdev] Loads not hoisted out of the loop

Dimitri Tcaciuc dtcaciuc at gmail.com
Thu Jan 17 21:27:25 PST 2013


Hey everyone,

I'm looking at the following two C functions:

    http://pastebin.com/mYWCj6d8

Second one is about 50% slower than the first one because in the second
case d->data[i * 3 + {X, Y, Z}] loads are not moved out of the second loop
and are computed every time j increments, even though they don't depend on
it. If I move those out manually, the performance of the two is equal.

What could be the reason for this behaviour? I looked at LICM logs; the
compiler hoists GEPs but stops short of loading the actual values. Does it
have something to do with possible aliasing?

Thanks,


Dimitri.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130117/eb82f46e/attachment.html>


More information about the llvm-dev mailing list