//===- LoopVersioning.h - Utility to version a loop -------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // This file defines a utility class to perform loop versioning. The versioned // loop speculates that otherwise may-aliasing memory accesses don't overlap and // emits checks to prove this. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H #define LLVM_TRANSFORMS_UTILS_LOOPVERSIONING_H #include "llvm/IR/PassManager.h" #include "llvm/Transforms/Utils/LoopUtils.h" #include "llvm/Transforms/Utils/ValueMapper.h" namespace llvm { class Loop; class SCEVPredicate; class ScalarEvolution; class LoopAccessInfo; class LoopInfo; struct RuntimeCheckingPtrGroup; RuntimePointerCheck; template <typename T> class ArrayRef; /// This class emits a version of the loop where run-time checks ensure /// that may-alias pointers can't overlap. /// /// It currently only supports single-exit loops and assumes that the loop /// already has a preheader. class LoopVersioning { … }; /// Expose LoopVersioning as a pass. Currently this is only used for /// unit-testing. It adds all memchecks necessary to remove all may-aliasing /// array accesses from the loop. class LoopVersioningPass : public PassInfoMixin<LoopVersioningPass> { … }; } #endif