diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-12 17:14:03 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-06-12 17:14:03 +0000 |
commit | 4e0648a541f7a1da3cbda804d9cbce04c0843c30 (patch) | |
tree | 622be785880c58ae1126027b83973577ef2909cf /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | 5b0e0dd709f96cb987cd3178217517b45ee1febb (diff) | |
download | bcm5719-llvm-4e0648a541f7a1da3cbda804d9cbce04c0843c30.tar.gz bcm5719-llvm-4e0648a541f7a1da3cbda804d9cbce04c0843c30.zip |
[TargetLowering] Add MachineMemOperand::Flags to allowsMemoryAccess tests (PR42123)
As discussed on D62910, we need to check whether particular types of memory access are allowed, not just their alignment/address-space.
This NFC patch adds a MachineMemOperand::Flags argument to allowsMemoryAccess and allowsMisalignedMemoryAccesses, and wires up calls to pass the relevant flags to them.
If people are happy with this approach I can then update X86TargetLowering::allowsMisalignedMemoryAccesses to handle misaligned NT load/stores.
Differential Revision: https://reviews.llvm.org/D63075
llvm-svn: 363179
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index cbc9472c17d..1fd3d38255e 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1464,6 +1464,7 @@ bool TargetLoweringBase::allowsMemoryAccess(LLVMContext &Context, const DataLayout &DL, EVT VT, unsigned AddrSpace, unsigned Alignment, + MachineMemOperand::Flags Flags, bool *Fast) const { // Check if the specified alignment is sufficient based on the data layout. // TODO: While using the data layout works in practice, a better solution @@ -1479,7 +1480,7 @@ bool TargetLoweringBase::allowsMemoryAccess(LLVMContext &Context, } // This is a misaligned access. - return allowsMisalignedMemoryAccesses(VT, AddrSpace, Alignment, Fast); + return allowsMisalignedMemoryAccesses(VT, AddrSpace, Alignment, Flags, Fast); } bool TargetLoweringBase::allowsMemoryAccess(LLVMContext &Context, @@ -1487,7 +1488,7 @@ bool TargetLoweringBase::allowsMemoryAccess(LLVMContext &Context, const MachineMemOperand &MMO, bool *Fast) const { return allowsMemoryAccess(Context, DL, VT, MMO.getAddrSpace(), - MMO.getAlignment(), Fast); + MMO.getAlignment(), MMO.getFlags(), Fast); } BranchProbability TargetLoweringBase::getPredictableBranchThreshold() const { |