LLVM 22.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.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:67
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
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:53
This is an optimization pass for GlobalISel generic memory operations.
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
void printPipeline(raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)
LoopExtractorPass(unsigned NumLoops=~0)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition PassManager.h:70