[llvm] r241521 - [FaultMaps] Add statistic to count the # of implicit null checks.
Sanjoy Das
sanjoy at playingwithpointers.com
Mon Jul 6 16:32:11 PDT 2015
Author: sanjoy
Date: Mon Jul 6 18:32:10 2015
New Revision: 241521
URL: http://llvm.org/viewvc/llvm-project?rev=241521&view=rev
Log:
[FaultMaps] Add statistic to count the # of implicit null checks.
Modified:
llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp
Modified: llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp?rev=241521&r1=241520&r2=241521&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp (original)
+++ llvm/trunk/lib/CodeGen/ImplicitNullChecks.cpp Mon Jul 6 18:32:10 2015
@@ -26,6 +26,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineOperand.h"
@@ -47,6 +48,11 @@ static cl::opt<unsigned> PageSize("imp-n
"bytes"),
cl::init(4096));
+#define DEBUG_TYPE "implicit-null-checks"
+
+STATISTIC(NumImplicitNullChecks,
+ "Number of explicit null checks made implicit");
+
namespace {
class ImplicitNullChecks : public MachineFunctionPass {
@@ -257,6 +263,8 @@ void ImplicitNullChecks::rewriteNullChec
// Emit the HandlerLabel as an EH_LABEL.
BuildMI(*NC.NullSucc, NC.NullSucc->begin(), DL,
TII->get(TargetOpcode::EH_LABEL)).addSym(HandlerLabel);
+
+ NumImplicitNullChecks++;
}
}
More information about the llvm-commits
mailing list