Page MenuHomePhabricator

[SSAUpdater] Don't call ValueIsRAUWd callback upon single use replacement
AbandonedPublic

Authored by DaniilSuchkov on Jan 17 2020, 1:02 AM.

Details

Summary

Currently LICM expects SSAUpdater to call ValueIsRAUWd callback whenever SSAUpdater::RewriteUse replaces a use of value, in order to keep AliasSetTrackers that are cached by LICM up to date. Though it is incorrect to call that callback when only one use of the value is being replaced. In some cases this incorrect call of the callback can break SCEV.

This patch introduces a new CallbackVH callback oneUseReplacedWith with the sole purpose of serving this particular case. This callback is implemented only by ASTCallbackVH, it updates AST according to the change and it doesn't confuse/break any other CallbackVH provider.

This solution is far from perfect, but other options are even worse (including undesired compile time impact and/or way broader scope of changes).

This patch fixes bug https://bugs.llvm.org/show_bug.cgi?id=44320.

Diff Detail

Event Timeline

DaniilSuchkov created this revision.Jan 17 2020, 1:02 AM
fhahn added a subscriber: fhahn.Jan 17 2020, 3:30 AM
DaniilSuchkov abandoned this revision.Jan 20 2020, 8:57 PM

Given this comment: https://bugs.llvm.org/show_bug.cgi?id=44320#c3 there is a better solution than this patch.