diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2018-10-16 08:07:14 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-10-16 08:07:14 +0000 |
| commit | 8d56be707038f99cf4e387c2a9390d39bea287cc (patch) | |
| tree | 747a183644edc1c5f3c80469b64d94999c9fd045 /llvm/include | |
| parent | c9163855dd8b582f75921e01e903c3c27a57663d (diff) | |
| download | bcm5719-llvm-8d56be707038f99cf4e387c2a9390d39bea287cc.tar.gz bcm5719-llvm-8d56be707038f99cf4e387c2a9390d39bea287cc.zip | |
[NFC] Encapsulate work with BlockColors in LoopSafetyInfo
llvm-svn: 344590
Diffstat (limited to 'llvm/include')
| -rw-r--r-- | llvm/include/llvm/Analysis/MustExecute.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/llvm/include/llvm/Analysis/MustExecute.h b/llvm/include/llvm/Analysis/MustExecute.h index e643e4ec563..d78b38bdead 100644 --- a/llvm/include/llvm/Analysis/MustExecute.h +++ b/llvm/include/llvm/Analysis/MustExecute.h @@ -49,6 +49,9 @@ class LoopSafetyInfo { // may throw. bool HeaderMayThrow = false; // Same as previous, but specific to loop header + // Used to update funclet bundle operands. + DenseMap<BasicBlock *, ColorVector> BlockColors; + /// Collect all blocks from \p CurLoop which lie on all possible paths from /// the header of \p CurLoop (inclusive) to BB (exclusive) into the set /// \p Predecessors. If \p BB is the header, \p Predecessors will be empty. @@ -56,9 +59,16 @@ class LoopSafetyInfo { const Loop *CurLoop, const BasicBlock *BB, SmallPtrSetImpl<const BasicBlock *> &Predecessors) const; +protected: + /// Computes block colors. + void computeBlockColors(const Loop *CurLoop); + public: - // Used to update funclet bundle operands. - DenseMap<BasicBlock *, ColorVector> BlockColors; + /// Returns block colors map that is used to update funclet operand bundles. + const DenseMap<BasicBlock *, ColorVector> &getBlockColors() const; + + /// Copy colors of block \p Old into the block \p New. + void copyColors(BasicBlock *New, BasicBlock *Old); /// Returns true iff the header block of the loop for which this info is /// calculated contains an instruction that may throw or otherwise exit @@ -83,7 +93,7 @@ public: /// as argument. Updates safety information in LoopSafetyInfo argument. /// Note: This is defined to clear and reinitialize an already initialized /// LoopSafetyInfo. Some callers rely on this fact. - void computeLoopSafetyInfo(Loop *); + void computeLoopSafetyInfo(const Loop *CurLoop); /// Returns true if the instruction in a loop is guaranteed to execute at /// least once (under the assumption that the loop is entered). |

