LLVM  8.0.0svn
LoopSink.h
Go to the documentation of this file.
1 //===- LoopSink.h - Loop Sink Pass ------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file provides the interface for the Loop Sink pass.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
15 #define LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
16 
17 #include "llvm/Analysis/LoopInfo.h"
18 #include "llvm/IR/PassManager.h"
20 
21 namespace llvm {
22 
23 /// A pass that does profile-guided sinking of instructions into loops.
24 ///
25 /// This is a function pass as it shouldn't be composed into any kind of
26 /// unified loop pass pipeline. The goal of it is to sink code into loops that
27 /// is loop invariant but only required within the loop body when doing so
28 /// reduces the global expected dynamic frequency with which it executes.
29 /// A classic example is an extremely cold branch within a loop body.
30 ///
31 /// We do this as a separate pass so that during normal optimization all
32 /// invariant operations can be held outside the loop body to simplify
33 /// fundamental analyses and transforms of the loop.
34 class LoopSinkPass : public PassInfoMixin<LoopSinkPass> {
35 public:
37 };
38 }
39 
40 #endif // LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
This header provides classes for managing a pipeline of passes over loops in LLVM IR...
F(f)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A pass that does profile-guided sinking of instructions into loops.
Definition: LoopSink.h:34
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Definition: LoopSink.cpp:318