[PATCH] D135125: [JumpThreading] Reverse the order of basic block iteration.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 12 16:58:52 PDT 2022


efriedma added a comment.

Oh, I see, the block we choose to thread across continues to get bigger, but the cost model is fine with it because the PHI nodes are "free".

I guess we could just tell the JumpThreading cost model to refuse to clone a block if there are, say, 20 or more PHI nodes in that block.  Not ideal, but reduces the chance of runaway growth.  (I mean, the growth is still sort of runaway; SSA construction is linear in the size of the function's CFG, so repeatedly doing it is fundamentally quadratic, but we can prevent it from getting worse than that.)


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

https://reviews.llvm.org/D135125



More information about the llvm-commits mailing list