Skip to content

Commit 3ad8b43

Browse files
committedAug 25, 2016
[MemCpy] Add comments for r279769
Differential Revision: https://reviews.llvm.org/D23846 llvm-svn: 279778
1 parent 6ac9172 commit 3ad8b43

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
 

‎llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,8 @@ bool MemCpyOptPass::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
11101110
MemSetInst *MemSet) {
11111111
AliasAnalysis &AA = LookupAliasAnalysis();
11121112

1113-
// This only makes sense on memcpy(..., memset(...), ...).
1113+
// Make sure that memcpy(..., memset(...), ...), that is we are memsetting and
1114+
// memcpying from the same address. Otherwise it is hard to reason about.
11141115
if (!AA.isMustAlias(MemSet->getRawDest(), MemCpy->getRawSource()))
11151116
return false;
11161117

‎llvm/test/Transforms/MemCpyOpt/pr29105.ll

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; RUN: opt -memcpyopt -instcombine -S %s | FileCheck %s
22
%Foo = type { [2048 x i64] }
33

4+
; Make sure that all mempcy calls are converted to memset calls, or removed.
45
; CHECK-LABEL: @baz(
56
; CHECK-NOT: call void @llvm.memcpy
67
define void @baz() unnamed_addr #0 {

0 commit comments

Comments
 (0)
Please sign in to comment.