[llvm] [DFAJumpThreading] Avoid exploring the paths that never come back (PR #85505)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 05:00:02 PDT 2024


nikic wrote:

> > Can you please add something like `if (VerifyLoopInfo) LI->verify(DT)` and add `-verify-loop-info` to all the DFAJumpThreading tests? Can also mark the analysis as preserved.
> 
> I don't think we preserve the loop analysis completely. When transforming DFA, we clone and thread BBs, which may break loop analysis. This patch only preserves it before transforming DFA, so that we get the correct result in `AllSwitchPaths::paths`.

I don't think it's a good idea to use an analysis that's not preserved. Is it possible to preserve LI through the threading optimization?

Sorry I completely missed this when looking at https://github.com/llvm/llvm-project/pull/85360.

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


More information about the llvm-commits mailing list