LLVM 23.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 assert(AuxArg.empty() && "This pass ignores aux arg!");
16 }
17 bool runOnRegion(Region &R, const Analyses &A) final {
18 outs() << "InstructionCount: " << llvm::size(R) << "\n";
19 return false;
20 }
21};
22
23} // namespace llvm::sandboxir
24
25#endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNTPASS_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr bool empty() const
Check if the string is empty.
Definition StringRef.h:141
bool runOnRegion(Region &R, const Analyses &A) final
\Returns true if it modifies R.
RegionPass(StringRef Name)
Name can't contain any spaces or start with '-'.
Definition Pass.h:87
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition STLExtras.h:1669
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.