[Reassociate] Use getInsertionPointerAfterDef()
authorNikita Popov <npopov@redhat.com>
Wed, 13 Jul 2022 14:53:11 +0000 (16:53 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 31 Aug 2022 09:10:24 +0000 (11:10 +0200)
commit8f3fd26b74a7f5eb9892556511bae8f70a3597dc
treec3e88ec98beabf2b0c24e3baca97b448363a170a
parent0e5fe1cdacdca65edc84c89cc7a6de27f406de61
[Reassociate] Use getInsertionPointerAfterDef()

This simplifies the code and fixes handling for the callbr case,
where the instruction needs to be inserted in the normal
destination, rather than after the terminator.

Originally part of D129660.
llvm/lib/Transforms/Scalar/Reassociate.cpp
llvm/test/Transforms/Reassociate/callbr.ll [new file with mode: 0644]