-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to: - added "-debug-only dfa-emitter" support to llvm-tblgen - defined CVI_PIPE* resources for the V60 vector coprocessor - allow specification of multiple required resources - supports ANDs of ORs - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means: (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1) - added support for combo resources - allows specifying ORs of ANDs - e.g. [CVI_XLSHF, CVI_MPY01] means: (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1) - increased DFA input size from 32-bit to 64-bit - allows for a maximum of 4 AND'ed terms of 16 resources - supported expressions now include: expression => term [AND term] [AND term] [AND term] term => resource [OR resource]* resource => one_resource | combo_resource combo_resource => (one_resource [AND one_resource]*) Author: Dan Palermo <dpalermo@codeaurora.org> kparzysz: Verified AMDGPU codegen to be unchanged on all llc tests, except those dealing with instruction encodings. Reapply the previous patch, this time without circular dependencies. llvm-svn: 253793
- Loading branch information
Krzysztof Parzyszek
committed
Nov 21, 2015
1 parent
a5ea528
commit b465572
Showing
6 changed files
with
668 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
//=- llvm/CodeGen/DFAPacketizerDefs.h - DFA Packetizer for VLIW ---*- C++ -*-=// | ||
// | ||
// The LLVM Compiler Infrastructure | ||
// | ||
// This file is distributed under the University of Illinois Open Source | ||
// License. See LICENSE.TXT for details. | ||
// | ||
//===----------------------------------------------------------------------===// | ||
// Common definitions used by TableGen and the DFAPacketizer in CodeGen. | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_CODEGEN_DFAPACKETIZERDEFS_H | ||
#define LLVM_CODEGEN_DFAPACKETIZERDEFS_H | ||
|
||
#include <vector> | ||
|
||
namespace llvm { | ||
|
||
// DFA_MAX_RESTERMS * DFA_MAX_RESOURCES must fit within sizeof DFAInput. | ||
// This is verified in DFAPacketizer.cpp:DFAPacketizer::DFAPacketizer. | ||
// | ||
// e.g. terms x resource bit combinations that fit in uint32_t: | ||
// 4 terms x 8 bits = 32 bits | ||
// 3 terms x 10 bits = 30 bits | ||
// 2 terms x 16 bits = 32 bits | ||
// | ||
// e.g. terms x resource bit combinations that fit in uint64_t: | ||
// 8 terms x 8 bits = 64 bits | ||
// 7 terms x 9 bits = 63 bits | ||
// 6 terms x 10 bits = 60 bits | ||
// 5 terms x 12 bits = 60 bits | ||
// 4 terms x 16 bits = 64 bits <--- current | ||
// 3 terms x 21 bits = 63 bits | ||
// 2 terms x 32 bits = 64 bits | ||
// | ||
#define DFA_MAX_RESTERMS 4 // The max # of AND'ed resource terms. | ||
#define DFA_MAX_RESOURCES 16 // The max # of resource bits in one term. | ||
|
||
typedef uint64_t DFAInput; | ||
typedef int64_t DFAStateInput; | ||
#define DFA_TBLTYPE "int64_t" // For generating DFAStateInputTable. | ||
|
||
namespace { | ||
DFAInput addDFAFuncUnits(DFAInput Inp, unsigned FuncUnits) { | ||
return (Inp << DFA_MAX_RESOURCES) | FuncUnits; | ||
} | ||
|
||
/// Return the DFAInput for an instruction class input vector. | ||
/// This function is used in both DFAPacketizer.cpp and in | ||
/// DFAPacketizerEmitter.cpp. | ||
DFAInput getDFAInsnInput(const std::vector<unsigned> &InsnClass) { | ||
DFAInput InsnInput = 0; | ||
assert ((InsnClass.size() <= DFA_MAX_RESTERMS) && | ||
"Exceeded maximum number of DFA terms"); | ||
for (auto U : InsnClass) | ||
InsnInput = addDFAFuncUnits(InsnInput, U); | ||
return InsnInput; | ||
} | ||
} | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.