diff options
author | Evan Cheng <evan.cheng@apple.com> | 2012-12-12 01:32:07 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2012-12-12 01:32:07 +0000 |
commit | 7d34267df63e23be1957f738de783c145febb7af (patch) | |
tree | bb7a110bd20e45275e9dfb02c9adf192fccb72c4 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 6c645a35ccc658b20506d3137890d9003edd3527 (diff) |
- 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 36592e54f8..754e6f352d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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; |