#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/MemorySSA.h"
#include "llvm/Analysis/MemorySSAUpdater.h"
#include "llvm/Analysis/OptimizationRemarkEmitter.h"
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/CodeGen/InterleavedLoadCombine.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm>
#include <cassert>
#include <list>
usingnamespacellvm;
#define DEBUG_TYPE …
namespace …
bool InterleavedLoadCombineImpl::findPattern(
std::list<VectorInfo> &Candidates, std::list<VectorInfo> &InterleavedLoad,
unsigned Factor, const DataLayout &DL) { … }
LoadInst *
InterleavedLoadCombineImpl::findFirstLoad(const std::set<LoadInst *> &LIs) { … }
bool InterleavedLoadCombineImpl::combine(std::list<VectorInfo> &InterleavedLoad,
OptimizationRemarkEmitter &ORE) { … }
bool InterleavedLoadCombineImpl::run() { … }
namespace {
struct InterleavedLoadCombine : public FunctionPass { … };
}
PreservedAnalyses
InterleavedLoadCombinePass::run(Function &F, FunctionAnalysisManager &FAM) { … }
char InterleavedLoadCombine::ID = …;
INITIALIZE_PASS_BEGIN(
InterleavedLoadCombine, DEBUG_TYPE,
"Combine interleaved loads into wide loads and shufflevector instructions",
false, false)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(MemorySSAWrapperPass)
INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
INITIALIZE_PASS_END(
InterleavedLoadCombine, DEBUG_TYPE,
"Combine interleaved loads into wide loads and shufflevector instructions",
false, false)
FunctionPass *
llvm::createInterleavedLoadCombinePass() { … }