[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
Chris Lattner
sabre at nondot.org
Thu Nov 16 10:14:04 PST 2006
Changes in directory llvm/lib/Target/PowerPC:
PPCBranchSelector.cpp updated: 1.29 -> 1.30
---
Log message:
add a statistic
---
Diffs of the changes: (+6 -1)
PPCBranchSelector.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCBranchSelector.cpp
diff -u llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.29 llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.30
--- llvm/lib/Target/PowerPC/PPCBranchSelector.cpp:1.29 Fri Oct 13 12:56:02 2006
+++ llvm/lib/Target/PowerPC/PPCBranchSelector.cpp Thu Nov 16 12:13:49 2006
@@ -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 @@
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);
}
More information about the llvm-commits
mailing list