-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[memcpyopt] fails to eliminate memcpy fed by sret #2590
Comments
Running the given testcase through opt -dse -memcpyopt -dce does the desired reductions, but opt -std-compile-opts doesn't. |
This is two issues:
define void @f(i8* noalias sret %result) { |
Tweak async calling convention patches to reflect upstream changes
opt -O2 through modernized testcase removes all the memcpies:
|
Extended Description
Here's the testcase (also attached). %pointless could be
eliminated since no use is ever made of it except as a
memcpy target. %temporary could also be eliminated in
favour of passing %result directly to the @initialize call.
define void @f(i8* noalias sret %result) {
entry:
%temporary = alloca i8 ; <i8*> [#uses=3]
%pointless = alloca i8 ; <i8*> [#uses=1]
call void @initialize( i8* noalias sret %temporary )
call void @llvm.memcpy.i32( i8* %pointless, i8* %temporary, i32 1, i32 4 )
call void @llvm.memcpy.i32( i8* %result, i8* %temporary, i32 1, i32 4 )
ret void
}
declare void @initialize(i8* noalias sret )
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind
The text was updated successfully, but these errors were encountered: