diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-12-12 00:42:09 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-12-12 00:42:09 +0000 |
commit | 04e5518783fa3eb679cecc14c9ea3c3c60fa7cb4 (patch) | |
tree | cbbbee24683b190be3d31bb90076a8ff69e6d78d /llvm/lib/Target/ARM | |
parent | d2b05e59b5e96dce2c1b54c6f96f87f5bab5887e (diff) | |
download | bcm5719-llvm-04e5518783fa3eb679cecc14c9ea3c3c60fa7cb4.tar.gz bcm5719-llvm-04e5518783fa3eb679cecc14c9ea3c3c60fa7cb4.zip |
Avoid using lossy load / stores for memcpy / memset expansion. e.g.
f64 load / store on non-SSE2 x86 targets.
llvm-svn: 169944
Diffstat (limited to 'llvm/lib/Target/ARM')
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/Target/ARM/ARMISelLowering.h | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMISelLowering.cpp b/llvm/lib/Target/ARM/ARMISelLowering.cpp index 88282c7331b..de7159e474a 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.cpp +++ b/llvm/lib/Target/ARM/ARMISelLowering.cpp @@ -9481,6 +9481,10 @@ EVT ARMTargetLowering::getOptimalMemOpType(uint64_t Size, return MVT::Other; } +bool ARMTargetLowering::isLegalMemOpType(MVT VT) const { + return VT.isInteger() || VT == MVT::f64 || VT == MVT::v2f64; +} + bool ARMTargetLowering::isZExtFree(SDValue Val, EVT VT2) const { if (Val.getOpcode() != ISD::LOAD) return false; diff --git a/llvm/lib/Target/ARM/ARMISelLowering.h b/llvm/lib/Target/ARM/ARMISelLowering.h index 5a44201ec48..3e78ae3b2d5 100644 --- a/llvm/lib/Target/ARM/ARMISelLowering.h +++ b/llvm/lib/Target/ARM/ARMISelLowering.h @@ -296,6 +296,13 @@ namespace llvm { bool MemcpyStrSrc, MachineFunction &MF) const; + /// isLegalMemOpType - Returns true if it's legal to use load / store of the + /// specified type to expand memcpy / memset inline. This is mostly true + /// for legal types except for some special cases. For example, on X86 + /// targets without SSE2 f64 load / store are done with fldl / fstpl which + /// also does type conversion. + virtual bool isLegalMemOpType(MVT VT) const; + using TargetLowering::isZExtFree; virtual bool isZExtFree(SDValue Val, EVT VT2) const; |