![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /proc/thread-self/root/usr/lib/llvm-6.0/include/llvm/Transforms/Scalar/ |
Upload File : |
//===- SimpleLoopUnswitch.h - Hoist loop-invariant control flow -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_SCALAR_SIMPLELOOPUNSWITCH_H #define LLVM_TRANSFORMS_SCALAR_SIMPLELOOPUNSWITCH_H #include "llvm/Analysis/LoopAnalysisManager.h" #include "llvm/Analysis/LoopInfo.h" #include "llvm/IR/PassManager.h" #include "llvm/Transforms/Scalar/LoopPassManager.h" namespace llvm { /// This pass transforms loops that contain branches on loop-invariant /// conditions to have multiple loops. For example, it turns the left into the /// right code: /// /// for (...) if (lic) /// A for (...) /// if (lic) A; B; C /// B else /// C for (...) /// A; C /// /// This can increase the size of the code exponentially (doubling it every time /// a loop is unswitched) so we only unswitch if the resultant code will be /// smaller than a threshold. /// /// This pass expects LICM to be run before it to hoist invariant conditions out /// of the loop, to make the unswitching opportunity obvious. /// class SimpleLoopUnswitchPass : public PassInfoMixin<SimpleLoopUnswitchPass> { bool NonTrivial; public: SimpleLoopUnswitchPass(bool NonTrivial = false) : NonTrivial(NonTrivial) {} PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, LoopStandardAnalysisResults &AR, LPMUpdater &U); }; /// Create the legacy pass object for the simple loop unswitcher. /// /// See the documentaion for `SimpleLoopUnswitchPass` for details. Pass *createSimpleLoopUnswitchLegacyPass(bool NonTrivial = false); } // end namespace llvm #endif // LLVM_TRANSFORMS_SCALAR_SIMPLELOOPUNSWITCH_H