[LLVMbugs] [Bug 1819] New: Struct-returning const functions do not benefit from being const

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Nov 22 14:06:51 PST 2007


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

           Summary: Struct-returning const functions do not benefit from
                    being const
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


Normally if a function is const/pure in gcc it gets turned into
a readnone/readonly function in LLVM.  The exception to this is
functions that return a struct: they get an extra pointer parameter
that is used to write out the return value, so can't be marked
readnone or readonly (since otherwise optimizers think that the
no return value is written, because readnone/readonly functions
can't write via pointers...).  There's a similar problems for
byval functions: they read from the pointer used to pass the
struct argument by value, so can't be marked readnone.  It would
be nice to do something about this so that such functions get
optimized better.

This problem was split out of PR1383.


-- 
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