Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:45

0001 #ifndef LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNT_H
0002 #define LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNT_H
0003 
0004 #include "llvm/SandboxIR/Pass.h"
0005 #include "llvm/SandboxIR/Region.h"
0006 
0007 namespace llvm::sandboxir {
0008 
0009 /// A Region pass that prints the instruction count for the region to stdout.
0010 /// Used to test -sbvec-passes while we don't have any actual optimization
0011 /// passes.
0012 class PrintInstructionCount final : public RegionPass {
0013 public:
0014   PrintInstructionCount() : RegionPass("null") {}
0015   bool runOnRegion(Region &R, const Analyses &A) final {
0016     outs() << "InstructionCount: " << std::distance(R.begin(), R.end()) << "\n";
0017     return false;
0018   }
0019 };
0020 
0021 } // namespace llvm::sandboxir
0022 
0023 #endif // LLVM_TRANSFORMS_VECTORIZE_SANDBOXVECTORIZER_PASSES_PRINTINSTRUCTIONCOUNTPASS_H