diff options
author | Sam Parker <sam.parker@arm.com> | 2019-07-26 14:11:40 +0000 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2019-07-26 14:11:40 +0000 |
commit | 3da59e55138dfa3dab23b113e765eeefb9ee311d (patch) | |
tree | 9734c16a3611426f8b3d434d89bf2f4583ef6098 /llvm/lib/Target/ARM/ARMParallelDSP.cpp | |
parent | 76ba1cf1f1e80c75b3ae943d86e8531bc2eeec2b (diff) | |
download | llvm-3da59e55138dfa3dab23b113e765eeefb9ee311d.zip llvm-3da59e55138dfa3dab23b113e765eeefb9ee311d.tar.gz llvm-3da59e55138dfa3dab23b113e765eeefb9ee311d.tar.bz2 |
[ARM][ParallelDSP] Combine structs
Combine OpChain and BinOpChain structs as OpChain is a base class to
BinOpChain that is never used.
llvm-svn: 367114
Diffstat (limited to 'llvm/lib/Target/ARM/ARMParallelDSP.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMParallelDSP.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/llvm/lib/Target/ARM/ARMParallelDSP.cpp b/llvm/lib/Target/ARM/ARMParallelDSP.cpp index 4e79399..0e48ba4 100644 --- a/llvm/lib/Target/ARM/ARMParallelDSP.cpp +++ b/llvm/lib/Target/ARM/ARMParallelDSP.cpp @@ -50,7 +50,7 @@ namespace { struct BinOpChain; class Reduction; - using OpChainList = SmallVector<std::unique_ptr<OpChain>, 8>; + using OpChainList = SmallVector<std::unique_ptr<BinOpChain>, 8>; using ReductionList = SmallVector<Reduction, 8>; using ValueList = SmallVector<Value*, 8>; using MemInstList = SmallVector<LoadInst*, 8>; @@ -59,15 +59,25 @@ namespace { using Instructions = SmallVector<Instruction*,16>; using MemLocList = SmallVector<MemoryLocation, 4>; - 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); }; |