Skip to content

Commit f6f79d4

Browse files
committed
Revert "[HWASAN] Implement selective instrumentation based on profiling information (#83503)"
Broke a build bot: https://lab.llvm.org/buildbot/#/builders/124/builds/9846 This reverts commit e7c3cd2.
1 parent 0813b90 commit f6f79d4

File tree

3 files changed

+0
-81
lines changed

3 files changed

+0
-81
lines changed

llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,11 @@
1515
#include "llvm/ADT/MapVector.h"
1616
#include "llvm/ADT/STLExtras.h"
1717
#include "llvm/ADT/SmallVector.h"
18-
#include "llvm/ADT/Statistic.h"
1918
#include "llvm/ADT/StringExtras.h"
2019
#include "llvm/ADT/StringRef.h"
21-
#include "llvm/Analysis/BlockFrequencyInfo.h"
2220
#include "llvm/Analysis/DomTreeUpdater.h"
2321
#include "llvm/Analysis/GlobalsModRef.h"
2422
#include "llvm/Analysis/PostDominators.h"
25-
#include "llvm/Analysis/ProfileSummaryInfo.h"
2623
#include "llvm/Analysis/StackSafetyAnalysis.h"
2724
#include "llvm/Analysis/TargetLibraryInfo.h"
2825
#include "llvm/Analysis/ValueTracking.h"
@@ -180,18 +177,6 @@ static cl::opt<bool> ClWithTls(
180177
"platforms that support this"),
181178
cl::Hidden, cl::init(true));
182179

183-
static cl::opt<bool>
184-
CSkipHotCode("hwasan-skip-hot-code",
185-
cl::desc("Do not instument hot functions based on FDO."),
186-
cl::Hidden, cl::init(false));
187-
188-
static cl::opt<int> HotPercentileCutoff("hwasan-percentile-cutoff-hot",
189-
cl::init(0));
190-
191-
STATISTIC(NumTotalFuncs, "Number of total funcs HWASAN");
192-
STATISTIC(NumInstrumentedFuncs, "Number of HWASAN instrumented funcs");
193-
STATISTIC(NumNoProfileSummaryFuncs, "Number of HWASAN funcs without PS");
194-
195180
// Mode for selecting how to insert frame record info into the stack ring
196181
// buffer.
197182
enum RecordStackHistoryMode {
@@ -1522,27 +1507,6 @@ void HWAddressSanitizer::sanitizeFunction(Function &F,
15221507
if (!F.hasFnAttribute(Attribute::SanitizeHWAddress))
15231508
return;
15241509

1525-
if (F.empty())
1526-
return;
1527-
1528-
NumTotalFuncs++;
1529-
if (CSkipHotCode) {
1530-
auto &MAMProxy = FAM.getResult<ModuleAnalysisManagerFunctionProxy>(F);
1531-
ProfileSummaryInfo *PSI =
1532-
MAMProxy.getCachedResult<ProfileSummaryAnalysis>(*F.getParent());
1533-
if (PSI && PSI->hasProfileSummary()) {
1534-
auto &BFI = FAM.getResult<BlockFrequencyAnalysis>(F);
1535-
if ((HotPercentileCutoff.getNumOccurrences() && HotPercentileCutoff >= 0)
1536-
? PSI->isFunctionHotInCallGraphNthPercentile(HotPercentileCutoff,
1537-
&F, BFI)
1538-
: PSI->isFunctionHotInCallGraph(&F, BFI))
1539-
return;
1540-
} else {
1541-
++NumNoProfileSummaryFuncs;
1542-
}
1543-
}
1544-
NumInstrumentedFuncs++;
1545-
15461510
LLVM_DEBUG(dbgs() << "Function: " << F.getName() << "\n");
15471511

15481512
SmallVector<InterestingMemoryOperand, 16> OperandsToInstrument;

llvm/test/Instrumentation/HWAddressSanitizer/pgo-opt-out-no-ps.ll

Lines changed: 0 additions & 14 deletions
This file was deleted.

llvm/test/Instrumentation/HWAddressSanitizer/pgo-opt-out.ll

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)