This is an archive of the discontinued LLVM Phabricator instance.

[MemDep] Also remove load instructions from NonLocalDesCache.
ClosedPublic

Authored by fhahn on Jun 12 2020, 2:41 AM.

Details

Summary

Currently load instructions are added to the cache for invariant pointer
group dependencies, but only pointer values are removed currently. That
leads to dangling AssertingVHs in the test case below, where we delete a
load from an invariant pointer group. We should also remove the entries
from the cache.

Fixes PR46054.

Diff Detail

Event Timeline

fhahn created this revision.Jun 12 2020, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 12 2020, 2:41 AM
efriedma added inline comments.Jun 12 2020, 4:16 PM
llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
1531

The comment says "otherwise"; should this be an else-if?

bmahjour removed a subscriber: bmahjour.Jun 12 2020, 4:53 PM
fhahn updated this revision to Diff 271176.Jun 16 2020, 12:59 PM

Reword comments.

fhahn marked an inline comment as done.Jun 16 2020, 1:06 PM
fhahn added inline comments.
llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
1531

Yes the otherwise refers to the preceding if. I move it into the else branch and also added a version of the test case that loads a pointer value.

This revision is now accepted and ready to land.Jun 16 2020, 1:32 PM
fhahn updated this revision to Diff 271205.Jun 16 2020, 2:24 PM

Move code to else and add test case that loads a pointer.

fhahn added a comment.Jun 16 2020, 2:25 PM

Just realized that the latest version got stuck while uploading. The latest version with the extra test case and the code in the else is now available.

efriedma accepted this revision.Jun 16 2020, 3:03 PM

Oh, that makes more sense. Still LGTM

This revision was automatically updated to reflect the committed changes.