LLVM
15.0.0git
include
llvm
Transforms
Utils
LCSSA.h
Go to the documentation of this file.
1
//===- LCSSA.h - Loop-closed SSA transform 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 pass transforms loops by placing phi nodes at the end of the loops for
10
// all values that are live across the loop boundary. For example, it turns
11
// the left into the right code:
12
//
13
// for (...) for (...)
14
// if (c) if (c)
15
// X1 = ... X1 = ...
16
// else else
17
// X2 = ... X2 = ...
18
// X3 = phi(X1, X2) X3 = phi(X1, X2)
19
// ... = X3 + 4 X4 = phi(X3)
20
// ... = X4 + 4
21
//
22
// This is still valid LLVM; the extra phi nodes are purely redundant, and will
23
// be trivially eliminated by InstCombine. The major benefit of this
24
// transformation is that it makes many other loop optimizations, such as
25
// LoopUnswitching, simpler.
26
//
27
//===----------------------------------------------------------------------===//
28
29
#ifndef LLVM_TRANSFORMS_UTILS_LCSSA_H
30
#define LLVM_TRANSFORMS_UTILS_LCSSA_H
31
32
#include "
llvm/IR/PassManager.h
"
33
34
namespace
llvm
{
35
36
/// Converts loops into loop-closed SSA form.
37
class
LCSSAPass
:
public
PassInfoMixin
<LCSSAPass> {
38
public
:
39
PreservedAnalyses
run
(
Function
&
F
,
FunctionAnalysisManager
&AM);
40
};
41
}
// end namespace llvm
42
43
#endif // LLVM_TRANSFORMS_UTILS_LCSSA_H
llvm::PreservedAnalyses
A set of analyses that are preserved following a run of a transformation pass.
Definition:
PassManager.h:152
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:17
llvm::PassInfoMixin
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition:
PassManager.h:371
llvm::Function
Definition:
Function.h:60
F
#define F(x, y, z)
Definition:
MD5.cpp:55
llvm::LCSSAPass::run
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition:
LCSSA.cpp:498
PassManager.h
llvm::LCSSAPass
Converts loops into loop-closed SSA form.
Definition:
LCSSA.h:37
llvm::AnalysisManager
A container for analyses that lazily runs them and caches their results.
Definition:
InstructionSimplify.h:42
Generated on Thu May 19 2022 02:55:22 for LLVM by
1.8.17