#include "llvm/Transforms/Utils/CanonicalizeFreezeInLoops.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/Analysis/IVDescriptors.h"
#include "llvm/Analysis/LoopAnalysisManager.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/Analysis/ScalarEvolution.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Dominators.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Utils.h"
usingnamespacellvm;
#define DEBUG_TYPE …
namespace {
class CanonicalizeFreezeInLoops : public LoopPass { … };
class CanonicalizeFreezeInLoopsImpl { … };
}
namespace llvm {
struct FrozenIndPHIInfo { … };
template <> struct DenseMapInfo<FrozenIndPHIInfo> { … };
}
void CanonicalizeFreezeInLoopsImpl::InsertFreezeAndForgetFromSCEV(Use &U) { … }
bool CanonicalizeFreezeInLoopsImpl::run() { … }
CanonicalizeFreezeInLoops::CanonicalizeFreezeInLoops() : … { … }
void CanonicalizeFreezeInLoops::getAnalysisUsage(AnalysisUsage &AU) const { … }
bool CanonicalizeFreezeInLoops::runOnLoop(Loop *L, LPPassManager &) { … }
PreservedAnalyses
CanonicalizeFreezeInLoopsPass::run(Loop &L, LoopAnalysisManager &AM,
LoopStandardAnalysisResults &AR,
LPMUpdater &U) { … }
INITIALIZE_PASS_BEGIN(CanonicalizeFreezeInLoops, "canon-freeze",
"Canonicalize Freeze Instructions in Loops", false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(ScalarEvolutionWrapperPass)
INITIALIZE_PASS_DEPENDENCY(LoopSimplify)
INITIALIZE_PASS_END(CanonicalizeFreezeInLoops, "canon-freeze",
"Canonicalize Freeze Instructions in Loops", false, false)
Pass *llvm::createCanonicalizeFreezeInLoopsPass() { … }
char CanonicalizeFreezeInLoops::ID = …;