diff options
Diffstat (limited to 'llvm/include/llvm/CodeGen/MachineLoopInfo.h')
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineLoopInfo.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineLoopInfo.h b/llvm/include/llvm/CodeGen/MachineLoopInfo.h index 45697522e79..308fc942a8c 100644 --- a/llvm/include/llvm/CodeGen/MachineLoopInfo.h +++ b/llvm/include/llvm/CodeGen/MachineLoopInfo.h @@ -54,6 +54,12 @@ public: /// that contains the header. MachineBasicBlock *getBottomBlock(); + /// \brief Find the block that contains the loop control variable and the + /// loop test. This will return the latch block if it's one of the exiting + /// blocks. Otherwise, return the exiting block. Return 'null' when + /// multiple exiting blocks are present. + MachineBasicBlock *findLoopControlBlock(); + void dump() const; private: @@ -81,6 +87,14 @@ public: LoopInfoBase<MachineBasicBlock, MachineLoop>& getBase() { return LI; } + /// \brief Find the block that either is the loop preheader, or could + /// speculatively be used as the preheader. This is e.g. useful to place + /// loop setup code. Code that cannot be speculated should not be placed + /// here. SpeculativePreheader is controlling whether it also tries to + /// find the speculative preheader if the regular preheader is not present. + MachineBasicBlock *findLoopPreheader(MachineLoop *L, + bool SpeculativePreheader = false) const; + /// The iterator interface to the top-level loops in the current function. typedef LoopInfoBase<MachineBasicBlock, MachineLoop>::iterator iterator; inline iterator begin() const { return LI.begin(); } |

