[JumpThreading] Don't phi translate past loop phi (#70664)
When evaluating comparisons in predecessors, phi operands are translated into the predecessor. If the translation is across a backedge, this means that the two operands of the icmp will be from two different loop iterations, resulting in incorrect simplification. Fix this by not performing the phi translation for phis in loop headers. Note: This is not a complete fix. If the jump-threading-across-loop-headers option is enabled, the LoopHeaders variable does not get populated. Additional changes will be needed to fix that case. Related to https://github.com/llvm/llvm-project/issues/70651.
Loading
Please sign in to comment