[LLVMbugs] [Bug 737] NEW: [llvmg++4] Code quality issue with gimplified array ctor

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Apr 13 12:26:52 PDT 2006


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

           Summary: [llvmg++4] Code quality issue with gimplified array ctor
           Product: tools
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: llvm-g++
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: sabre at nondot.org


For this:

----
#include <new>
struct X { X(); double D; };
typedef X Ty[4];
void foo(Ty *XX) {
  new(XX) Ty();
}
----

The C++ front-end or gimplifier is emitting pointer increments with casts and integer adds :(.  The 
output code looks like this:

        %tmp11 = cast %struct.X* %tmp2.0 to uint                ; <uint> [#uses=1]
        %tmp12 = add uint %tmp11, 8             ; <uint> [#uses=1]
        %tmp12 = cast uint %tmp12 to %struct.X*         ; <%struct.X*> [#uses=1]

to step over the elements.  This can't be good for performance.

-Chris



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the llvm-bugs mailing list