LLVM 19.0.0git
LoopSink.h
Go to the documentation of this file.
1//===- LoopSink.h - Loop Sink Pass ------------------------------*- 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// This file provides the interface for the Loop Sink pass.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
14#define LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
15
16#include "llvm/IR/PassManager.h"
17
18namespace llvm {
19
20class Function;
21
22/// A pass that does profile-guided sinking of instructions into loops.
23///
24/// This is a function pass as it shouldn't be composed into any kind of
25/// unified loop pass pipeline. The goal of it is to sink code into loops that
26/// is loop invariant but only required within the loop body when doing so
27/// reduces the global expected dynamic frequency with which it executes.
28/// A classic example is an extremely cold branch within a loop body.
29///
30/// We do this as a separate pass so that during normal optimization all
31/// invariant operations can be held outside the loop body to simplify
32/// fundamental analyses and transforms of the loop.
33class LoopSinkPass : public PassInfoMixin<LoopSinkPass> {
34public:
36};
37}
38
39#endif // LLVM_TRANSFORMS_SCALAR_LOOPSINK_H
#define F(x, y, z)
Definition: MD5.cpp:55
FunctionAnalysisManager FAM
This header defines various interfaces for pass management in LLVM.
A container for analyses that lazily runs them and caches their results.
Definition: PassManager.h:348
A pass that does profile-guided sinking of instructions into loops.
Definition: LoopSink.h:33
PreservedAnalyses run(Function &F, FunctionAnalysisManager &FAM)
Definition: LoopSink.cpp:341
A set of analyses that are preserved following a run of a transformation pass.
Definition: Analysis.h:109
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:91