summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-09-05 22:44:06 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-09-05 22:44:06 +0000
commitf54daffc2d73866312e6f50b75fe15035e62b4e8 (patch)
tree828fbb8a0ade62ef05e8c3176ff5ba31bf2efd1e /llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
parent3e144ab7fd0fb516b4819504aa423a70cd6732e9 (diff)
downloadbcm5719-llvm-f54daffc2d73866312e6f50b75fe15035e62b4e8.tar.gz
bcm5719-llvm-f54daffc2d73866312e6f50b75fe15035e62b4e8.zip
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. llvm-svn: 371136
Diffstat (limited to 'llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp')
-rw-r--r--llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
index 4ea990ae490..3861cc674e5 100644
--- a/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+++ b/llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
@@ -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);
OpenPOWER on IntegriCloud