[llvm] r199788 - Reformat a loop for basic hygeine. Self review.

Andrew Trick atrick at apple.com
Tue Jan 21 19:38:55 PST 2014


Author: atrick
Date: Tue Jan 21 21:38:55 2014
New Revision: 199788

URL: http://llvm.org/viewvc/llvm-project?rev=199788&view=rev
Log:
Reformat a loop for basic hygeine. Self review.

Modified:
    llvm/trunk/lib/CodeGen/MachineScheduler.cpp

Modified: llvm/trunk/lib/CodeGen/MachineScheduler.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineScheduler.cpp?rev=199788&r1=199787&r2=199788&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineScheduler.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineScheduler.cpp Tue Jan 21 21:38:55 2014
@@ -2527,17 +2527,17 @@ void GenericScheduler::initPolicy(Machin
                                   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);
     }
   }





More information about the llvm-commits mailing list