[PATCH] D28934: Write a new SSAUpdater

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 18:04:55 PDT 2017


davide added a comment.

Thanks for your comment, I'll see what I can do given this shows up in some of our internal workload.
One thing, I agree we should change the API at some point (and maybe use a O(def + uses) renamer as we do in PredInfo) but, for starters, we should be able to have a drop-in replacement for `RewriteUse`, i.e. the new algorithm will always pick the correct value?

  void SSAUpdater::RewriteUse(Use &U) {
    Instruction *User = cast<Instruction>(U.getUser());
  
    Value *V;
    if (PHINode *UserPN = dyn_cast<PHINode>(User))
      V = GetValueAtEndOfBlock(UserPN->getIncomingBlock(U));
    else
      V = GetValueInMiddleOfBlock(User->getParent());
  [...]


https://reviews.llvm.org/D28934





More information about the llvm-commits mailing list