http://llvm.org/bugs/show_bug.cgi?id=4141
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: [email protected]
ReportedBy: [email protected]
CC: [email protected]
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs