summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-12-12 01:32:07 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-12-12 01:32:07 +0000
commitc3d1aca657a1cf90858a493e783c15310f53b011 (patch)
treef9c031a6e6ed42bebe43d0a37ae14c9802b985fa /llvm/lib/CodeGen
parent4fa2e3d5af7b81c626c1c63931f807bfab096ab7 (diff)
downloadbcm5719-llvm-c3d1aca657a1cf90858a493e783c15310f53b011.tar.gz
bcm5719-llvm-c3d1aca657a1cf90858a493e783c15310f53b011.zip
- Rename isLegalMemOpType to isSafeMemOpType. "Legal" is a very overloade term.
Also added more comments to explain why it is generally ok to return true. - Rename getOptimalMemOpType argument IsZeroVal to ZeroOrLdSrc. It's meant to be true for loaded source (memcpy) or zero constants (memset). The poor name choice is probably some kind of legacy issue. llvm-svn: 169954
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 36592e54f8f..754e6f352d4 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -3426,7 +3426,7 @@ static bool isMemSrcFromString(SDValue Src, StringRef &Str) {
static bool FindOptimalMemOpLowering(std::vector<EVT> &MemOps,
unsigned Limit, uint64_t Size,
unsigned DstAlign, unsigned SrcAlign,
- bool IsZeroVal,
+ bool ZeroOrLdSrc,
bool MemcpyStrSrc,
bool AllowOverlap,
SelectionDAG &DAG,
@@ -3441,7 +3441,7 @@ static bool FindOptimalMemOpLowering(std::vector<EVT> &MemOps,
// 'MemcpyStrSrc' indicates whether the memcpy source is constant so it does
// not need to be loaded.
EVT VT = TLI.getOptimalMemOpType(Size, DstAlign, SrcAlign,
- IsZeroVal, MemcpyStrSrc,
+ ZeroOrLdSrc, MemcpyStrSrc,
DAG.getMachineFunction());
if (VT == MVT::Other) {
@@ -3481,11 +3481,11 @@ static bool FindOptimalMemOpLowering(std::vector<EVT> &MemOps,
if (VT.isVector() || VT.isFloatingPoint()) {
NewVT = (VT.getSizeInBits() > 64) ? MVT::i64 : MVT::i32;
if (TLI.isOperationLegalOrCustom(ISD::STORE, NewVT) &&
- TLI.isLegalMemOpType(NewVT.getSimpleVT()))
+ TLI.isSafeMemOpType(NewVT.getSimpleVT()))
Found = true;
else if (NewVT == MVT::i64 &&
TLI.isOperationLegalOrCustom(ISD::STORE, MVT::f64) &&
- TLI.isLegalMemOpType(MVT::f64)) {
+ TLI.isSafeMemOpType(MVT::f64)) {
// i64 is usually not legal on 32-bit targets, but f64 may be.
NewVT = MVT::f64;
Found = true;
@@ -3497,7 +3497,7 @@ static bool FindOptimalMemOpLowering(std::vector<EVT> &MemOps,
NewVT = (MVT::SimpleValueType)(NewVT.getSimpleVT().SimpleTy - 1);
if (NewVT == MVT::i8)
break;
- } while (!TLI.isLegalMemOpType(NewVT.getSimpleVT()));
+ } while (!TLI.isSafeMemOpType(NewVT.getSimpleVT()));
}
NewVTSize = NewVT.getSizeInBits() / 8;
OpenPOWER on IntegriCloud