Reapply [SimplifyCFG] Handle branch on same condition in pred more directly
authorNikita Popov <npopov@redhat.com>
Wed, 20 Apr 2022 15:03:45 +0000 (17:03 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 22 Apr 2022 08:27:38 +0000 (10:27 +0200)
commit993b166debd1c4e6b4897c2d425273efab892221
treee9164d7c5e7de13fac56e384d20e378f85286722
parent5c6a14649843ccd2c50ed9e2fcacaa8ebd820ae8
Reapply [SimplifyCFG] Handle branch on same condition in pred more directly

Reapplying without changes, after a fix to a dependent patch.

-----

Rather than creating a PHI node and then using the PHI threading
code, directly handle this case in
FoldCondBranchOnValueKnownInPredecessor().

This change is supposed to be NFC-ish, but may cause changes due
to different transform order.
llvm/lib/Transforms/Utils/SimplifyCFG.cpp