1 //===-- VPLoopInfo.h --------------------------------------------*- 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 /// \file 11 /// This file defines VPLoopInfo analysis and VPLoop class. VPLoopInfo is a 12 /// specialization of LoopInfoBase for VPBlockBase. VPLoops is a specialization 13 /// of LoopBase that is used to hold loop metadata from VPLoopInfo. Further 14 /// information can be found in VectorizationPlanner.rst. 15 /// 16 //===----------------------------------------------------------------------===// 17 18 #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H 19 #define LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H 20 21 #include "llvm/Analysis/LoopInfoImpl.h" 22 23 namespace llvm { 24 class VPBlockBase; 25 26 /// Hold analysis information for every loop detected by VPLoopInfo. It is an 27 /// instantiation of LoopBase. 28 class VPLoop : public LoopBase<VPBlockBase, VPLoop> { 29 private: 30 friend class LoopInfoBase<VPBlockBase, VPLoop>; VPLoop(VPBlockBase * VPB)31 explicit VPLoop(VPBlockBase *VPB) : LoopBase<VPBlockBase, VPLoop>(VPB) {} 32 }; 33 34 /// VPLoopInfo provides analysis of natural loop for VPBlockBase-based 35 /// Hierarchical CFG. It is a specialization of LoopInfoBase class. 36 // TODO: VPLoopInfo is initially computed on top of the VPlan plain CFG, which 37 // is the same as the incoming IR CFG. If it's more efficient than running the 38 // whole loop detection algorithm, we may want to create a mechanism to 39 // translate LoopInfo into VPLoopInfo. However, that would require significant 40 // changes in LoopInfoBase class. 41 typedef LoopInfoBase<VPBlockBase, VPLoop> VPLoopInfo; 42 43 } // namespace llvm 44 45 #endif // LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H 46