Differential Revision: https://reviews.llvm.org/D23846
llvm-svn: 279778
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;
; 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 {