[llvm-commits] [PATCH][FastMath, InstCombine] Fadd/Fsub optimizations

Shuxin Yang shuxin.llvm at gmail.com
Wed Dec 12 18:56:44 PST 2012


I has typo in my mail. I meant 1.5 not 1*5.
dyn_castFoldableMul() is not applicable.

Forget my change, I return back to patten match approach.

On 12/12/2012 06:41 PM, Eli Friedman wrote:
> On Wed, Dec 12, 2012 at 4:58 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>> I just re-read the InstCombiner::SimplifyAssociateOrCommutative().
>> It is pretty simple, it can only handle adjacent instructions with exactly
>> the same opcode.
>> (1*5 * x) - x is certainly beyond its scope.
> instcombine uses a different codepath to handle (5*x) - x in
> particular; see dyn_castFoldableMul in InstCombineAddSub.cpp .  And
> InstCombiner::SimplifyUsingDistributiveLaws can handle 5*x+5*x.  (Not
> sure what the 1 is doing in your example.)
>
>> Do we need to expand it to be more capable?  I don't like this idea because
> We are capable of performing all the transformations from your
> original email on integer +/-/*.
>
> -Eli




More information about the llvm-commits mailing list