1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00

[MemCpy] Add comments for r279769

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

llvm-svn: 279778
This commit is contained in:
Tim Shen 2016-08-25 21:03:46 +00:00
parent da6e8b3dc0
commit a8864abefc
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 {