Add address space argument to allowsUnalignedMemoryAccess.

On R600, some address spaces have more strict alignment
requirements than others.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200887 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Matt Arsenault
2014-02-05 23:15:53 +00:00
parent df7da79db6
commit bb7bf85f3c
16 changed files with 42 additions and 23 deletions

View File

@@ -713,14 +713,16 @@ public:
/// \brief Determine if the target supports unaligned memory accesses.
///
/// This function returns true if the target allows unaligned memory accesses.
/// of the specified type. If true, it also returns whether the unaligned
/// memory access is "fast" in the second argument by reference. This is used,
/// for example, in situations where an array copy/move/set is converted to a
/// sequence of store operations. It's use helps to ensure that such
/// replacements don't generate code that causes an alignment error (trap) on
/// the target machine.
virtual bool allowsUnalignedMemoryAccesses(EVT, bool * /*Fast*/ = 0) const {
/// This function returns true if the target allows unaligned memory accesses
/// of the specified type in the given address space. If true, it also returns
/// whether the unaligned memory access is "fast" in the third argument by
/// reference. This is used, for example, in situations where an array
/// copy/move/set is converted to a sequence of store operations. Its use
/// helps to ensure that such replacements don't generate code that causes an
/// alignment error (trap) on the target machine.
virtual bool allowsUnalignedMemoryAccesses(EVT,
unsigned AddrSpace = 0,
bool * /*Fast*/ = 0) const {
return false;
}