[LLVMbugs] [Bug 4141] New: PointerMayBeCaptured() can do better for readonly/ readnone function calls.

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun May 3 12:33:22 PDT 2009


           Summary: PointerMayBeCaptured() can do better for
                    readonly/readnone function calls.
           Product: new-bugs
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: fvbommel at wxs.nl
                CC: llvmbugs at cs.uiuc.edu

Created an attachment (id=2935)
 --> (http://llvm.org/bugs/attachment.cgi?id=2935)
Proposed patch

PointerMayBeCaptured() currently only treats calls to readonly/readnone
functions differently if they return 'void', but it could also handle them if
they return a pointer (by tracking whether the return value escapes).

>From the testcase in the attached patch:
declare i8* @external_identity(i8*) readonly
define void @nc6(i8* %p) {
        call i8* @external_identity(i8* %p)
        ret void
That %p parameter should be marked 'nocapture' by "opt -functionattrs". There's
no way it could escape.

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