[llvm] r279778 - [MemCpy] Add comments for r279769
Tim Shen via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 25 14:03:46 PDT 2016
Author: timshen
Date: Thu Aug 25 16:03:46 2016
New Revision: 279778
URL: http://llvm.org/viewvc/llvm-project?rev=279778&view=rev
Log:
[MemCpy] Add comments for r279769
Differential Revision: https://reviews.llvm.org/D23846
Modified:
llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/trunk/test/Transforms/MemCpyOpt/pr29105.ll
Modified: llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp?rev=279778&r1=279777&r2=279778&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/MemCpyOptimizer.cpp Thu Aug 25 16:03:46 2016
@@ -1110,7 +1110,8 @@ bool MemCpyOptPass::performMemCpyToMemSe
MemSetInst *MemSet) {
AliasAnalysis &AA = LookupAliasAnalysis();
- // This only makes sense on memcpy(..., memset(...), ...).
+ // Make sure that memcpy(..., memset(...), ...), that is we are memsetting and
+ // memcpying from the same address. Otherwise it is hard to reason about.
if (!AA.isMustAlias(MemSet->getRawDest(), MemCpy->getRawSource()))
return false;
Modified: llvm/trunk/test/Transforms/MemCpyOpt/pr29105.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MemCpyOpt/pr29105.ll?rev=279778&r1=279777&r2=279778&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/MemCpyOpt/pr29105.ll (original)
+++ llvm/trunk/test/Transforms/MemCpyOpt/pr29105.ll Thu Aug 25 16:03:46 2016
@@ -1,6 +1,7 @@
; RUN: opt -memcpyopt -instcombine -S %s | FileCheck %s
%Foo = type { [2048 x i64] }
+; Make sure that all mempcy calls are converted to memset calls, or removed.
; CHECK-LABEL: @baz(
; CHECK-NOT: call void @llvm.memcpy
define void @baz() unnamed_addr #0 {
More information about the llvm-commits
mailing list