mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
Small jit fixes (#2570)
* Better thunks stripping from jit module. * Fixes to jit disassembler * Strip comdats from jit module
This commit is contained in:
parent
16ecb3e79f
commit
bfd412cdf9
5 changed files with 145 additions and 49 deletions
|
@ -109,10 +109,23 @@ struct FuncFinalizer final {
|
|||
~FuncFinalizer() { fpm.doFinalization(); }
|
||||
};
|
||||
|
||||
void stripComdat(llvm::Module &module) {
|
||||
for (auto &&func : module.functions()) {
|
||||
func.setComdat(nullptr);
|
||||
}
|
||||
for (auto &&var : module.globals()) {
|
||||
var.setComdat(nullptr);
|
||||
}
|
||||
module.getComdatSymbolTable().clear();
|
||||
}
|
||||
|
||||
} // anon namespace
|
||||
|
||||
void optimizeModule(const Context &context, llvm::TargetMachine &targetMachine,
|
||||
const OptimizerSettings &settings, llvm::Module &module) {
|
||||
// There is llvm bug related tp comdat and IR based pgo
|
||||
// and anyway comdat is useless at this stage
|
||||
stripComdat(module);
|
||||
llvm::legacy::PassManager mpm;
|
||||
llvm::legacy::FunctionPassManager fpm(&module);
|
||||
const auto name = module.getName();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue