aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/PowerPC/PPCBranchSelector.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-16 18:13:49 +0000
committerChris Lattner <sabre@nondot.org>2006-11-16 18:13:49 +0000
commitcb53595d70c33c2f11b9dd95653649372a5fe489 (patch)
tree64a2d52b65ab42a49a4ed7df22f5f02a564fb185 /lib/Target/PowerPC/PPCBranchSelector.cpp
parent0ca558f0eaf1503788ed2be9bfc32374ee83e83e (diff)
add a statistic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/PPCBranchSelector.cpp')
-rw-r--r--lib/Target/PowerPC/PPCBranchSelector.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCBranchSelector.cpp b/lib/Target/PowerPC/PPCBranchSelector.cpp
index 10efb9882a..123edb781d 100644
--- a/lib/Target/PowerPC/PPCBranchSelector.cpp
+++ b/lib/Target/PowerPC/PPCBranchSelector.cpp
@@ -19,12 +19,16 @@
#include "PPCInstrBuilder.h"
#include "PPCInstrInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/Support/Compiler.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetAsmInfo.h"
+#include "llvm/ADT/Statistic.h"
+#include "llvm/Support/Compiler.h"
#include <map>
using namespace llvm;
+static Statistic<> NumExpanded("ppc-branch-select",
+ "Num branches expanded to long format");
+
namespace {
struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
/// OffsetMap - Mapping between BB and byte offset from start of function.
@@ -131,6 +135,7 @@ bool PPCBSel::runOnMachineFunction(MachineFunction &Fn) {
BuildMI(*MBB, MBBJ, Opcode, 2).addReg(CRReg).addMBB(trueMBB);
} else {
// Long branch, skip next branch instruction (i.e. $PC+8).
+ ++NumExpanded;
BuildMI(*MBB, MBBJ, Inverted, 2).addReg(CRReg).addImm(2);
BuildMI(*MBB, MBBJ, PPC::B, 1).addMBB(trueMBB);
}