aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineScheduler.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2014-01-22 03:38:55 +0000
committerAndrew Trick <atrick@apple.com>2014-01-22 03:38:55 +0000
commit4675351afd361861a704fac801af2bbc60a6b721 (patch)
tree6dd941b2f5b3e8eead200dd39cfad9a7ac01745f /llvm/lib/CodeGen/MachineScheduler.cpp
parenta6ae1209dfd836b216459dbb6bc2704f7809201f (diff)
downloadllvm-4675351afd361861a704fac801af2bbc60a6b721.zip
llvm-4675351afd361861a704fac801af2bbc60a6b721.tar.gz
llvm-4675351afd361861a704fac801af2bbc60a6b721.tar.bz2
Reformat a loop for basic hygeine. Self review.
llvm-svn: 199788
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineScheduler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/MachineScheduler.cpp b/llvm/lib/CodeGen/MachineScheduler.cpp
index 4812b30..2de3d20 100644
--- a/llvm/lib/CodeGen/MachineScheduler.cpp
+++ b/llvm/lib/CodeGen/MachineScheduler.cpp
@@ -2527,17 +2527,17 @@ void GenericScheduler::initPolicy(MachineBasicBlock::iterator Begin,
MachineBasicBlock::iterator End,
unsigned NumRegionInstrs) {
const TargetMachine &TM = Context->MF->getTarget();
+ const TargetLowering *TLI = TM.getTargetLowering();
// Avoid setting up the register pressure tracker for small regions to save
// compile time. As a rough heuristic, only track pressure when the number of
// schedulable instructions exceeds half the integer register file.
RegionPolicy.ShouldTrackPressure = true;
- unsigned LegalIntVT = MVT::i32;
- for (; LegalIntVT > (unsigned)MVT::i1; --LegalIntVT) {
- if (TM.getTargetLowering()->isTypeLegal((MVT::SimpleValueType)LegalIntVT)) {
+ for (unsigned VT = MVT::i32; VT > (unsigned)MVT::i1; --VT) {
+ MVT::SimpleValueType LegalIntVT = (MVT::SimpleValueType)VT;
+ if (TLI->isTypeLegal(LegalIntVT)) {
unsigned NIntRegs = Context->RegClassInfo->getNumAllocatableRegs(
- TM.getTargetLowering()->getRegClassFor(
- (MVT::SimpleValueType)LegalIntVT));
+ TLI->getRegClassFor(LegalIntVT));
RegionPolicy.ShouldTrackPressure = NumRegionInstrs > (NIntRegs / 2);
}
}