|
LLVM
5.0.0
|
This pass transforms loops that contain branches on loop-invariant conditions to have multiple loops. More...
#include "llvm/Transforms/Scalar/SimpleLoopUnswitch.h"
Public Member Functions | |
| SimpleLoopUnswitchPass ()=default | |
| PreservedAnalyses | run (Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U) |
Additional Inherited Members | |
Static Public Member Functions inherited from llvm::PassInfoMixin< SimpleLoopUnswitchPass > | |
| static StringRef | name () |
| Gets the name of the pass we are mixed into. More... | |
This pass transforms loops that contain branches on loop-invariant conditions to have multiple loops.
For example, it turns the left into the right code:
for (...) if (lic) A for (...) if (lic) A; B; C B else C for (...) A; C
This can increase the size of the code exponentially (doubling it every time a loop is unswitched) so we only unswitch if the resultant code will be smaller than a threshold.
This pass expects LICM to be run before it to hoist invariant conditions out of the loop, to make the unswitching opportunity obvious.
Definition at line 38 of file SimpleLoopUnswitch.h.
|
default |
| PreservedAnalyses SimpleLoopUnswitchPass::run | ( | Loop & | L, |
| LoopAnalysisManager & | AM, | ||
| LoopStandardAnalysisResults & | AR, | ||
| LPMUpdater & | U | ||
| ) |
Definition at line 735 of file SimpleLoopUnswitch.cpp.
References llvm::LoopStandardAnalysisResults::AC, llvm::PreservedAnalyses::all(), llvm::dbgs(), DEBUG, llvm::LoopStandardAnalysisResults::DT, F, llvm::LoopBase< N, M >::getHeader(), llvm::getLoopPassPreservedAnalyses(), llvm::Value::getName(), llvm::LoopStandardAnalysisResults::LI, unswitchLoop(), and llvm::DominatorTree::verifyDomTree().
1.8.6