summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorHiroshi Inoue <inouehrs@jp.ibm.com>2017-06-24 15:17:38 +0000
committerHiroshi Inoue <inouehrs@jp.ibm.com>2017-06-24 15:17:38 +0000
commit95f24dca98e63f14c3ab2585cb37e76839fc120f (patch)
treeeddbdea4a23844dd96b54089e62ddbe031dbf830 /llvm/include
parent4bba4ba5bae3a18ea8cbde0e99ab2416bc0ea8e5 (diff)
downloadbcm5719-llvm-95f24dca98e63f14c3ab2585cb37e76839fc120f.tar.gz
bcm5719-llvm-95f24dca98e63f14c3ab2585cb37e76839fc120f.zip
[SelectionDAG] set dereferenceable flag when expanding memcpy/memmove
When SelectionDAG expands memcpy (or memmove) call into a sequence of load and store instructions, it disregards dereferenceable flag even the source pointer is known to be dereferenceable. This results in an assertion failure if SelectionDAG commonizes a load instruction generated for memcpy with another load instruction for the source pointer. This patch makes SelectionDAG to set the dereferenceable flag for the load instructions properly to avoid the assertion failure. Differential Revision: https://reviews.llvm.org/D34467 llvm-svn: 306209
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/CodeGen/MachineMemOperand.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineMemOperand.h b/llvm/include/llvm/CodeGen/MachineMemOperand.h
index 4d83f27eac3..78adce507b8 100644
--- a/llvm/include/llvm/CodeGen/MachineMemOperand.h
+++ b/llvm/include/llvm/CodeGen/MachineMemOperand.h
@@ -59,6 +59,11 @@ struct MachinePointerInfo {
return MachinePointerInfo(V.get<const PseudoSourceValue*>(), Offset+O);
}
+ /// Return true if memory region [V, V+Offset+Size) is known to be
+ /// dereferenceable.
+ bool isDereferenceable(unsigned Size, LLVMContext &C,
+ const DataLayout &DL) const;
+
/// Return the LLVM IR address space number that this pointer points into.
unsigned getAddrSpace() const;
OpenPOWER on IntegriCloud