LLVM 22.0.0git
ProfileVerify.h
Go to the documentation of this file.
1//===- ProfileVerify.h - Verify profile info for testing ----------*-C++-*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Inject profile information, as part of tests, to verify passes don't
10// accidentally drop it.
11//
12//===----------------------------------------------------------------------===//
13#ifndef LLVM_TRANSFORMS_UTILS_PROFILEVERIFY_H
14#define LLVM_TRANSFORMS_UTILS_PROFILEVERIFY_H
15
16#include "llvm/ADT/DenseSet.h"
17#include "llvm/IR/Analysis.h"
18#include "llvm/IR/PassManager.h"
20
21namespace llvm {
22/// Inject MD_prof metadata where it's missing. Used for testing that passes
23/// don't accidentally drop this metadata.
24class ProfileInjectorPass : public PassInfoMixin<ProfileInjectorPass> {
25public:
27};
28
29/// Checks that MD_prof is present on every instruction that supports it. Used
30/// in conjunction with the ProfileInjectorPass. MD_prof "unknown" is considered
31/// valid (i.e. !{!"unknown"})
32class ProfileVerifierPass : public PassInfoMixin<ProfileVerifierPass> {
34 // This pass is mostly a function pass but we want to initialize the
35 // IngoreList once, which is why we present it as a module-level pass. We make
36 // the function-level run private to avoid accidentally hooking up the pass as
37 // a function pass.
39
40public:
42};
43
44} // namespace llvm
45#endif
#define LLVM_ABI
Definition Compiler.h:213
This file defines the DenseSet and SmallDenseSet classes.
This header defines various interfaces for pass management in LLVM.
#define F(x, y, z)
Definition MD5.cpp:54
FunctionAnalysisManager FAM
ModuleAnalysisManager MAM
Implements a dense probed hash-table based set.
Definition DenseSet.h:279
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
Inject MD_prof metadata where it's missing.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Checks that MD_prof is present on every instruction that supports it.
Pass manager infrastructure for declaring and invalidating analyses.
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:69