diff options
| author | Sam Parker <sam.parker@arm.com> | 2019-07-26 10:57:42 +0000 |
|---|---|---|
| committer | Sam Parker <sam.parker@arm.com> | 2019-07-26 10:57:42 +0000 |
| commit | 7440065bd818aa1570c4f6d192a08f0f7dd08335 (patch) | |
| tree | 0877748f6c9972a15b46714f5a809f75c62a7932 /llvm/lib/Target/ARM | |
| parent | a424a1f351838d32187063c694c0f405c5e44692 (diff) | |
| download | bcm5719-llvm-7440065bd818aa1570c4f6d192a08f0f7dd08335.tar.gz bcm5719-llvm-7440065bd818aa1570c4f6d192a08f0f7dd08335.zip | |
[NFC][ARM][ParallelDSP] Cleanup isNarrowSequence
Remove unused logic.
llvm-svn: 367099
Diffstat (limited to 'llvm/lib/Target/ARM')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMParallelDSP.cpp | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/llvm/lib/Target/ARM/ARMParallelDSP.cpp b/llvm/lib/Target/ARM/ARMParallelDSP.cpp index 6225fbce802..4e79399bf2a 100644 --- a/llvm/lib/Target/ARM/ARMParallelDSP.cpp +++ b/llvm/lib/Target/ARM/ARMParallelDSP.cpp @@ -335,38 +335,17 @@ bool ARMParallelDSP::AreSequentialLoads(LoadInst *Ld0, LoadInst *Ld1, // why we check that types are equal to MaxBitWidth, and not <= MaxBitWidth. template<unsigned MaxBitWidth> bool ARMParallelDSP::IsNarrowSequence(Value *V, ValueList &VL) { - ConstantInt *CInt; - - if (match(V, m_ConstantInt(CInt))) { - // TODO: if a constant is used, it needs to fit within the bit width. - return false; - } - - auto *I = dyn_cast<Instruction>(V); - if (!I) - return false; - - Value *Val, *LHS, *RHS; - if (match(V, m_Trunc(m_Value(Val)))) { - if (cast<TruncInst>(I)->getDestTy()->getIntegerBitWidth() == MaxBitWidth) - return IsNarrowSequence<MaxBitWidth>(Val, VL); - } else if (match(V, m_Add(m_Value(LHS), m_Value(RHS)))) { - // TODO: we need to implement sadd16/sadd8 for this, which enables to - // also do the rewrite for smlad8.ll, but it is unsupported for now. - return false; - } else if (match(V, m_ZExtOrSExt(m_Value(Val)))) { - if (cast<CastInst>(I)->getSrcTy()->getIntegerBitWidth() != MaxBitWidth) + if (auto *SExt = dyn_cast<SExtInst>(V)) { + if (SExt->getSrcTy()->getIntegerBitWidth() != MaxBitWidth) return false; - if (match(Val, m_Load(m_Value()))) { - auto *Ld = cast<LoadInst>(Val); - + if (auto *Ld = dyn_cast<LoadInst>(SExt->getOperand(0))) { // Check that these load could be paired. if (!LoadPairs.count(Ld) && !OffsetLoads.count(Ld)) return false; - VL.push_back(Val); - VL.push_back(I); + VL.push_back(Ld); + VL.push_back(SExt); return true; } } |

