#include "llvm/Transforms/Utils/CodeMoverUtils.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/AssumptionCache.h"
#include "llvm/Analysis/DependenceAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/TargetLibraryInfo.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Transforms/Utils/ScalarEvolutionExpander.h"
#include "gtest/gtest.h"
usingnamespacellvm;
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) { … }
static void run(Module &M, StringRef FuncName,
function_ref<void(Function &F, DominatorTree &DT,
PostDominatorTree &PDT, DependenceInfo &DI)>
Test) { … }
static BasicBlock *getBasicBlockByName(Function &F, StringRef Name) { … }
static Instruction *getInstructionByName(Function &F, StringRef Name) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentSimpleTest) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentOppositeCondTest) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentCondNestTest) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentImbalanceTest) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentPointerTest) { … }
TEST(CodeMoverUtils, IsControlFlowEquivalentNotPostdomTest) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest1) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest2) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest3) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest4) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest5) { … }
TEST(CodeMoverUtils, IsSafeToMoveTest6) { … }