[PATCH] D42211: [ModRefInfo] Set ModRefInfo::Must for calls.
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 03:49:45 PST 2018
asbirlea added inline comments.
================
Comment at: lib/Analysis/AliasAnalysis.cpp:193
if (ArgAlias != NoAlias) {
ModRefInfo ArgMask = getArgModRefInfo(CS, ArgIdx);
DoesAlias = true;
----------------
sanjoy wrote:
> Is this bit changing behavior? Both before and after we look at `IsMustAlias` only when `DoesAlias` is true, and your change only possibly changes the value of `IsMustAlias` in the cases where `DoesAlias` is false.
Let me try to reason this out loud.
`IsMustAlias &= (ArgAlias == MustAlias);` is analogous with
```
if (ArgAlias != MustAlias)
IsMustAlias = false
```
Before: `IsMustAlias` is set to false when NoAlias is found.
After patch: `IsMustAlias` is not set to false for NoAlias, because the statement moved inside the `if (ArgAlias != NoAlias)` block. `IsMustAlias` is now set to false for May/PartialAlias.
So for a list of arguments `(a=MustAlias, b=NoAlias)`, `DoesAlias` will be set to true in the for loop because of `a`.
Before the patch, `IsMustAlias=false` because of `b`, while after the patch `IsMustAlias=true` because `IsMustAlias &= (ArgAlias == MustAlias);` only resets the value for May/PartialAlias, not for NoAlias.
Does this makes sense?
Calls were setting Must when all arguments were MustAlias, this patch enables mix of MustAlias and NoAlias arguments.
Updating patch description to reflect this.
I'll update the comment on the clearing statement too.
Repository:
rL LLVM
https://reviews.llvm.org/D42211
More information about the llvm-commits
mailing list