#include "llvm/Transforms/Utils/CallPromotionUtils.h"
#include "llvm/Analysis/CtxProfAnalysis.h"
#include "llvm/AsmParser/Parser.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/NoFolder.h"
#include "llvm/IR/PassInstrumentation.h"
#include "llvm/ProfileData/PGOCtxProfReader.h"
#include "llvm/ProfileData/PGOCtxProfWriter.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gtest/gtest.h"
usingnamespacellvm;
static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) { … }
static Constant *getVTableAddressPointOffset(GlobalVariable *VTable,
uint32_t AddressPointOffset) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_NoFPLoad) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_NoVTablePtrLoad) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_NoVTableInitFound) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_EmptyVTable) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_NullFP) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_MemberFunctionCalls) { … }
TEST(CallPromotionUtilsTest, TryPromoteCall_Legality) { … }
TEST(CallPromotionUtilsTest, promoteCallWithVTableCmp) { … }
TEST(CallPromotionUtilsTest, PromoteWithIcmpAndCtxProf) { … }