Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:40

0001 //===- LoopExtractor.h - Extract each loop into a new function ------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // A pass wrapper around the ExtractLoop() scalar transformation to extract each
0010 // top-level loop into its own new function. If the loop is the ONLY loop in a
0011 // given function, it is not touched. This is a pass most useful for debugging
0012 // via bugpoint.
0013 //
0014 //===----------------------------------------------------------------------===//
0015 
0016 #ifndef LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
0017 #define LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H
0018 
0019 #include "llvm/IR/PassManager.h"
0020 
0021 namespace llvm {
0022 
0023 struct LoopExtractorPass : public PassInfoMixin<LoopExtractorPass> {
0024   LoopExtractorPass(unsigned NumLoops = ~0) : NumLoops(NumLoops) {}
0025   PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM);
0026   void printPipeline(raw_ostream &OS,
0027                      function_ref<StringRef(StringRef)> MapClassName2PassName);
0028 
0029 private:
0030   unsigned NumLoops;
0031 };
0032 } // namespace llvm
0033 
0034 #endif // LLVM_TRANSFORMS_IPO_LOOPEXTRACTOR_H