LLVM  15.0.0git
LoopExtractor.h
Go to the documentation of this file.
1 //===- LoopExtractor.h - Extract each loop into a new function ------------===//
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 // A pass wrapper around the ExtractLoop() scalar transformation to extract each
10 // top-level loop into its own new function. If the loop is the ONLY loop in a
11 // given function, it is not touched. This is a pass most useful for debugging
12 // via bugpoint.
13 //
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
17 #define LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
18 
19 #include "llvm/IR/PassManager.h"
20 
21 namespace llvm {
22 
23 struct LoopExtractorPass : public PassInfoMixin<LoopExtractorPass> {
24  LoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {}
26  void printPipeline(raw_ostream &OS,
27  function_ref<StringRef(StringRef)> MapClassName2PassName);
28 
29 private:
30  unsigned NumLoops;
31 };
32 } // namespace llvm
33 
34 #endif // LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:371
llvm::LoopExtractorPass::LoopExtractorPass
LoopExtractorPass(unsigned NumLoops=~0)
Definition: LoopExtractor.h:24
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::LoopExtractorPass::printPipeline
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
Definition: LoopExtractor.cpp:282
PassManager.h
llvm::LoopExtractorPass
Definition: LoopExtractor.h:23
llvm::LoopExtractorPass::run
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
Definition: LoopExtractor.cpp:261
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:42