[llvm-commits] [PATCH] Make dependency DAG construction to use AA
Andrew Trick
atrick at apple.com
Tue May 8 16:24:42 PDT 2012
On May 8, 2012, at 3:04 PM, Andrew Trick <atrick at apple.com> wrote:
> + int64_t MinOffset = std::min(MMOa->getOffset(), MMOb->getOffset());
> + int64_t Overlapa = MMOa->getSize() + MMOa->getOffset() - MinOffset;
> + int64_t Overlapb = MMOb->getSize() + MMOb->getOffset() - MinOffset;
>
> It took me a while to figure out what you're doing and why. We can hide this behind an API eventually (I can do it post checkin), but for now can you add comments with any cases you could think of? Please also comment that it's taken from DAGCombiner. Apparently DAGCombiner thinks it's a good idea to normalize offsets relative to each other by subtracting MinOffset. I don't understand why this is a good idea and can't prove to myself that it is safe. For example, what if we have an IR-level offset from the same base pointer smaller than the MachineOperand offset? We would seem to miss the overlap. Maybe Dan can comment on this.
>
> Hal also mentioned negative offsets, but it looks to me like that would work assuming positive offsets work!
Dan confirmed that AA provides a simple property that alias(p, q), is always equivalent to alias(p - c, q - c) assuming no wrapping. (Apparently the offset is only used when the underlying object is the same!). So the code is fine, we just need a clear comment to that effect.
The reason this is a good idea is that giving AA a smaller access size allows it to be more optimistic.
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120508/34d88762/attachment.html>
More information about the llvm-commits
mailing list