[InstCombine] Directly replace instr in foldIntegerTypedPHI() (NFCI)
authorNikita Popov <npopov@redhat.com>
Wed, 5 Oct 2022 11:26:20 +0000 (13:26 +0200)
committerNikita Popov <npopov@redhat.com>
Wed, 5 Oct 2022 11:28:23 +0000 (13:28 +0200)
commit11897708c0229c92802e747564e7c34b722f045f
tree8e644040b9decca4a1eb3e47a8099f71bc8043b8
parente035f03e92771062eff362303823c1db98c7907a
[InstCombine] Directly replace instr in  foldIntegerTypedPHI() (NFCI)

Rather than inserting a ptrtoint + inttoptr pair, directly replace
the inttoptr with the new phi node. This ensures that no other
transform can undo it before the pair gets folded away.

This avoids the infinite loop when combined with D134954.

This is NFCI in the sense that it shouldn't make a difference, but
could due to different worklist order.
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp