This is an archive of the discontinued LLVM Phabricator instance.

AliasSetTracker "fixme" fix - using mod/ref information for UnknownInstr
ClosedPublic

Authored by andrew.zhogin on Jul 27 2015, 4:36 PM.

Details

Reviewers
chandlerc
hfinkel
Summary

AliasSetTracker now doesn't convert access mode to ModRefAccess if new visited UnknownInst has only 'REF' modrefinfo to existing pointers is sets.

And ref-aliased by call pointers can be hoisted out of loop.

// FIXME: This should use mod/ref information to make this not suck so bad
Alias = SetMayAlias;

  • Access = ModRefAccess;

+ Access = (MR & MRI_Mod) ? ModRefAccess : RefAccess;

Diff Detail

Event Timeline

andrew.zhogin retitled this revision from to AliasSetTracker "fixme" fix - using mod/ref information for UnknownInstr.
andrew.zhogin updated this object.
andrew.zhogin added reviewers: hfinkel, chandlerc.
andrew.zhogin added a subscriber: llvm-commits.
hfinkel added inline comments.Aug 9 2015, 10:34 PM
lib/Analysis/AliasSetTracker.cpp
116

If MR == MRI_ModRef, then this will always add only ModAccess. Is this right when Access == RefAccess? (can that happen?)

174

Why is this called "OnMR"? Do you mean OrMR?

203

Lambdas are nice, but not if you need to repeat them ;) -- Please make utility functions for these (static helpers are fine).

Updated patch with review comments considered

andrew.zhogin marked 3 inline comments as done.Aug 18 2015, 9:37 PM
andrew.zhogin added inline comments.
lib/Analysis/AliasSetTracker.cpp
183

Renamed to processMR() anonymous local helper

hfinkel accepted this revision.Aug 27 2015, 5:18 PM
hfinkel edited edge metadata.

LGTM.

lib/Analysis/AliasSetTracker.cpp
115

This is not your fault, but seems silly. ModRefInfo in AliasAnalysis.h and AccessLattice in AliasSetTracker.h are the *same* enum (modulo the names). We should just fix that (make AccessLattice == ModRefInfo), and eliminate the need for this switch statement.

If you don't want to do that first, please add a FIXME.

This revision is now accepted and ready to land.Aug 27 2015, 5:18 PM
andrew.zhogin edited edge metadata.
andrew.zhogin marked an inline comment as done.

AccessLattice is now typedef-alias of ModRefInfo

As I don't have write access could you please commit this patch for me?

hfinkel closed this revision.Oct 27 2015, 1:39 PM

r251451. I apologize for the delay.