Skip to content

Commit c1ec76c

Browse files
committed
Removes the useless DisableSimplifyLibCalls parameter.
After applying no_builtins to the function attributes, we can remove the DisableSimplifyLibCalls parameter.
1 parent 30613d8 commit c1ec76c

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ pub(crate) unsafe fn llvm_optimize(
517517
unroll_loops,
518518
config.vectorize_slp,
519519
config.vectorize_loop,
520-
config.no_builtins,
521520
config.emit_lifetime_markers,
522521
sanitizer_options.as_ref(),
523522
pgo_gen_path.as_ref().map_or(std::ptr::null(), |s| s.as_ptr()),
@@ -632,15 +631,14 @@ pub(crate) unsafe fn codegen(
632631
unsafe fn with_codegen<'ll, F, R>(
633632
tm: &'ll llvm::TargetMachine,
634633
llmod: &'ll llvm::Module,
635-
no_builtins: bool,
636634
f: F,
637635
) -> R
638636
where
639637
F: FnOnce(&'ll mut PassManager<'ll>) -> R,
640638
{
641639
let cpm = llvm::LLVMCreatePassManager();
642640
llvm::LLVMAddAnalysisPasses(tm, cpm);
643-
llvm::LLVMRustAddLibraryInfo(cpm, llmod, no_builtins);
641+
llvm::LLVMRustAddLibraryInfo(cpm, llmod);
644642
f(cpm)
645643
}
646644

@@ -743,7 +741,7 @@ pub(crate) unsafe fn codegen(
743741
} else {
744742
llmod
745743
};
746-
with_codegen(tm, llmod, config.no_builtins, |cpm| {
744+
with_codegen(tm, llmod, |cpm| {
747745
write_output_file(
748746
diag_handler,
749747
tm,
@@ -778,7 +776,7 @@ pub(crate) unsafe fn codegen(
778776
(_, SplitDwarfKind::Split) => Some(dwo_out.as_path()),
779777
};
780778

781-
with_codegen(tm, llmod, config.no_builtins, |cpm| {
779+
with_codegen(tm, llmod, |cpm| {
782780
write_output_file(
783781
diag_handler,
784782
tm,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -2123,11 +2123,7 @@ extern "C" {
21232123
ForceEmulatedTls: bool,
21242124
) -> Option<&'static mut TargetMachine>;
21252125
pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
2126-
pub fn LLVMRustAddLibraryInfo<'a>(
2127-
PM: &PassManager<'a>,
2128-
M: &'a Module,
2129-
DisableSimplifyLibCalls: bool,
2130-
);
2126+
pub fn LLVMRustAddLibraryInfo<'a>(PM: &PassManager<'a>, M: &'a Module);
21312127
pub fn LLVMRustWriteOutputFile<'a>(
21322128
T: &'a TargetMachine,
21332129
PM: &PassManager<'a>,
@@ -2149,7 +2145,6 @@ extern "C" {
21492145
UnrollLoops: bool,
21502146
SLPVectorize: bool,
21512147
LoopVectorize: bool,
2152-
DisableSimplifyLibCalls: bool,
21532148
EmitLifetimeMarkers: bool,
21542149
SanitizerOptions: Option<&SanitizerOptions>,
21552150
PGOGenPath: *const c_char,

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,9 @@ extern "C" void LLVMRustDisposeTargetMachine(LLVMTargetMachineRef TM) {
466466

467467
// Unfortunately, the LLVM C API doesn't provide a way to create the
468468
// TargetLibraryInfo pass, so we use this method to do so.
469-
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M,
470-
bool DisableSimplifyLibCalls) {
469+
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M) {
471470
Triple TargetTriple(unwrap(M)->getTargetTriple());
472471
TargetLibraryInfoImpl TLII(TargetTriple);
473-
if (DisableSimplifyLibCalls)
474-
TLII.disableAllFunctions();
475472
unwrap(PMR)->add(new TargetLibraryInfoWrapperPass(TLII));
476473
}
477474

@@ -630,7 +627,7 @@ LLVMRustOptimize(
630627
bool IsLinkerPluginLTO,
631628
bool NoPrepopulatePasses, bool VerifyIR, bool UseThinLTOBuffers,
632629
bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize,
633-
bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
630+
bool EmitLifetimeMarkers,
634631
LLVMRustSanitizerOptions *SanitizerOptions,
635632
const char *PGOGenPath, const char *PGOUsePath,
636633
bool InstrumentCoverage, const char *InstrProfileOutput,
@@ -722,8 +719,6 @@ LLVMRustOptimize(
722719

723720
Triple TargetTriple(TheModule->getTargetTriple());
724721
std::unique_ptr<TargetLibraryInfoImpl> TLII(new TargetLibraryInfoImpl(TargetTriple));
725-
if (DisableSimplifyLibCalls)
726-
TLII->disableAllFunctions();
727722
FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); });
728723

729724
PB.registerModuleAnalyses(MAM);

0 commit comments

Comments
 (0)