#include "llvm/Target/TargetLibraryInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
-#include "llvm/TargetTransformInfo.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/Transforms/Instrumentation.h"
if (!CodeGenPasses) {
CodeGenPasses = new PassManager();
CodeGenPasses->add(new DataLayout(TheModule));
- // Add TargetTransformInfo.
- if (TM) {
- CodeGenPasses->add(createNoTTIPass(TM->getScalarTargetTransformInfo(),
- TM->getVectorTargetTransformInfo()));
- }
+ if (TM)
+ TM->addAnalysisPasses(*CodeGenPasses);
}
return CodeGenPasses;
}
if (!PerModulePasses) {
PerModulePasses = new PassManager();
PerModulePasses->add(new DataLayout(TheModule));
- if (TM) {
- PerModulePasses->add(
- createNoTTIPass(TM->getScalarTargetTransformInfo(),
- TM->getVectorTargetTransformInfo()));
- }
+ if (TM)
+ TM->addAnalysisPasses(*PerModulePasses);
}
return PerModulePasses;
}
if (!PerFunctionPasses) {
PerFunctionPasses = new FunctionPassManager(TheModule);
PerFunctionPasses->add(new DataLayout(TheModule));
- if (TM) {
- PerFunctionPasses->add(
- createNoTTIPass(TM->getScalarTargetTransformInfo(),
- TM->getVectorTargetTransformInfo()));
- }
+ if (TM)
+ TM->addAnalysisPasses(*PerFunctionPasses);
}
return PerFunctionPasses;
}
TLI->disableAllFunctions();
PM->add(TLI);
- // Add TargetTransformInfo.
- PM->add(createNoTTIPass(TM->getScalarTargetTransformInfo(),
- TM->getVectorTargetTransformInfo()));
+ // Add Target specific analysis passes.
+ TM->addAnalysisPasses(*PM);
// Normal mode, emit a .s or .o file by running the code generator. Note,
// this also adds codegenerator level optimization passes.