[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)
commit238c14b6c7970b1d6f48ef2c5ad35c772f1dee3d
treefd0d0274e868ff656924367cdc63726e063b14dd
parentdd45ea16f3e4ed9aba5b5f70d35edaa15abcf354
[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

llvm-svn: 316560
llvm/lib/CodeGen/MachineScheduler.cpp