summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJames Molloy <james.molloy@arm.com>2014-05-16 14:24:22 +0000
committerJames Molloy <james.molloy@arm.com>2014-05-16 14:24:22 +0000
commita70697e10eaff415a7c93e7bf4d4875cb2e32ebf (patch)
tree53d8502904367ee503f106992d3fb243ebb29ea2 /llvm/lib
parenta80044571096fd3ea21f0bb53056e449a92b50d1 (diff)
downloadbcm5719-llvm-a70697e10eaff415a7c93e7bf4d4875cb2e32ebf.tar.gz
bcm5719-llvm-a70697e10eaff415a7c93e7bf4d4875cb2e32ebf.zip
Re-enable inline memcpy expansion for Thumb1.
Patch by Moritz Roth! llvm-svn: 208994
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp7
-rw-r--r--llvm/lib/Target/ARM/ARMSubtarget.h4
2 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
index cb5812f6d26..7ce988773c7 100644
--- a/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp
@@ -53,9 +53,10 @@ ARMSelectionDAGInfo::EmitTargetCodeForMemcpy(SelectionDAG &DAG, SDLoc dl,
EVT VT = MVT::i32;
unsigned VTSize = 4;
unsigned i = 0;
- const unsigned MAX_LOADS_IN_LDM = 6;
- SDValue TFOps[MAX_LOADS_IN_LDM];
- SDValue Loads[MAX_LOADS_IN_LDM];
+ // Emit a maximum of 4 loads in Thumb1 since we have fewer registers
+ const unsigned MAX_LOADS_IN_LDM = Subtarget->isThumb1Only() ? 4 : 6;
+ SDValue TFOps[6];
+ SDValue Loads[6];
uint64_t SrcOff = 0, DstOff = 0;
// Emit up to MAX_LOADS_IN_LDM loads, then a TokenFactor barrier, then the
diff --git a/llvm/lib/Target/ARM/ARMSubtarget.h b/llvm/lib/Target/ARM/ARMSubtarget.h
index 77e47193423..fd106f6fc86 100644
--- a/llvm/lib/Target/ARM/ARMSubtarget.h
+++ b/llvm/lib/Target/ARM/ARMSubtarget.h
@@ -239,9 +239,7 @@ protected:
/// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
/// that still makes it profitable to inline the call.
unsigned getMaxInlineSizeThreshold() const {
- // FIXME: For now, we don't lower memcpy's to loads / stores for Thumb1.
- // Change this once Thumb1 ldmia / stmia support is added.
- return isThumb1Only() ? 0 : 64;
+ return 64;
}
/// ParseSubtargetFeatures - Parses features string setting specified
/// subtarget options. Definition of function is auto generated by tblgen.
OpenPOWER on IntegriCloud