diff options
author | Max Kazantsev <mkazantsev@azul.com> | 2020-04-17 17:18:01 +0700 |
---|---|---|
committer | Max Kazantsev <mkazantsev@azul.com> | 2020-04-17 17:49:34 +0700 |
commit | 72c13446ce81050ced80184ec2db9684f081b8c3 (patch) | |
tree | ff2267094abc3681954331dae51eb629c2438eb7 /llvm/lib/Transforms/Utils/LCSSA.cpp | |
parent | c819ef9653635b4a15c1390c28bfa4cdff614396 (diff) | |
download | llvm-72c13446ce81050ced80184ec2db9684f081b8c3.zip llvm-72c13446ce81050ced80184ec2db9684f081b8c3.tar.gz llvm-72c13446ce81050ced80184ec2db9684f081b8c3.tar.bz2 |
[NFC] Add missing 'const' notion to LCSSA-related functions
These functions don't really do any changes to loop info or
dominator tree. We should state this explicitly using 'const'.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LCSSA.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LCSSA.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Utils/LCSSA.cpp b/llvm/lib/Transforms/Utils/LCSSA.cpp index 5746d69..b1a1c56 100644 --- a/llvm/lib/Transforms/Utils/LCSSA.cpp +++ b/llvm/lib/Transforms/Utils/LCSSA.cpp @@ -76,7 +76,7 @@ static bool isExitBlock(BasicBlock *BB, /// that are outside the current loop. If so, insert LCSSA PHI nodes and /// rewrite the uses. bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist, - DominatorTree &DT, LoopInfo &LI, + const DominatorTree &DT, const LoopInfo &LI, ScalarEvolution *SE) { SmallVector<Use *, 16> UsesToRewrite; SmallSetVector<PHINode *, 16> PHIsToRemove; @@ -128,7 +128,7 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist, if (auto *Inv = dyn_cast<InvokeInst>(I)) DomBB = Inv->getNormalDest(); - DomTreeNode *DomNode = DT.getNode(DomBB); + const DomTreeNode *DomNode = DT.getNode(DomBB); SmallVector<PHINode *, 16> AddedPHIs; SmallVector<PHINode *, 8> PostProcessPHIs; @@ -274,7 +274,7 @@ bool llvm::formLCSSAForInstructions(SmallVectorImpl<Instruction *> &Worklist, // Compute the set of BasicBlocks in the loop `L` dominating at least one exit. static void computeBlocksDominatingExits( - Loop &L, DominatorTree &DT, SmallVector<BasicBlock *, 8> &ExitBlocks, + Loop &L, const DominatorTree &DT, SmallVector<BasicBlock *, 8> &ExitBlocks, SmallSetVector<BasicBlock *, 8> &BlocksDominatingExits) { SmallVector<BasicBlock *, 8> BBWorklist; @@ -318,7 +318,7 @@ static void computeBlocksDominatingExits( } } -bool llvm::formLCSSA(Loop &L, DominatorTree &DT, LoopInfo *LI, +bool llvm::formLCSSA(Loop &L, const DominatorTree &DT, const LoopInfo *LI, ScalarEvolution *SE) { bool Changed = false; @@ -383,8 +383,8 @@ bool llvm::formLCSSA(Loop &L, DominatorTree &DT, LoopInfo *LI, } /// Process a loop nest depth first. -bool llvm::formLCSSARecursively(Loop &L, DominatorTree &DT, LoopInfo *LI, - ScalarEvolution *SE) { +bool llvm::formLCSSARecursively(Loop &L, const DominatorTree &DT, + const LoopInfo *LI, ScalarEvolution *SE) { bool Changed = false; // Recurse depth-first through inner loops. @@ -396,7 +396,7 @@ bool llvm::formLCSSARecursively(Loop &L, DominatorTree &DT, LoopInfo *LI, } /// Process all loops in the function, inner-most out. -static bool formLCSSAOnAllLoops(LoopInfo *LI, DominatorTree &DT, +static bool formLCSSAOnAllLoops(const LoopInfo *LI, const DominatorTree &DT, ScalarEvolution *SE) { bool Changed = false; for (auto &L : *LI) |