Make the memory dependence queries in the memcpy optimizer nonlocal.
This eliminates 28% of the llvm.memcpy calls in librustc.
Fixes PR28958.
Paths
| Differential D23469
Make the memory dependence queries in the memcpy optimizer nonlocal AbandonedPublic Authored by mehdi_amini on Aug 12 2016, 3:43 PM.
Details
Diff Detail
Event TimelineComment Actions Please add llvm-commits as a subscriber from the beginning, otherwise the mailing list lacking context. We have to close this one. Comment Actions Thanks for the patch! Could you please reduce the testcase? It contains quite a few unnecessary instructions. Something along the lines of the following would be more appropriate: define void @wobble(i8* noalias nocapture sret %arg, i8* nocapture readonly dereferenceable(64) %arg1, i1 zeroext %arg3) local_unnamed_addr #0 { bb: %tmp51 = alloca [64 x i8], align 8 %tmp51.sub = getelementptr inbounds [64 x i8], [64 x i8]* %tmp51, i64 0, i64 0 call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp51.sub, i8* nonnull %arg1, i64 64, i32 8, i1 false) br i1 %arg3, label %bb11, label %bb12 bb11: ; preds = %bb tail call void @ham() #3 unreachable bb12: ; preds = %bb call void @llvm.memcpy.p0i8.p0i8.i64(i8* %arg, i8* %tmp51.sub, i64 64, i32 8, i1 false) ret void } ; Function Attrs: argmemonly nounwind declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #1 ; Function Attrs: noreturn nounwind declare void @ham() local_unnamed_addr #2
Revision Contents
Diff 67925 include/llvm/Analysis/MemoryDependenceAnalysis.h
lib/Analysis/MemDepPrinter.cpp
lib/Analysis/MemoryDependenceAnalysis.cpp
lib/Transforms/Scalar/GVN.cpp
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/nonlocal-memcpy-memcpy.ll
|