|
15 | 15 | #include "llvm/ADT/MapVector.h"
|
16 | 16 | #include "llvm/ADT/STLExtras.h"
|
17 | 17 | #include "llvm/ADT/SmallVector.h"
|
18 |
| -#include "llvm/ADT/Statistic.h" |
19 | 18 | #include "llvm/ADT/StringExtras.h"
|
20 | 19 | #include "llvm/ADT/StringRef.h"
|
21 |
| -#include "llvm/Analysis/BlockFrequencyInfo.h" |
22 | 20 | #include "llvm/Analysis/DomTreeUpdater.h"
|
23 | 21 | #include "llvm/Analysis/GlobalsModRef.h"
|
24 | 22 | #include "llvm/Analysis/PostDominators.h"
|
25 |
| -#include "llvm/Analysis/ProfileSummaryInfo.h" |
26 | 23 | #include "llvm/Analysis/StackSafetyAnalysis.h"
|
27 | 24 | #include "llvm/Analysis/TargetLibraryInfo.h"
|
28 | 25 | #include "llvm/Analysis/ValueTracking.h"
|
@@ -180,18 +177,6 @@ static cl::opt<bool> ClWithTls(
|
180 | 177 | "platforms that support this"),
|
181 | 178 | cl::Hidden, cl::init(true));
|
182 | 179 |
|
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 |
| - |
195 | 180 | // Mode for selecting how to insert frame record info into the stack ring
|
196 | 181 | // buffer.
|
197 | 182 | enum RecordStackHistoryMode {
|
@@ -1522,27 +1507,6 @@ void HWAddressSanitizer::sanitizeFunction(Function &F,
|
1522 | 1507 | if (!F.hasFnAttribute(Attribute::SanitizeHWAddress))
|
1523 | 1508 | return;
|
1524 | 1509 |
|
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 |
| - |
1546 | 1510 | LLVM_DEBUG(dbgs() << "Function: " << F.getName() << "\n");
|
1547 | 1511 |
|
1548 | 1512 | SmallVector<InterestingMemoryOperand, 16> OperandsToInstrument;
|
|
0 commit comments