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

           Summary: Duplicate store instructions
           Product: libraries
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=7403)
 --> (http://llvm.org/bugs/attachment.cgi?id=7403)
The LLVM file.

The current trunk version of LLVM generates duplicate store instructions for
the attached LLVM code. This code was generated by clang for the following
function:

double _Complex maybe_an_fma(double _Complex a, double _Complex b, double
_Complex c)
{
        return a*b + c;
}


Running Debug+Asserts/bin/llc -O3 -o - t.ll yields an assembly sequence which
ends with:
    addsd    40(%esp), %xmm0
    movl    4(%esp), %eax
    movsd    %xmm0, (%eax)
    movsd    %xmm1, 8(%eax)
    movsd    %xmm1, 8(%eax)
    ret    $4

Running Debug+Asserts/bin/llc -O3 -mtriple=powerpc-unknown-linux-gnu -o - t.ll
yields an assembly sequence which ends with:
    fadd 0, 0, 4
    stfd 1, 0(3)
    stfd 0, 8(3)
    stfd 0, 8(3)
    blr 

In both cases, the final store instructions are identical. The LLVM ends with:
  %real1 = getelementptr inbounds %0* %agg.result, i32 0, i32 0
  %imag2 = getelementptr inbounds %0* %agg.result, i32 0, i32 1
  store double %agg.result.real, double* %real1
  store double %agg.result.imag, double* %imag2
  ret void
(full LLVM file attached). Something seems amiss.

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to