]> granicus.if.org Git - llvm/commit
[MachineScheduler] Minor refactoring.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 25 Oct 2017 08:23:33 +0000 (08:23 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Wed, 25 Oct 2017 08:23:33 +0000 (08:23 +0000)
commit18622837188e1a13ccfd3fc8014cd7edd68e2b8f
tree9f4fb897aa4dd8abd8b8969abb3baa9a1e3e85de
parent1efa535c779f2f59e8b798c93cbdd9078eef149d
[MachineScheduler]  Minor refactoring.

Duplicated code found in three places put into a new static function:

/// Given a Count of resource usage and a Latency value, return true if a
/// SchedBoundary becomes resource limited.
static bool checkResourceLimit(unsigned LFactor, unsigned Count,
                               unsigned Latency) {
  return (int)(Count - (Latency * LFactor)) > (int)LFactor;
}

Review: Florian Hahn, Matthias Braun
https://reviews.llvm.org/D39235

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316560 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineScheduler.cpp