Skip to content

Commit 7fa7f2d

Browse files
committed
Removes the useless DisableSimplifyLibCalls parameter.
After applying no_builtins to the function attributes, we can remove the DisableSimplifyLibCalls parameter.
1 parent 22539e0 commit 7fa7f2d

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ pub(crate) unsafe fn llvm_optimize(
563563
unroll_loops,
564564
config.vectorize_slp,
565565
config.vectorize_loop,
566-
config.no_builtins,
567566
config.emit_lifetime_markers,
568567
sanitizer_options.as_ref(),
569568
pgo_gen_path.as_ref().map_or(std::ptr::null(), |s| s.as_ptr()),
@@ -678,15 +677,14 @@ pub(crate) unsafe fn codegen(
678677
unsafe fn with_codegen<'ll, F, R>(
679678
tm: &'ll llvm::TargetMachine,
680679
llmod: &'ll llvm::Module,
681-
no_builtins: bool,
682680
f: F,
683681
) -> R
684682
where
685683
F: FnOnce(&'ll mut PassManager<'ll>) -> R,
686684
{
687685
let cpm = llvm::LLVMCreatePassManager();
688686
llvm::LLVMAddAnalysisPasses(tm, cpm);
689-
llvm::LLVMRustAddLibraryInfo(cpm, llmod, no_builtins);
687+
llvm::LLVMRustAddLibraryInfo(cpm, llmod);
690688
f(cpm)
691689
}
692690

@@ -789,7 +787,7 @@ pub(crate) unsafe fn codegen(
789787
} else {
790788
llmod
791789
};
792-
with_codegen(tm, llmod, config.no_builtins, |cpm| {
790+
with_codegen(tm, llmod, |cpm| {
793791
write_output_file(
794792
diag_handler,
795793
tm,
@@ -824,7 +822,7 @@ pub(crate) unsafe fn codegen(
824822
(_, SplitDwarfKind::Split) => Some(dwo_out.as_path()),
825823
};
826824

827-
with_codegen(tm, llmod, config.no_builtins, |cpm| {
825+
with_codegen(tm, llmod, |cpm| {
828826
write_output_file(
829827
diag_handler,
830828
tm,

compiler/rustc_codegen_llvm/src/llvm/ffi.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -2139,13 +2139,8 @@ extern "C" {
21392139
ArgsCstrBuff: *const c_char,
21402140
ArgsCstrBuffLen: usize,
21412141
) -> *mut TargetMachine;
2142-
21432142
pub fn LLVMRustDisposeTargetMachine(T: *mut TargetMachine);
2144-
pub fn LLVMRustAddLibraryInfo<'a>(
2145-
PM: &PassManager<'a>,
2146-
M: &'a Module,
2147-
DisableSimplifyLibCalls: bool,
2148-
);
2143+
pub fn LLVMRustAddLibraryInfo<'a>(PM: &PassManager<'a>, M: &'a Module);
21492144
pub fn LLVMRustWriteOutputFile<'a>(
21502145
T: &'a TargetMachine,
21512146
PM: &PassManager<'a>,
@@ -2167,7 +2162,6 @@ extern "C" {
21672162
UnrollLoops: bool,
21682163
SLPVectorize: bool,
21692164
LoopVectorize: bool,
2170-
DisableSimplifyLibCalls: bool,
21712165
EmitLifetimeMarkers: bool,
21722166
SanitizerOptions: Option<&SanitizerOptions>,
21732167
PGOGenPath: *const c_char,

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

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

536536
// Unfortunately, the LLVM C API doesn't provide a way to create the
537537
// TargetLibraryInfo pass, so we use this method to do so.
538-
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M,
539-
bool DisableSimplifyLibCalls) {
538+
extern "C" void LLVMRustAddLibraryInfo(LLVMPassManagerRef PMR, LLVMModuleRef M) {
540539
Triple TargetTriple(unwrap(M)->getTargetTriple());
541540
TargetLibraryInfoImpl TLII(TargetTriple);
542-
if (DisableSimplifyLibCalls)
543-
TLII.disableAllFunctions();
544541
unwrap(PMR)->add(new TargetLibraryInfoWrapperPass(TLII));
545542
}
546543

@@ -707,7 +704,7 @@ LLVMRustOptimize(
707704
bool IsLinkerPluginLTO,
708705
bool NoPrepopulatePasses, bool VerifyIR, bool UseThinLTOBuffers,
709706
bool MergeFunctions, bool UnrollLoops, bool SLPVectorize, bool LoopVectorize,
710-
bool DisableSimplifyLibCalls, bool EmitLifetimeMarkers,
707+
bool EmitLifetimeMarkers,
711708
LLVMRustSanitizerOptions *SanitizerOptions,
712709
const char *PGOGenPath, const char *PGOUsePath,
713710
bool InstrumentCoverage, const char *InstrProfileOutput,
@@ -799,8 +796,6 @@ LLVMRustOptimize(
799796

800797
Triple TargetTriple(TheModule->getTargetTriple());
801798
std::unique_ptr<TargetLibraryInfoImpl> TLII(new TargetLibraryInfoImpl(TargetTriple));
802-
if (DisableSimplifyLibCalls)
803-
TLII->disableAllFunctions();
804799
FAM.registerPass([&] { return TargetLibraryAnalysis(*TLII); });
805800

806801
PB.registerModuleAnalyses(MAM);

0 commit comments

Comments
 (0)