Always set target info, even when compiling to generic targets.
This allows the SROA pass eliminate a lot of allocas and loads and stores, which helps a lot for performance.
This commit is contained in:
10
opt.cpp
10
opt.cpp
@@ -256,12 +256,10 @@ Optimize(llvm::Module *module, int optLevel) {
|
||||
|
||||
optPM.add(llvm::createVerifierPass());
|
||||
|
||||
if (g->target.isa != Target::GENERIC) {
|
||||
llvm::TargetLibraryInfo *targetLibraryInfo =
|
||||
new llvm::TargetLibraryInfo(llvm::Triple(module->getTargetTriple()));
|
||||
optPM.add(targetLibraryInfo);
|
||||
optPM.add(new llvm::TargetData(module));
|
||||
}
|
||||
llvm::TargetLibraryInfo *targetLibraryInfo =
|
||||
new llvm::TargetLibraryInfo(llvm::Triple(module->getTargetTriple()));
|
||||
optPM.add(targetLibraryInfo);
|
||||
optPM.add(new llvm::TargetData(module));
|
||||
|
||||
optPM.add(llvm::createIndVarSimplifyPass());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user