mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 15:13:49 -04:00
AMDGPU: Avoid constructing new std::vector in initCandidate
Approximately 30% of the time was spent in the std::vector constructor. In one testcase this pushes the scheduler to being the second slowest pass. I'm not sure I understand why these vector are necessary. The default scheduler initCandidate seems to use some pre-existing vectors for the pressure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371136 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -71,8 +71,8 @@ void GCNMaxOccupancySchedStrategy::initCandidate(SchedCandidate &Cand, SUnit *SU
|
||||
// the tracker, so we need to pass those function a non-const copy.
|
||||
RegPressureTracker &TempTracker = const_cast<RegPressureTracker&>(RPTracker);
|
||||
|
||||
std::vector<unsigned> Pressure;
|
||||
std::vector<unsigned> MaxPressure;
|
||||
Pressure.clear();
|
||||
MaxPressure.clear();
|
||||
|
||||
if (AtTop)
|
||||
TempTracker.getDownwardPressure(SU->getInstr(), Pressure, MaxPressure);
|
||||
|
||||
@@ -40,6 +40,9 @@ class GCNMaxOccupancySchedStrategy final : public GenericScheduler {
|
||||
const SIRegisterInfo *SRI,
|
||||
unsigned SGPRPressure, unsigned VGPRPressure);
|
||||
|
||||
std::vector<unsigned> Pressure;
|
||||
std::vector<unsigned> MaxPressure;
|
||||
|
||||
unsigned SGPRExcessLimit;
|
||||
unsigned VGPRExcessLimit;
|
||||
unsigned SGPRCriticalLimit;
|
||||
|
||||
Reference in New Issue
Block a user