summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorClement Courbet <courbet@google.com>2018-02-08 08:46:48 +0000
committerClement Courbet <courbet@google.com>2018-02-08 08:46:48 +0000
commit39911e2ee6c03086ea23dd58d5fdc95d137e1b6f (patch)
treef0ddb8132ac91ffef21b09d5308d9665ff3c4bfe /llvm/include
parent5ea465ded7ef9e48a390ec60961096d8a7caf105 (diff)
downloadbcm5719-llvm-39911e2ee6c03086ea23dd58d5fdc95d137e1b6f.tar.gz
bcm5719-llvm-39911e2ee6c03086ea23dd58d5fdc95d137e1b6f.zip
[TargetSchedule] Expose sub-units of a ProcResGroup in MCProcResourceDesc.
Summary: Right now using a ProcResource automatically counts as usage of all super ProcResGroups. All this is done during codegen, so there is no way for schedulers to get this information at runtime. This adds the information of which individual ProcRes units are contained in a ProcResGroup in MCProcResourceDesc. Reviewers: gchatelet Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43023 llvm-svn: 324582
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCSchedule.h5
-rw-r--r--llvm/include/llvm/Target/TargetSchedule.td3
2 files changed, 6 insertions, 2 deletions
diff --git a/llvm/include/llvm/MC/MCSchedule.h b/llvm/include/llvm/MC/MCSchedule.h
index a79afe163e6..6331fa86d31 100644
--- a/llvm/include/llvm/MC/MCSchedule.h
+++ b/llvm/include/llvm/MC/MCSchedule.h
@@ -44,6 +44,11 @@ struct MCProcResourceDesc {
// an out-of-order cpus.
int BufferSize;
+ // If the resource has sub-units, a pointer to the first element of an array
+ // of `NumUnits` elements containing the ProcResourceIdx of the sub units.
+ // nullptr if the resource does not have sub-units.
+ const unsigned *SubUnitsIdxBegin;
+
bool operator==(const MCProcResourceDesc &Other) const {
return NumUnits == Other.NumUnits && SuperIdx == Other.SuperIdx
&& BufferSize == Other.BufferSize;
diff --git a/llvm/include/llvm/Target/TargetSchedule.td b/llvm/include/llvm/Target/TargetSchedule.td
index 7b00c9420e3..8ac8da84e88 100644
--- a/llvm/include/llvm/Target/TargetSchedule.td
+++ b/llvm/include/llvm/Target/TargetSchedule.td
@@ -175,8 +175,7 @@ class ProcResourceKind;
// BufferSize=1.
//
// SchedModel ties these units to a processor for any stand-alone defs
-// of this class. Instances of subclass ProcResource will be automatically
-// attached to a processor, so SchedModel is not needed.
+// of this class.
class ProcResourceUnits<ProcResourceKind kind, int num> {
ProcResourceKind Kind = kind;
int NumUnits = num;
OpenPOWER on IntegriCloud