LLVM 20.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
21namespace llvm {
22
23struct LoopExtractorPass : public PassInfoMixin<LoopExtractorPass> {
24 LoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {}
27 function_ref<StringRef(StringRef)> MapClassName2PassName);
28
29private:
30 unsigned NumLoops;
31};
32} // namespace llvm
33
34#endif // LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
This header defines various interfaces for pass management in LLVM.
raw_pwrite_stream & OS
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:253
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:111
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
LoopExtractorPass(unsigned NumLoops=~0)
Definition: LoopExtractor.h:24
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:69