[llvm] [DFAJumpThreading] Enable DFAJumpThread by default. (PR #157646)

Hongyu Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 10 08:17:44 PDT 2025


XChy wrote:

> Would it make sense to limit the number of phi nodes?
Yes, but the problem is that it's hard to predict the exact number of inserted phi nodes before threading. Coarsely, we can set a threshold for the number of unduplicated successors.

> Looking at this example, I'm also somewhat surprised that we perform the optimization in a case where the result still has multiple large dispatch switches -- is that expected/profitable?

The multiple large dispatch switches are not the targets to thread over; it's just like a sub-switch under the switch. It's semantically correct to duplicate such switches. For the small sub-switch, it's as profitable as common branches. But for such a big sub-switch, I am not quite sure without testing on real benchmarks. If the threading path is cold, I guess it's unprofitable due to the increase in code size (compares and jump tables?).


https://github.com/llvm/llvm-project/pull/157646


More information about the llvm-commits mailing list