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

Eli Friedman eli.friedman at gmail.com
Wed Nov 28 16:31:03 PST 2012


On Wed, Nov 28, 2012 at 2:59 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:
> Hi, Eli:
>
>    Thank you for your feedback. I add two testing-cases per your request.

+; Same testing-case as the one used in fold() except that the operators have
+; fixed FP mode.
+define float @notfold(float %a) {
+notfold:
+; CHECK: notfold
+; CHECK-NOT: fmul float %a, 0x4006147AE0000000
+  %mul = fmul fast float %a, 0x3FF3333340000000
+  %mul1 = fmul float %mul, 0x4002666660000000
+  ret float %mul1
+}

Please use positive CHECK stmts where possible (i.e. check for the
original fmuls, not the absence of the folded one).

Please also include a test where the first fmul is fast, and the second is not.

Please also include testcases for fadd.

-Eli



More information about the llvm-commits mailing list