Don't insert branch hint lables that are never used.
authorKalle Raiskila <kalle.raiskila@nokia.com>
Fri, 26 Aug 2011 10:14:56 +0000 (10:14 +0000)
committerKalle Raiskila <kalle.raiskila@nokia.com>
Fri, 26 Aug 2011 10:14:56 +0000 (10:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138630 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CellSPU/SPUFrameLowering.cpp
lib/Target/CellSPU/SPUFrameLowering.h

index 8e3186b599b5f0f40d7cacca15cb959be40e32cd..093f99f2871128cf3f93ea336f238d3c619d3200 100644 (file)
@@ -181,18 +181,6 @@ void SPUFrameLowering::emitPrologue(MachineFunction &MF) const {
       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());
-    }
   }
 }
 
index 16789ddfc5e3e6b308479a0c9a457a629434330a..b837f2cf94e1d78ce1f32847e1011018b4a2c979 100644 (file)
@@ -74,17 +74,6 @@ namespace llvm {
     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;
-    }
   };
 }