[PATCH] Correct an operand inversion for fmul instcombine in fast math mode

Quentin Colombet qcolombet at apple.com
Thu Feb 28 13:13:36 PST 2013


Thanks Shuxin,

Committed: r176300.

-Quentin

On Feb 28, 2013, at 11:47 AM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

> Hi, Quentin:
> 
>    That stupid bug was created by me. Your change looks great. Please commit. 
> 
> Shuxin
> 
> 
> On 2/28/13 11:43 AM, Quentin Colombet wrote:
>> Hi,
>> 
>> I've attached a patch that fixes a bug in instcombine for fmul in fast math mode.
>> The instcombine recognized pattern looks like:
>> a = b * c
>> d = a +/- Cst
>> or
>> a = b * c
>> d = Cst +/- a
>> 
>> The actual code inverts the operand of the resulting add/sub instruction. This leads to incorrect code when the resulting operation is fsub.
>> 
>> The fix is straight forward. The new first operand is created form the old first operand and the new second operand is created from the old second operand. Previously, this was inverted.
>> 
>> The patch also contains a test case.
>> 
>> Thanks for the reviews.
>> 
>> Quentin
>> PS: I've also fixed the consistency of a comment to reflect the actual variable naming.
>> 
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130228/14d7c5e4/attachment.html>


More information about the llvm-commits mailing list