On 6/30/2026 4:59 AM, Richard Biener wrote:
On Tue, Jun 30, 2026 at 10:52 AM Hongtao Liu <[email protected]> wrote:
To be conservative, perhaps I should first only handle the cases of 1
and 2, so that a / (2 - bool) can be converted from a division into a
conditional shift, which should be profitable for all targets.
Maybe. I still wouldn't do this from GIMPLE.
The 1/2 case would likely be non-controversial for the expansion step
given its a conditional right shift which has easily synthesizable forms.
The other cases are a bit more borderline, though we could at least
query costs in the gimple->RTL expansion phase to help guide the decisions.
Jeff