mirror of
https://github.com/RPCSX/llvm.git
synced 2024-11-24 12:19:53 +00:00
[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:
parent
fdda55bb96
commit
943f7f4327
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user