From: Sam Parker Date: Fri, 26 Jul 2019 14:11:40 +0000 (+0000) Subject: [ARM][ParallelDSP] Combine structs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81923278de077274c5e2889c7e9eb1b71e0e7668;p=llvm [ARM][ParallelDSP] Combine structs Combine OpChain and BinOpChain structs as OpChain is a base class to BinOpChain that is never used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367114 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARMParallelDSP.cpp b/lib/Target/ARM/ARMParallelDSP.cpp index 4e79399bf2a..0e48ba4c7a4 100644 --- a/lib/Target/ARM/ARMParallelDSP.cpp +++ b/lib/Target/ARM/ARMParallelDSP.cpp @@ -50,7 +50,7 @@ namespace { struct BinOpChain; class Reduction; - using OpChainList = SmallVector, 8>; + using OpChainList = SmallVector, 8>; using ReductionList = SmallVector; using ValueList = SmallVector; using MemInstList = SmallVector; @@ -59,15 +59,25 @@ namespace { using Instructions = SmallVector; using MemLocList = SmallVector; - struct OpChain { + // 'BinOpChain' holds the multiplication instructions that are candidates + // for parallel execution. + struct BinOpChain { Instruction *Root; ValueList AllValues; - MemInstList VecLd; // List of all load instructions. MemInstList Loads; + MemInstList VecLd; // List of all load instructions. + ValueList LHS; // List of all (narrow) left hand operands. + ValueList RHS; // List of all (narrow) right hand operands. + bool Exchange = false; bool ReadOnly = true; - OpChain(Instruction *I, ValueList &vl) : Root(I), AllValues(vl) { } - virtual ~OpChain() = default; + BinOpChain(Instruction *I, ValueList &lhs, ValueList &rhs) : + Root(I), LHS(lhs), RHS(rhs) { + for (auto *V : LHS) + AllValues.push_back(V); + for (auto *V : RHS) + AllValues.push_back(V); + } void PopulateLoads() { for (auto *V : AllValues) { @@ -77,20 +87,6 @@ namespace { } unsigned size() const { return AllValues.size(); } - }; - - // 'BinOpChain' holds the multiplication instructions that are candidates - // for parallel execution. - struct BinOpChain : public OpChain { - ValueList LHS; // List of all (narrow) left hand operands. - ValueList RHS; // List of all (narrow) right hand operands. - bool Exchange = false; - - BinOpChain(Instruction *I, ValueList &lhs, ValueList &rhs) : - OpChain(I, lhs), LHS(lhs), RHS(rhs) { - for (auto *V : RHS) - AllValues.push_back(V); - } bool AreSymmetrical(BinOpChain *Other); };