LLVM 20.0.0git
PrintInstructionCount.h
Go to the documentation of this file.
1#ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNT_H
2#define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNT_H
3
6
7namespace llvm::sandboxir {
8
9/// A Region pass that prints the instruction count for the region to stdout.
10/// Used to test -sbvec-passes while we don't have any actual optimization
11/// passes.
12class PrintInstructionCount final : public RegionPass {
13public:
15 bool runOnRegion(Region &R, const Analyses &A) final {
16 outs() << "InstructionCount: " << std::distance(R.begin(), R.end()) << "\n";
17 return false;
18 }
19};
20
21} // namespace llvm::sandboxir
22
23#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNTPASS_H
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
A Region pass that prints the instruction count for the region to stdout.
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
A pass that runs on a sandbox::Region.
Definition: Pass.h:80
The main job of the Region is to point to new instructions generated by vectorization passes.
Definition: Region.h:54
raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.