From 07114e6bc69106fb77beb879a8a2f78a4ba4b256 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Mon, 30 Jun 2025 07:01:35 +0200 Subject: llvm: Disable the machine outliner pass on RISC-V --- src/zig_llvm.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/zig_llvm.cpp') diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp index cb624ea256..fe4e421dc3 100644 --- a/src/zig_llvm.cpp +++ b/src/zig_llvm.cpp @@ -260,6 +260,16 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi TargetMachine &target_machine = *reinterpret_cast(targ_machine_ref); + if (options->allow_fast_isel) { + target_machine.setO0WantsFastISel(true); + } else { + target_machine.setFastISel(false); + } + + if (!options->allow_machine_outliner) { + target_machine.setMachineOutliner(false); + } + Module &llvm_module = *unwrap(module_ref); // Pipeline configurations @@ -385,12 +395,6 @@ ZIG_EXTERN_C bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machi } } - if (options->allow_fast_isel) { - target_machine.setO0WantsFastISel(true); - } else { - target_machine.setFastISel(false); - } - // Optimization phase module_pm.run(llvm_module, module_am); -- cgit v1.2.3