rustc_llvm: rustc_trans: Thread the PGO config down to the pass manager builder.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
50a38725e1
commit
324ca7acd5
3 changed files with 46 additions and 7 deletions
|
@ -428,12 +428,22 @@ extern "C" void LLVMRustAddAnalysisPasses(LLVMTargetMachineRef TM,
|
|||
|
||||
extern "C" void LLVMRustConfigurePassManagerBuilder(
|
||||
LLVMPassManagerBuilderRef PMBR, LLVMRustCodeGenOptLevel OptLevel,
|
||||
bool MergeFunctions, bool SLPVectorize, bool LoopVectorize) {
|
||||
bool MergeFunctions, bool SLPVectorize, bool LoopVectorize,
|
||||
const char* PGOGenPath, const char* PGOUsePath) {
|
||||
// Ignore mergefunc for now as enabling it causes crashes.
|
||||
// unwrap(PMBR)->MergeFunctions = MergeFunctions;
|
||||
unwrap(PMBR)->SLPVectorize = SLPVectorize;
|
||||
unwrap(PMBR)->OptLevel = fromRust(OptLevel);
|
||||
unwrap(PMBR)->LoopVectorize = LoopVectorize;
|
||||
if (PGOGenPath) {
|
||||
assert(!PGOUsePath);
|
||||
unwrap(PMBR)->EnablePGOInstrGen = true;
|
||||
unwrap(PMBR)->PGOInstrGen = PGOGenPath;
|
||||
}
|
||||
if (PGOUsePath) {
|
||||
assert(!PGOGenPath);
|
||||
unwrap(PMBR)->PGOInstrUse = PGOUsePath;
|
||||
}
|
||||
}
|
||||
|
||||
// Unfortunately, the LLVM C API doesn't provide a way to set the `LibraryInfo`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue