[PATCH] D70091: [BranchFolding] Fix PR43964 about branch folder not being debug invariant
    Bjorn Pettersson via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Nov 21 08:52:46 PST 2019
    
    
  
bjope marked an inline comment as done.
bjope added a comment.
In D70091#1753302 <https://reviews.llvm.org/D70091#1753302>, @jmorse wrote:
> This looks good to me and great refactor. To make sure I understand what's going on: by keeping a temporary iterator in ComputeCommonTailLength, and only "committing" the advance to I1/I2 when we're sure we've found some additional identical tail, this avoids all the concerns about I1/I2 ending up pointing at pseudo instructions?
Yes, simply scan for the next non-pseudo instructions to compare. If they are identical "commit" the advance and continue searching. Otherwise we are done.
ComputeCommonTailLength should give the same result as the old code using that algorithm. But the old code was really hard to read and used goto.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70091/new/
https://reviews.llvm.org/D70091
    
    
More information about the llvm-commits
mailing list