[llvm-commits] [llvm] r138630 - in /llvm/trunk/lib/Target/CellSPU: SPUFrameLowering.cpp SPUFrameLowering.h

Kalle Raiskila kalle.raiskila at nokia.com
Fri Aug 26 03:14:56 PDT 2011


Author: kraiskil
Date: Fri Aug 26 05:14:56 2011
New Revision: 138630

URL: http://llvm.org/viewvc/llvm-project?rev=138630&view=rev
Log:
Don't insert branch hint lables that are never used. 

Modified:
    llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.cpp
    llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.h

Modified: llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.cpp?rev=138630&r1=138629&r2=138630&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.cpp Fri Aug 26 05:14:56 2011
@@ -181,18 +181,6 @@
       MachineLocation FPSrc(MachineLocation::VirtualFP);
       Moves.push_back(MachineMove(ReadyLabel, FPDst, FPSrc));
     }
-  } else {
-    // This is a leaf function -- insert a branch hint iff there are
-    // sufficient number instructions in the basic block. Note that
-    // this is just a best guess based on the basic block's size.
-    if (MBB.size() >= (unsigned) SPUFrameLowering::branchHintPenalty()) {
-      MachineBasicBlock::iterator MBBI = MBB.getLastNonDebugInstr();
-      dl = MBBI->getDebugLoc();
-
-      // Insert terminator label
-      BuildMI(MBB, MBBI, dl, TII.get(SPU::PROLOG_LABEL))
-        .addSym(MMI.getContext().CreateTempSymbol());
-    }
   }
 }
 

Modified: llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.h?rev=138630&r1=138629&r2=138630&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.h (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUFrameLowering.h Fri Aug 26 05:14:56 2011
@@ -74,17 +74,6 @@
     static int FItoStackOffset(int frame_index) {
       return frame_index * stackSlotSize();
     }
-    //! Number of instructions required to overcome hint-for-branch latency
-    /*!
-      HBR (hint-for-branch) instructions can be inserted when, for example,
-      we know that a given function is going to be called, such as printf(),
-      in the control flow graph. HBRs are only inserted if a sufficient number
-      of instructions occurs between the HBR and the target. Currently, HBRs
-      take 6 cycles, ergo, the magic number 6.
-     */
-    static int branchHintPenalty() {
-      return 6;
-    }
   };
 }
 





More information about the llvm-commits mailing list