[PATCH] D75362: [InstCombine] Process blocks in RPO

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 6 12:30:56 PDT 2020


efriedma added a comment.

A depth-first search is enough to ensure some predecessor of every block is visited before that block.  So the benefit of RPO is to change that to all (non-loop) predecessors, which I guess helps optimizations involving PHI nodes?

I'm surprised this shows up in the compile-time statistics that way.  Given the cost of everything else instcombine does, an RPO traversal shouldn't rank very high.  Maybe worth adding timers to check whether the time is actually in this function, or we end up doing more work due to the order of instructions in the worklist.  (Maybe we should be using SmallVector in ReversePostOrderTraversal?)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75362/new/

https://reviews.llvm.org/D75362





More information about the llvm-commits mailing list