aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCopyPropagation.cpp
diff options
context:
space:
mode:
authorFrancesco Petrogalli <francesco.petrogalli@apple.com>2023-06-09 09:06:48 +0200
committerFrancesco Petrogalli <francesco.petrogalli@apple.com>2023-06-09 13:00:50 +0200
commitdc312f0331309692e8d6e06e93b3492b6a40989f (patch)
tree686264fd484b343164792bfe31e284cd8f06ff6b /llvm/lib/CodeGen/MachineCopyPropagation.cpp
parent389a8c298e8b5c20373dd9837e2b46dfcddc88de (diff)
downloadllvm-dc312f0331309692e8d6e06e93b3492b6a40989f.zip
llvm-dc312f0331309692e8d6e06e93b3492b6a40989f.tar.gz
llvm-dc312f0331309692e8d6e06e93b3492b6a40989f.tar.bz2
[MISched] Introduce and use ResourceSegments.
The class `ResourceSegments` is used to keep track of the intervals that represent resource usage of a list of instructions that are being scheduled by the machine scheduler. The collection is made of intervals that are closed on the left and open on the right (represented by the standard notation `[a, b)`). These collections of intervals can be extended by `add`ing new intervals accordingly while scheduling a basic block. Unit tests are added to verify the possible configurations of intervals, and the relative possibility of scheduling a new instruction in these configurations. Specifically, the methods `getFirstAvailableAtFromBottom` and `getFirstAvailableAtFromTop` are tested to make sure that both bottom-up and top-down scheduling work when tracking resource usage across the basic block with `ResourceSegments`. Note that the scheduler tracks resource usage with two methods: 1. counters (via `std::vector<unsigned> ReservedCycles;`); 2. intervals (via `std::map<unsigned, ResourceSegments> ReservedResourceSegments;`). This patch can be considered a NFC test for existing scheduling models because the tracking system that uses intervals is turned off by default (field `bit EnableIntervals = false;` in the tablegen class `SchedMachineModel`). Reviewed By: andreadb Differential Revision: https://reviews.llvm.org/D150312
Diffstat (limited to 'llvm/lib/CodeGen/MachineCopyPropagation.cpp')
0 files changed, 0 insertions, 0 deletions