[llvm] [DFAJumpThreading] Add an early exit heuristic for unpredictable values (PR #85015)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 10:59:25 PDT 2024


XChy wrote:

> Note that with this patch, there is still a 20% compile-time regression in X86Disassembler.cpp, despite not performing a transform: https://llvm-compile-time-tracker.com/compare_clang.php?from=8c5e9cf737138aba22a4a8f64ef2c5efc80dd7f9&to=42c75d888058b35c6d15901b34e36251d8f766b9&stat=instructions%3Au&sortBy=interestingness

I believe there is much space for reducing the compile-time in `AllSwitchPaths::paths`, which enumerates the paths from switch and limit the max path length to 20. If there are all conditional jumps from switch, the run time of this function can be O(n ^ 20).
I will investigate into it in my free time. Hope I can improve it.

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


More information about the llvm-commits mailing list