This is an archive of the discontinued LLVM Phabricator instance.

[GVN] Remove stale entry in phitranslate cache when new phi is generated for PRE
ClosedPublic

Authored by wmi on Jul 31 2017, 5:25 PM.

Details

Summary

When a new phi is generated for scalarpre of an expression, the phiTranslate cache will become stale: Before PRE, the candidate expression must not be available in a predecessor block, and phitranslate will cache the information. After PRE, the expression will become available in all predecessor blocks, so the related entry in phiTranslate cache becomes stale. The patch will simply remove the stale entry so phiTranslate can be recomputed next time.

The stale entry in phitranslate cache will not affect correctness but will cause missing PRE opportunity for later instructions.

Diff Detail

Repository
rL LLVM

Event Timeline

wmi created this revision.Jul 31 2017, 5:25 PM
davide accepted this revision.Aug 8 2017, 8:01 AM

LGTM, please make sure this doesn't break things as PRE in GVN is quite fragile :)

lib/Transforms/Scalar/GVN.cpp
2224 ↗(On Diff #109035)

Please add a comment.

This revision is now accepted and ready to land.Aug 8 2017, 8:01 AM
wmi marked an inline comment as done.Aug 8 2017, 2:37 PM
This revision was automatically updated to reflect the committed changes.