[LLVMbugs] [Bug 13118] New: Generalize support for FMA contraction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 15 10:03:03 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13118

             Bug #: 13118
           Summary: Generalize support for FMA contraction
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


The llvm.fmuladd intrinsic is enough to model contraction of multiply and add
when FP_CONTRACT is enabled, but isn't enough to handle more general cases like
ppc fmsub and other instructions.  

Here's a possible sketch of an approach that could handle the more general
cases (including subtract, random negations, etc):

1. Add two bits (like NSW/NUW on integer ops) to the floating point binary
operations (fmul, fadd, ...): LHS_Contractable and RHS_Contractable.

2. Semantics are that the code generator is allowed to contract any tree of
operations linked through "contractable" operands.  In the FMA case, the
multiply can be merged into the add if the add's operand is marked
contractable.  In the PPC case, fmsub can be contracted if the multiply operand
of the subtract is marked.

3. Clang would generate the operand bits according to the language mode in
effect.  I believe that this model is sufficiently general to handle the C99
and C++ cases.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list