llvm.org GIT mirror llvm / 943f7f4
[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 Tim Shen 3 years ago
2 changed file(s) with 3 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
11091109 MemSetInst *MemSet) {
11101110 AliasAnalysis &AA = LookupAliasAnalysis();
11111111
1112 // This only makes sense on memcpy(..., memset(...), ...).
1112 // Make sure that memcpy(..., memset(...), ...), that is we are memsetting and
1113 // memcpying from the same address. Otherwise it is hard to reason about.
11131114 if (!AA.isMustAlias(MemSet->getRawDest(), MemCpy->getRawSource()))
11141115 return false;
11151116
0 ; RUN: opt -memcpyopt -instcombine -S %s | FileCheck %s
11 %Foo = type { [2048 x i64] }
22
3 ; Make sure that all mempcy calls are converted to memset calls, or removed.
34 ; CHECK-LABEL: @baz(
45 ; CHECK-NOT: call void @llvm.memcpy
56 define void @baz() unnamed_addr #0 {