Andrew Zhogin
2015-Jul-28 13:13 UTC
[LLVMdev] AliasSetTracker and UnknownInst's (callsites mostly) problem
Hi all, There is a problem about how AliasSetTracker merging AliasSet's when meet UnknownInst. When adding new pointer it looks for existing AliasSet's aliased with new pointer. And merging them together. It is ok for pointers: if %A mayalias %B and %B mayalias %C then %A mayalias %C. But the same logic when adding callsite is wrong ( findAliasSetForUnknownInst). Callsite may be known to readonly access one pointer and change the content of other pointer. Why to merge together two noalias pointers if they have some mod/ref relationships with common callsite? If modrefinfo(%A, %call1) == REF and modrefinfo(%B, %call1) == MOD it doesn't mean %A may/must alias %B. AliasSet's for %A and %B must stay independent with corrected access lattice: aliasset(%A).Access |= RefAccess, aliasset(%B).Access |= ModAccess. And I think new UnknownInst must be added to both AliasSet's. Or maybe UnknownInst's must be collected in central part - AliasSetTracker, not AliasSet's. Am I right? -- Best regards, Andrew Zhogin -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150728/4e0ece51/attachment.html>
Philip Reames
2015-Jul-28 18:01 UTC
[LLVMdev] AliasSetTracker and UnknownInst's (callsites mostly) problem
This was discussed a while back in the thread titled "alias set collapse and LICM". Philip On 07/28/2015 06:13 AM, Andrew Zhogin wrote:> Hi all, > > There is a problem about how AliasSetTracker merging AliasSet's when > meet UnknownInst. > > When adding new pointer it looks for existing AliasSet's aliased with > new pointer. And merging them together. It is ok for pointers: if %A > mayalias %B and %B mayalias %C then %A mayalias %C. > > But the same logic when adding callsite is wrong > (findAliasSetForUnknownInst). > > Callsite may be known to readonly access one pointer and change the > content of other pointer. > Why to merge together two noalias pointers if they have some mod/ref > relationships with common callsite? > > If modrefinfo(%A, %call1) == REF and modrefinfo(%B, %call1) == MOD > it doesn't mean %A may/must alias %B. > AliasSet's for %A and %B must stay independent with corrected access > lattice: aliasset(%A).Access |= RefAccess, aliasset(%B).Access |= > ModAccess. > And I think new UnknownInst must be added to both AliasSet's. > > Or maybe UnknownInst's must be collected in central part - > AliasSetTracker, not AliasSet's. > > Am I right? > > -- > Best regards, > Andrew Zhogin > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150728/b4571eb8/attachment.html>
Apparently Analagous Threads
- Skip redundant checks in AliasSet::aliasesUnknownInst
- Skip redundant checks in AliasSet::aliasesUnknownInst
- Skip redundant checks in AliasSet::aliasesUnknownInst
- Expose aliasing information in getModRefInfo (or viceversa?)
- Objects of MemoryLocation class are created for ‘llvm.memset.*‘ intrinsics