Skip to content
Commit ee0bf647 authored by Sanjay Patel's avatar Sanjay Patel
Browse files

[InstCombine] try to fold mul by neg-power-of-2 to shl

`(A * -2**C) + B --> B - (A << C)`

https://alive2.llvm.org/ce/z/A6BWkf

This inverts what Negator was doing before:
D134310 / 0f32a5de

Analysis and codegen are generally better without multiply,
so we should favor this form even if we trade add for sub
(because those are generally equivalent cost operations).
parent 3d621398
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment