aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/CodeGen/MachineMemOperand.h
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
commit4ef4569846efe0da076f5fb57b2c4dbf19acfbd3 (patch)
tree304d5652bfa51feb4bd5ff435c4e5283d27fcb6f /include/llvm/CodeGen/MachineMemOperand.h
parent019a3a4d88615eb0bb6d625b03d69d6ed8f313c3 (diff)
downloadllvm-4ef4569846efe0da076f5fb57b2c4dbf19acfbd3.tar.gz
[SelectionDAG] set dereferenceable flag when expanding memcpy/memmoveupstream-mirror
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineMemOperand.h')
-rw-r--r--include/llvm/CodeGen/MachineMemOperand.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineMemOperand.h b/include/llvm/CodeGen/MachineMemOperand.h
index 4d83f27eac3..78adce507b8 100644
--- a/include/llvm/CodeGen/MachineMemOperand.h
+++ b/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;