LLVM  8.0.1
LCSSA.h
Go to the documentation of this file.
1 //===- LCSSA.h - Loop-closed SSA transform 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 pass transforms loops by placing phi nodes at the end of the loops for
11 // all values that are live across the loop boundary. For example, it turns
12 // the left into the right code:
13 //
14 // for (...) for (...)
15 // if (c) if (c)
16 // X1 = ... X1 = ...
17 // else else
18 // X2 = ... X2 = ...
19 // X3 = phi(X1, X2) X3 = phi(X1, X2)
20 // ... = X3 + 4 X4 = phi(X3)
21 // ... = X4 + 4
22 //
23 // This is still valid LLVM; the extra phi nodes are purely redundant, and will
24 // be trivially eliminated by InstCombine. The major benefit of this
25 // transformation is that it makes many other loop optimizations, such as
26 // LoopUnswitching, simpler.
27 //
28 //===----------------------------------------------------------------------===//
29 
30 #ifndef LLVM_TRANSFORMS_UTILS_LCSSA_H
31 #define LLVM_TRANSFORMS_UTILS_LCSSA_H
32 
33 #include "llvm/IR/PassManager.h"
34 
35 namespace llvm {
36 
37 /// Converts loops into loop-closed SSA form.
38 class LCSSAPass : public PassInfoMixin<LCSSAPass> {
39 public:
41 };
42 } // end namespace llvm
43 
44 #endif // LLVM_TRANSFORMS_UTILS_LCSSA_H
Converts loops into loop-closed SSA form.
Definition: LCSSA.h:38
This class represents lattice values for constants.
Definition: AllocatorList.h:24
F(f)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Definition: PassManager.h:366
A set of analyses that are preserved following a run of a transformation pass.
Definition: PassManager.h:154
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
Definition: LCSSA.cpp:452
A container for analyses that lazily runs them and caches their results.
This header defines various interfaces for pass management in LLVM.