Page MenuHomePhabricator

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

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



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

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: there is a better solution than this patch.