[NFC][SimplifyCFG] Common code sinking: check profitability once
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 28 Apr 2021 20:40:58 +0000 (23:40 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 28 Apr 2021 22:01:00 +0000 (01:01 +0300)
commit12c8027ce39f776a5cc1e322b0f125362384b8aa
tree9903030875e2bb310283fb1f1b8a84b6cadeb8f4
parent4c27ca21d9e5a99d49b7791795ff9dd7d312f760
[NFC][SimplifyCFG] Common code sinking: check profitability once

We can just eagerly pre-check all the instructions that we *could*
sink that we'd actually want to sink them, clamping the number of
instructions that we'll sink to stop just before the first unprofitable one.
llvm/lib/Transforms/Utils/SimplifyCFG.cpp