We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
memcpy
I tried the following code:
%0 = type { i8, [753 x i8] } define void @src(ptr nocapture noundef %arg) local_unnamed_addr { bb: %i = alloca %0, align 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(754) %i, ptr noundef nonnull align 1 dereferenceable(754) %arg, i64 754, i1 false) %i1 = getelementptr inbounds i8, ptr %i, i64 1 store i8 1, ptr %arg, align 1 %i2 = getelementptr inbounds i8, ptr %arg, i64 1 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(753) %i2, ptr noundef nonnull align 1 dereferenceable(753) %i1, i64 753, i1 false) ret void } define void @tgt(ptr nocapture noundef %arg) local_unnamed_addr { bb: store i8 1, ptr %arg, align 1 ret void } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0 attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
We can eliminate all memcpy.
alive2: https://alive2.llvm.org/ce/z/hCPePV From: rust-lang/rust#122610 (comment).
The text was updated successfully, but these errors were encountered:
fa24213
[MemCpyOpt] Forward memcpy based on the actual copy memory locatio…
293ff48
…n. (llvm#87190) Fixes llvm#85560. We can forward `memcpy` as long as the actual memory location being copied have not been altered. alive2: https://alive2.llvm.org/ce/z/q9JaHV
DianQK
Successfully merging a pull request may close this issue.
I tried the following code:
We can eliminate all
memcpy
.alive2: https://alive2.llvm.org/ce/z/hCPePV
From: rust-lang/rust#122610 (comment).
The text was updated successfully, but these errors were encountered: