[PATCH] D51160: Adjust MIScheduler to use ProcResource counts
Jackson Woodruff via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 29 02:14:12 PDT 2018
Jackson added inline comments.
================
Comment at: lib/CodeGen/MachineScheduler.cpp:1937
+/// scheduled. Returns (NextCycle, InstanceIDAssignedTo).
+std::pair<unsigned, unsigned> SchedBoundary::
+getNextResourceCycle(unsigned PIdx, unsigned ResCount, unsigned Cycles) {
----------------
chill wrote:
> I would write it like:
>
>
> ```
> /// Compute the next cycle at which the given processor resource can be
> /// scheduled. Returns (NextCycle, InstanceIDAssignedTo).
> std::pair<unsigned, unsigned> SchedBoundary::
> getNextResourceCycle(unsigned PIdx, unsigned ResCount, unsigned Cycles) {
> unsigned MinNextUnreserved = InvalidCycle;
> unsigned InstanceID = 0;
> unsigned StartIndex = ProcessorResourceList[PIdx];
> unsigned NumUnits = SchedModel->getProcResource(PIdx)->NumUnits;
>
> for (unsigned I = StartIndex, E = StartIndex + NumUnits; I < E; ++I) {
> unsigned NextUnreserved = getNextResourceCycleByInstance(I, Cycles);
> if (NextUnreserved < MinNextUnreserved) {
> InstanceID = I;
> MinNextUnreserved = NextUnreserved;
> }
> }
> return std::make_pair(MinNextUnreserved, InstanceID);
> }
> ```
>
> but YMMV.
Where does `InvalidCycle` come from here?
Repository:
rL LLVM
https://reviews.llvm.org/D51160
More information about the llvm-commits
mailing list