1. Apr 08, 2020
  2. Apr 07, 2020
    • Nikita Popov's avatar
      [RDA] Avoid full reprocessing of blocks in loops (NFCI) · 259649a5
      Nikita Popov authored
      RDA sometimes needs to visit blocks twice, to take into account
      reaching defs coming in along loop back edges. Currently it handles
      repeated visitation the same way as usual, which means that it will
      scan through all instructions and their reg unit defs again. Not
      only is this very inefficient, it also means that all reaching defs
      in loops are going to be inserted twice.
      
      We can do much better than this. The only thing we need to handle
      is a new reaching def from a predecessor, which either needs to be
      prepended to the reaching definitions (if there was no reaching def
      from a predecessor), or needs to replace an existing predecessor
      reaching def, if it is more recent. Since D77508 we only store the
      most recent predecessor reaching def, so that's the only one that
      may need updating.
      
      This also has the nice side-effect that reaching definitions are
      now automatically sorted and unique, so drop the llvm::sort() call
      in favor of an assertion.
      
      Differential Revision: https://reviews.llvm.org/D77511
      259649a5