[llvm-commits] [PATCH] [Fast-math] In relaxed FP mode, Instruction::isAssociative() returns true for fmul/fadd

Shuxin Yang shuxin.llvm at gmail.com
Wed Nov 28 17:41:51 PST 2012


I just chat with Michael, he said the behavior is expected:

define float @fold2(float %a) {
notfold2:
; CHECK: fold2
; CHECK: fmul float %a, 0x4006147AE0000000
   %mul = fmul float %a, 0x3FF3333340000000
   %mul1 = fmul fast float %mul, 0x4002666660000000
   ret float %mul1
}

On 11/28/12 5:34 PM, Eli Friedman wrote:
> On Wed, Nov 28, 2012 at 5:31 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
>> Hi, Eli:
>>
>>      I understand how such mixed FP operator could take place. I misconstrue
>> your previous mail about the the
>> testing case. Currently it doesn't work (i.e mistakenly fold despite the one
>> of the fp operator claimed as
>> restrictive).
>>
>>     I don't try to lug everything in this single patch which is supposed to
>> be a "enabler" for following work of
>> bug/performance defect.
>>
>>     Please advise if I can "speculate" committing this change despite the
>> some lurking bugs, or should I fix
>> all this potential bugs before I can commit this patch.
> You're probably going to have to audit every user of isAssociative to
> make sure it does the right thing, but you don't have to do that
> before you commit this.  Add the testcase anyway, and just put in a
> FIXME instead of the CHECK lines.
>
> -Eli




More information about the llvm-commits mailing list