[DivRemPairs] Add an initial case for hoisting to a common predecessor.
This patch adds support for hoisting the division and maybe the remainder for control flow graphs like this. ``` PredBB | \ | Rem | / Div ``` If we have DivRem we'll hoist both to PredBB. If not we'll just hoist Div and expand Rem using the Div. This improves our codegen for something like this ``` __uint128_t udivmodti4(__uint128_t dividend, __uint128_t divisor, __uint128_t *remainder) { if (remainder != 0) *remainder = dividend % divisor; return dividend / divisor; } ``` Reviewed By: spatel, lebedev.ri Differential Revision: https://reviews.llvm.org/D87555
Loading