VPlanLoopInfo.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //===-- VPLoopInfo.h --------------------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. ///
  9. /// \file
  10. /// This file defines VPLoopInfo analysis and VPLoop class. VPLoopInfo is a
  11. /// specialization of LoopInfoBase for VPBlockBase. VPLoops is a specialization
  12. /// of LoopBase that is used to hold loop metadata from VPLoopInfo. Further
  13. /// information can be found in VectorizationPlanner.rst.
  14. ///
  15. //===----------------------------------------------------------------------===//
  16. #ifndef LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H
  17. #define LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H
  18. #include "llvm/Analysis/LoopInfoImpl.h"
  19. namespace llvm {
  20. class VPBlockBase;
  21. /// Hold analysis information for every loop detected by VPLoopInfo. It is an
  22. /// instantiation of LoopBase.
  23. class VPLoop : public LoopBase<VPBlockBase, VPLoop> {
  24. private:
  25. friend class LoopInfoBase<VPBlockBase, VPLoop>;
  26. explicit VPLoop(VPBlockBase *VPB) : LoopBase<VPBlockBase, VPLoop>(VPB) {}
  27. };
  28. /// VPLoopInfo provides analysis of natural loop for VPBlockBase-based
  29. /// Hierarchical CFG. It is a specialization of LoopInfoBase class.
  30. // TODO: VPLoopInfo is initially computed on top of the VPlan plain CFG, which
  31. // is the same as the incoming IR CFG. If it's more efficient than running the
  32. // whole loop detection algorithm, we may want to create a mechanism to
  33. // translate LoopInfo into VPLoopInfo. However, that would require significant
  34. // changes in LoopInfoBase class.
  35. typedef LoopInfoBase<VPBlockBase, VPLoop> VPLoopInfo;
  36. } // namespace llvm
  37. #endif // LLVM_TRANSFORMS_VECTORIZE_VPLOOPINFO_H