[PATCH] D23912: [SimplifyCFG] Handle tail-sinking of more than 2 incoming branches

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 28 10:11:58 PDT 2016


jmolloy added inline comments.

================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:1483
@@ +1482,3 @@
+  // phase below) we insert a common successor for all unconditional arcs and
+  // connect that to [end], to enable sinking:
+  //
----------------
hans wrote:
> Would this scale to larger if-else chains where some subset of them have similar instructions? I assume not because the order of the if-statements makes this hard even if it doesn't really matter for semantics.
In general this is a very hard problem as you say.

I've been thinking that it should be possible to use a suffix tree or levenshtein distance to find the longest common substring in all incoming blocks. It should be possible to support the case where some blocks have a common subsequence and others don't...

Bit of a longer term blue sky thing though. 


Repository:
  rL LLVM

https://reviews.llvm.org/D23912





More information about the llvm-commits mailing list