LLVM  14.0.0git
LoopBoundSplit.h
Go to the documentation of this file.
1 //===------- LoopBoundSplit.h - Split Loop Bound ----------------*- C++ -*-===//
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 #ifndef LLVM_TRANSFORMS_SCALAR_LOOPBOUNDSPLIT_H
10 #define LLVM_TRANSFORMS_SCALAR_LOOPBOUNDSPLIT_H
11 
13 #include "llvm/Analysis/LoopInfo.h"
14 #include "llvm/IR/PassManager.h"
16 
17 namespace llvm {
18 
19 /// This pass transforms loops that contain a conditional branch with induction
20 /// variable. For example, it transforms left code to right code:
21 ///
22 /// newbound = min(n, c)
23 /// while (iv < n) { while(iv < newbound) {
24 /// A A
25 /// if (iv < c) B
26 /// B C
27 /// C }
28 /// if (iv != n) {
29 /// while (iv < n) {
30 /// A
31 /// C
32 /// }
33 /// }
34 class LoopBoundSplitPass : public PassInfoMixin<LoopBoundSplitPass> {
35 public:
38 };
39 
40 } // end namespace llvm
41 
42 #endif // LLVM_TRANSFORMS_SCALAR_LOOPBOUNDSPLIT_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:155
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:374
llvm::Loop
Represents a single loop in the control flow graph.
Definition: LoopInfo.h:530
llvm::LoopStandardAnalysisResults
The adaptor from a function pass to a loop pass computes these analyses and makes them available to t...
Definition: LoopAnalysisManager.h:52
LoopAnalysisManager.h
LoopInfo.h
llvm::LoopBoundSplitPass::run
PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U)
Definition: LoopBoundSplit.cpp:481
llvm::LPMUpdater
This class provides an interface for updating the loop pass manager based on mutations to the loop ne...
Definition: LoopPassManager.h:263
LoopPassManager.h
PassManager.h
llvm::LoopBoundSplitPass
This pass transforms loops that contain a conditional branch with induction variable.
Definition: LoopBoundSplit.h:34
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition: InstructionSimplify.h:44