[PATCH] D42211: [ModRefInfo] Set ModRefInfo::Must for calls.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 30 16:57:29 PST 2018


asbirlea added a comment.

Let me start of with saying, I'm not sure this is the right thing to do, you're not missing anything (and sorry for the delayed reply).
The reason I say this, is that I've had the argument with myself both ways, and both make sense depending on how we end up using this Must bit information.

Taking your example, if we have a call C = @f_argmemonly(p0, p1) and p1 mustalias p1 and noalias p0, yes, @f_argmemonly(p0, p1) does touch p0.
If we look at something like promotion, p1 should be ok to be promoted to a scalar based on finding MustAlias+NoAlias with p0. I believe this was the original reason for this patch.
If we look at something like hoisting the call, then we need a getModRef result on all function arguments. This could potentially be an additional API call.

For 2 calls, there's another discussion. Before patch: Must set means "there is a single location both calls touch, and the calls touch no other locations."
After this patch: Must set means "there exists at least one memory location that is touched by both calls, and both calls may each touch a set of disjoint memory locations".
I'm not sure how to use either info off the top of my head, so can't make the argument for/against here..


Repository:
  rL LLVM

https://reviews.llvm.org/D42211





More information about the llvm-commits mailing list