[PATCH] D72905: [SSAUpdater] Don't call ValueIsRAUWd callback upon single use replacement
    Daniil Suchkov via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Fri Jan 17 01:02:59 PST 2020
    
    
  
DaniilSuchkov created this revision.
DaniilSuchkov added reviewers: efriedma, reames, sanjoy, asbirlea.
Herald added subscribers: llvm-commits, javed.absar, hiraditya.
Herald added a project: LLVM.
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.
https://reviews.llvm.org/D72905
Files:
  llvm/include/llvm/Analysis/AliasSetTracker.h
  llvm/include/llvm/IR/ValueHandle.h
  llvm/lib/Analysis/AliasSetTracker.cpp
  llvm/lib/IR/Value.cpp
  llvm/lib/Transforms/Utils/SSAUpdater.cpp
  llvm/test/Transforms/LCSSA/pr44320.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D72905.238702.patch
Type: text/x-patch
Size: 5345 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200117/7b9d1f47/attachment.bin>
    
    
More information about the llvm-commits
mailing list