summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2017-03-15 23:06:22 +0000
committerVitaly Buka <vitalybuka@google.com>2017-03-15 23:06:22 +0000
commitde85ad895d943e4fdd6e4384b26ce0e489e37ec9 (patch)
treeb86b793b5a21bd92b662a804e4116b2034277025 /llvm/lib/Transforms/Instrumentation
parent8acf76b6b97826e2f58036f36ff15cc29cc7e0f9 (diff)
downloadbcm5719-llvm-de85ad895d943e4fdd6e4384b26ce0e489e37ec9.tar.gz
bcm5719-llvm-de85ad895d943e4fdd6e4384b26ce0e489e37ec9.zip
Revert "[PGO] Minor cleanup for count instruction in SelectInstVisitor."
Fails LLVMFuzzer.LLVMFuzzer.value-profile-strncmp.test This reverts commit r297892. llvm-svn: 297910
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
-rw-r--r--llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
index d9c25f2e981..258b77c8add 100644
--- a/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/PGOInstrumentation.cpp
@@ -205,7 +205,6 @@ struct SelectInstVisitor : public InstVisitor<SelectInstVisitor> {
SelectInstVisitor(Function &Func) : F(Func) {}
void countSelects(Function &Func) {
- NSIs = 0;
Mode = VM_counting;
visit(Func);
}
@@ -235,8 +234,6 @@ struct SelectInstVisitor : public InstVisitor<SelectInstVisitor> {
void annotateOneSelectInst(SelectInst &SI);
// Visit \p SI instruction and perform tasks according to visit mode.
void visitSelectInst(SelectInst &SI);
- // Return the number of select instructions. This needs be called after
- // countSelects().
unsigned getNumOfSelectInsts() const { return NSIs; }
};
@@ -1107,9 +1104,9 @@ void SelectInstVisitor::visitSelectInst(SelectInst &SI) {
if (SI.getCondition()->getType()->isVectorTy())
return;
+ NSIs++;
switch (Mode) {
case VM_counting:
- NSIs++;
return;
case VM_instrument:
instrumentOneSelectInst(SI);
OpenPOWER on IntegriCloud