summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMISelLowering.cpp
diff options
context:
space:
mode:
authorJohn Brawn <john.brawn@arm.com>2017-05-26 13:59:12 +0000
committerJohn Brawn <john.brawn@arm.com>2017-05-26 13:59:12 +0000
commit9009d2905debfc210859e5d20a1fb3ec319a9ce7 (patch)
tree93ad3b86753bdbce6d9657acf75739ae0d92f12d /llvm/lib/Target/ARM/ARMISelLowering.cpp
parentba9d8ba82aab927dd8e132c947cd64efff4e09d1 (diff)
downloadbcm5719-llvm-9009d2905debfc210859e5d20a1fb3ec319a9ce7.tar.gz
bcm5719-llvm-9009d2905debfc210859e5d20a1fb3ec319a9ce7.zip
[ARM] Fix lowering of misaligned memcpy/memset
Currently getOptimalMemOpType returns i32 for large enough sizes without checking for alignment, leading to poor code generation when misaligned accesses aren't permitted as we generate a word store then later split it up into byte stores. This means we inadvertantly go over the MaxStoresPerMemcpy limit and for memset we splat the memset value into a word then immediately split it up again. Fix this by leaving it up to FindOptimalMemOpLowering to figure out which type to use, but also fix a bug there where it wasn't correctly checking if misaligned memory accesses are allowed. Differential Revision: https://reviews.llvm.org/D33442 llvm-svn: 303990
Diffstat (limited to 'llvm/lib/Target/ARM/ARMISelLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMISelLowering.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp
index 4bfb9b01656..62e774d869d 100644
--- a/llvm/lib/Target/ARM/ARMISelLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp
@@ -12147,12 +12147,6 @@ EVT ARMTargetLowering::getOptimalMemOpType(uint64_t Size,
}
}
- // Lowering to i32/i16 if the size permits.
- if (Size >= 4)
- return MVT::i32;
- else if (Size >= 2)
- return MVT::i16;
-
// Let the target-independent logic figure it out.
return MVT::Other;
}
OpenPOWER on IntegriCloud