[MemCpy] Add comments for r279769

Differential Revision: https://reviews.llvm.org/D23846

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Shen 2016-08-25 21:03:46 +00:00
parent fdda55bb96
commit 943f7f4327
2 changed files with 3 additions and 1 deletions

View File

@ -1110,7 +1110,8 @@ bool MemCpyOptPass::performMemCpyToMemSetOptzn(MemCpyInst *MemCpy,
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;

View File

@ -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 {