This is an archive of the discontinued LLVM Phabricator instance.

[ScheduleDAGInstrs] isUnsafeMemoryObject() removed
ClosedPublic

Authored by jonpa on Feb 4 2016, 4:35 AM.

Details

Reviewers
atrick
hfinkel
Summary

I think this function is basically useless, since volatile memacesses or MIs with unmodelled sideffects become global memory objects, and the other little checks are also done elsewhere.

It also seems like a good idea to cache the results of getUnderlyingObjectsForInstr(), when it returns no objects. This is a case where we could give up without querying AA for it and initiate a new search for underlying objects. (I am not sure how much of a win this is)

Diff Detail

Event Timeline

jonpa updated this revision to Diff 46895.Feb 4 2016, 4:35 AM
jonpa retitled this revision from to [ScheduleDAGInstrs] isUnsafeMemoryObject() removed.
jonpa updated this object.
jonpa added reviewers: atrick, hfinkel.
jonpa added a subscriber: llvm-commits.
jonpa added a comment.Feb 4 2016, 5:52 AM

Sorry for confusion, but I think I realized that the call to AA should always be made after all, since there are cases which AA will handle that underlying objects will not, e.g. TBAA.

But I still beleive that the isUnsafeMemoryObject() function seems unnecessary.

atrick edited edge metadata.Feb 4 2016, 8:51 AM

Are you planning to rewrite this patch without the UnsfeMemObjs set then? The cache is very confusing and I'm not sure what work you're trying to avoid.

jonpa updated this revision to Diff 46925.Feb 4 2016, 10:08 AM
jonpa edited edge metadata.

Ok - the cache was bad and removed.

About the comment

// We purposefully do no check for hasOneMemOperand() here
// in hope to trigger an assert downstream in order to
// finish implementation.

There is already a check for hasOneMemOperand() in MIsNeedChainEdge(),
so this is a lost issue already before this patch... Not sure if that's relevant somehow.

The check for PseudoSourceValue should be implicitly done by checking
getValue() on both MMOs, if I am not mistaken.

atrick accepted this revision.Feb 13 2016, 9:30 PM
atrick edited edge metadata.

LGTM. Thanks.

This revision is now accepted and ready to land.Feb 13 2016, 9:30 PM
jonpa closed this revision.Feb 15 2016, 8:52 AM

commited as r260899.