[InstSimplify] Adjust context instruction when threading phi (PR61312)
authorNikita Popov <npopov@redhat.com>
Fri, 10 Mar 2023 09:34:27 +0000 (10:34 +0100)
committerNikita Popov <npopov@redhat.com>
Fri, 10 Mar 2023 09:34:27 +0000 (10:34 +0100)
commitbe687aff052bbdd6fd2cc3c75c8cebdd9ce7fab2
tree83e2612cc7f12895cc51cc31e94851fd33920853
parent8bcdc503eb366f2b2e554ddb5a09b0ec79eda9b0
[InstSimplify] Adjust context instruction when threading phi (PR61312)

When threading operations over phis, we need to adjust the context
instruction to the terminator of the incoming block. This was
handled when threading icmps, but not when threading binops.

Fixes https://github.com/llvm/llvm-project/issues/61312.
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/phi.ll