[LLVMbugs] [Bug 18863] New: le32-unknown-nacl target does not optimize simple struct return values as primitive returns

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Feb 16 12:14:11 PST 2014


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

            Bug ID: 18863
           Summary: le32-unknown-nacl target does not optimize simple
                    struct return values as primitive returns
           Product: new-bugs
           Version: 3.4
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: caustin at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12072
  --> http://llvm.org/bugs/attachment.cgi?id=12072&action=edit
sret.cpp

The attached sret.cpp demonstrates a simple struct with a nondefault
constructor.

When compiled to IR for the default x86_64 target on Ubuntu 12.04 AMD64, it
optimizes the S struct into a simple i32.  See the attached sret-amd64.ll.

When compiled to IR for the le32-unknown-nacl target, the struct is not
optimized away.  See the attached sret-le32.ll.

Both files were generated with:

clang --std=c++11 -O2 -emit-llvm -target le32-unknown-nacl -c -Wall -o sret.bc
sret.cpp && llvm-dis -o sret-le32.ll sret.bc 

clang --std=c++11 -O2 -emit-llvm -c -Wall -o sret.bc sret.cpp && llvm-dis -o
sret-amd64.ll sret.bc 

This reproduces with both clang 3.3 and clang 3.4.

The lack of this optimization penalizes use of utility types, such as
InternedString and IntrusiveSmartPtr, used frequently in our
Emscripten-compiled project.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140216/32fbce99/attachment.html>


More information about the llvm-bugs mailing list