Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ddd8f92
moved 8 tests to organized locations
Delta17920 Feb 4, 2026
1584104
renamed few tests
Delta17920 Feb 4, 2026
b2dd13a
Support AVRTiny devices in AVR inline assembly
taiki-e Feb 7, 2026
c89a89b
Fix multi-cgu+debug builds using autodiff by delaying autodiff till lto
ZuseZ4 Feb 11, 2026
576901f
Don't use `DepContext` in `rustc_middle::traits::cache`
Zalathar Feb 12, 2026
caf7cdf
Improve code suggestion for incorrect macro_rules! usage
chenyukang Jan 31, 2026
c6f57be
remove redundant backchain attribute in codegen
fneddy Feb 11, 2026
8cc4b93
Change query proc macro to be more rust-analyzer friendly
Zoxc Feb 9, 2026
d8ed639
sparc64: enable abi compatibility test
folkertdev Feb 12, 2026
506ed6d
Remove SelfProfilerRef from CodegenContext
bjorn3 Feb 12, 2026
2c44bb1
Support serializing CodegenContext
bjorn3 Feb 11, 2026
891acbd
`-Znext-solver` Prevent committing unfulfilled unsized coercion
ShoyuVanilla Feb 10, 2026
60f802f
reject inline const patterns pre-expansion
dianne Feb 12, 2026
3986c23
Rollup merge of #146901 - taiki-e:avrtiny, r=Amanieu
JonathanBrouwer Feb 12, 2026
1bc462b
Rollup merge of #150988 - chenyukang:yukang-fix-150899-macro-rules, r…
JonathanBrouwer Feb 12, 2026
12a1bcb
Rollup merge of #152422 - Zoxc:query-macro-tweaks, r=Zalathar
JonathanBrouwer Feb 12, 2026
67885b4
Rollup merge of #152496 - ZuseZ4:fix-autodiff-dbg-build, r=bjorn3
JonathanBrouwer Feb 12, 2026
47fe214
Rollup merge of #152520 - Zalathar:traits-cache, r=dingxiangfei2009
JonathanBrouwer Feb 12, 2026
0d6f70e
Rollup merge of #152528 - bjorn3:lto_refactors11, r=petrochenkov
JonathanBrouwer Feb 12, 2026
bfcd487
Rollup merge of #152082 - Delta17920:move-tests, r=chenyukang,Kivooeo
JonathanBrouwer Feb 12, 2026
da7b61d
Rollup merge of #152444 - ShoyuVanilla:unsized-recursion-limit, r=lcnr
JonathanBrouwer Feb 12, 2026
682c848
Rollup merge of #152486 - fneddy:s390x_simplify_backchain, r=dingxian…
JonathanBrouwer Feb 12, 2026
e76c9ca
Rollup merge of #152529 - folkertdev:sparc64-enable-abi-compat-test, …
JonathanBrouwer Feb 12, 2026
fa90379
Rollup merge of #152548 - dianne:reject-const-block-pat-pre-expansion…
JonathanBrouwer Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions compiler/rustc_codegen_gcc/src/back/lto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, SharedEmitter}
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file};
use rustc_data_structures::memmap::Mmap;
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_errors::{DiagCtxt, DiagCtxtHandle};
use rustc_log::tracing::info;
use rustc_middle::bug;
Expand Down Expand Up @@ -112,6 +113,7 @@ fn save_as_file(obj: &[u8], path: &Path) -> Result<(), LtoBitcodeFromRlib> {
/// for further optimization.
pub(crate) fn run_fat(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<GccCodegenBackend>>,
Expand All @@ -123,6 +125,7 @@ pub(crate) fn run_fat(
lto_data.symbols_below_threshold.iter().map(|c| c.as_ptr()).collect::<Vec<_>>();*/
fat_lto(
cgcx,
prof,
dcx,
modules,
lto_data.upstream_modules,
Expand All @@ -133,13 +136,14 @@ pub(crate) fn run_fat(

fn fat_lto(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
_dcx: DiagCtxtHandle<'_>,
modules: Vec<FatLtoInput<GccCodegenBackend>>,
mut serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
tmp_path: TempDir,
//symbols_below_threshold: &[String],
) -> ModuleCodegen<GccContext> {
let _timer = cgcx.prof.generic_activity("GCC_fat_lto_build_monolithic_module");
let _timer = prof.generic_activity("GCC_fat_lto_build_monolithic_module");
info!("going for a fat lto");

// Sort out all our lists of incoming modules into two lists.
Expand Down Expand Up @@ -223,8 +227,7 @@ fn fat_lto(
// We add the object files and save in should_combine_object_files that we should combine
// them into a single object file when compiling later.
for (bc_decoded, name) in serialized_modules {
let _timer = cgcx
.prof
let _timer = prof
.generic_activity_with_arg_recorder("GCC_fat_lto_link_module", |recorder| {
recorder.record_arg(format!("{:?}", name))
});
Expand Down Expand Up @@ -284,6 +287,7 @@ impl ModuleBufferMethods for ModuleBuffer {
/// can simply be copied over from the incr. comp. cache.
pub(crate) fn run_thin(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
dcx: DiagCtxtHandle<'_>,
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<(String, ThinBuffer)>,
Expand All @@ -298,6 +302,7 @@ pub(crate) fn run_thin(
}
thin_lto(
cgcx,
prof,
dcx,
modules,
lto_data.upstream_modules,
Expand Down Expand Up @@ -345,15 +350,16 @@ pub(crate) fn prepare_thin(module: ModuleCodegen<GccContext>) -> (String, ThinBu
/// all of the `LtoModuleCodegen` units returned below and destroyed once
/// they all go out of scope.
fn thin_lto(
cgcx: &CodegenContext,
_cgcx: &CodegenContext,
prof: &SelfProfilerRef,
_dcx: DiagCtxtHandle<'_>,
modules: Vec<(String, ThinBuffer)>,
serialized_modules: Vec<(SerializedModule<ModuleBuffer>, CString)>,
tmp_path: TempDir,
cached_modules: Vec<(SerializedModule<ModuleBuffer>, WorkProduct)>,
//_symbols_below_threshold: &[String],
) -> (Vec<ThinModule<GccCodegenBackend>>, Vec<WorkProduct>) {
let _timer = cgcx.prof.generic_activity("LLVM_thin_lto_global_analysis");
let _timer = prof.generic_activity("LLVM_thin_lto_global_analysis");
info!("going for that thin, thin LTO");

/*let green_modules: FxHashMap<_, _> =
Expand Down
22 changes: 10 additions & 12 deletions compiler/rustc_codegen_gcc/src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use rustc_codegen_ssa::back::write::{
BitcodeSection, CodegenContext, EmitObj, ModuleConfig, SharedEmitter,
};
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_errors::DiagCtxt;
use rustc_fs_util::link_or_copy;
use rustc_log::tracing::debug;
Expand All @@ -18,14 +19,15 @@ use crate::{GccContext, LtoMode};

pub(crate) fn codegen(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
module: ModuleCodegen<GccContext>,
config: &ModuleConfig,
) -> CompiledModule {
let dcx = DiagCtxt::new(Box::new(shared_emitter.clone()));
let dcx = dcx.handle();

let _timer = cgcx.prof.generic_activity_with_arg("GCC_module_codegen", &*module.name);
let _timer = prof.generic_activity_with_arg("GCC_module_codegen", &*module.name);
{
let context = &module.module_llvm.context;

Expand All @@ -44,9 +46,8 @@ pub(crate) fn codegen(
);

if config.bitcode_needed() {
let _timer = cgcx
.prof
.generic_activity_with_arg("GCC_module_codegen_make_bitcode", &*module.name);
let _timer =
prof.generic_activity_with_arg("GCC_module_codegen_make_bitcode", &*module.name);

// TODO(antoyo)
/*if let Some(bitcode_filename) = bc_out.file_name() {
Expand All @@ -58,8 +59,7 @@ pub(crate) fn codegen(
}*/

if config.emit_bc || config.emit_obj == EmitObj::Bitcode {
let _timer = cgcx
.prof
let _timer = prof
.generic_activity_with_arg("GCC_module_codegen_emit_bitcode", &*module.name);
if lto_supported {
context.add_command_line_option("-flto=auto");
Expand All @@ -70,8 +70,7 @@ pub(crate) fn codegen(
}

if config.emit_obj == EmitObj::ObjectCode(BitcodeSection::Full) {
let _timer = cgcx
.prof
let _timer = prof
.generic_activity_with_arg("GCC_module_codegen_embed_bitcode", &*module.name);
if lto_supported {
// TODO(antoyo): maybe we should call embed_bitcode to have the proper iOS fixes?
Expand All @@ -98,7 +97,7 @@ pub(crate) fn codegen(

if config.emit_asm {
let _timer =
cgcx.prof.generic_activity_with_arg("GCC_module_codegen_emit_asm", &*module.name);
prof.generic_activity_with_arg("GCC_module_codegen_emit_asm", &*module.name);
let path = cgcx.output_filenames.temp_path_for_cgu(
OutputType::Assembly,
&module.name,
Expand All @@ -109,9 +108,8 @@ pub(crate) fn codegen(

match config.emit_obj {
EmitObj::ObjectCode(_) => {
let _timer = cgcx
.prof
.generic_activity_with_arg("GCC_module_codegen_emit_obj", &*module.name);
let _timer =
prof.generic_activity_with_arg("GCC_module_codegen_emit_obj", &*module.name);
if env::var("CG_GCCJIT_DUMP_MODULE_NAMES").as_deref() == Ok("1") {
println!("Module {}", module.name);
}
Expand Down
12 changes: 9 additions & 3 deletions compiler/rustc_codegen_gcc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ use rustc_codegen_ssa::target_features::cfg_target_feature;
use rustc_codegen_ssa::traits::{CodegenBackend, ExtraBackendMethods, WriteBackendMethods};
use rustc_codegen_ssa::{CodegenResults, CompiledModule, ModuleCodegen, TargetConfig};
use rustc_data_structures::fx::FxIndexMap;
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_data_structures::sync::IntoDynSyncSend;
use rustc_errors::DiagCtxtHandle;
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
Expand Down Expand Up @@ -427,26 +428,28 @@ impl WriteBackendMethods for GccCodegenBackend {

fn run_and_optimize_fat_lto(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
_tm_factory: TargetMachineFactoryFn<Self>,
// FIXME(bjorn3): Limit LTO exports to these symbols
_exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<FatLtoInput<Self>>,
) -> ModuleCodegen<Self::Module> {
back::lto::run_fat(cgcx, shared_emitter, each_linked_rlib_for_lto, modules)
back::lto::run_fat(cgcx, prof, shared_emitter, each_linked_rlib_for_lto, modules)
}

fn run_thin_lto(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
dcx: DiagCtxtHandle<'_>,
// FIXME(bjorn3): Limit LTO exports to these symbols
_exported_symbols_for_lto: &[String],
each_linked_rlib_for_lto: &[PathBuf],
modules: Vec<(String, Self::ThinBuffer)>,
cached_modules: Vec<(SerializedModule<Self::ModuleBuffer>, WorkProduct)>,
) -> (Vec<ThinModule<Self>>, Vec<WorkProduct>) {
back::lto::run_thin(cgcx, dcx, each_linked_rlib_for_lto, modules, cached_modules)
back::lto::run_thin(cgcx, prof, dcx, each_linked_rlib_for_lto, modules, cached_modules)
}

fn print_pass_timings(&self) {
Expand All @@ -459,6 +462,7 @@ impl WriteBackendMethods for GccCodegenBackend {

fn optimize(
_cgcx: &CodegenContext,
_prof: &SelfProfilerRef,
_shared_emitter: &SharedEmitter,
module: &mut ModuleCodegen<Self::Module>,
config: &ModuleConfig,
Expand All @@ -468,6 +472,7 @@ impl WriteBackendMethods for GccCodegenBackend {

fn optimize_thin(
cgcx: &CodegenContext,
_prof: &SelfProfilerRef,
_shared_emitter: &SharedEmitter,
_tm_factory: TargetMachineFactoryFn<Self>,
thin: ThinModule<Self>,
Expand All @@ -477,11 +482,12 @@ impl WriteBackendMethods for GccCodegenBackend {

fn codegen(
cgcx: &CodegenContext,
prof: &SelfProfilerRef,
shared_emitter: &SharedEmitter,
module: ModuleCodegen<Self::Module>,
config: &ModuleConfig,
) -> CompiledModule {
back::write::codegen(cgcx, shared_emitter, module, config)
back::write::codegen(cgcx, prof, shared_emitter, module, config)
}

fn prepare_thin(module: ModuleCodegen<Self::Module>) -> (String, Self::ThinBuffer) {
Expand Down
14 changes: 0 additions & 14 deletions compiler/rustc_codegen_llvm/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,6 @@ fn stackprotector_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll A
Some(sspattr.create_attr(cx.llcx))
}

fn backchain_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> Option<&'ll Attribute> {
if sess.target.arch != Arch::S390x {
return None;
}

let requested_features = sess.opts.cg.target_feature.split(',');
let found_positive = requested_features.clone().any(|r| r == "+backchain");

if found_positive { Some(llvm::CreateAttrString(cx.llcx, "backchain")) } else { None }
}

pub(crate) fn target_cpu_attr<'ll>(cx: &SimpleCx<'ll>, sess: &Session) -> &'ll Attribute {
let target_cpu = llvm_util::target_cpu(sess);
llvm::CreateAttrStringValue(cx.llcx, "target-cpu", target_cpu)
Expand Down Expand Up @@ -530,9 +519,6 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
if let Some(align) = codegen_fn_attrs.alignment {
llvm::set_alignment(llfn, align);
}
if let Some(backchain) = backchain_attr(cx, sess) {
to_add.push(backchain);
}
to_add.extend(patchable_function_entry_attrs(
cx,
sess,
Expand Down
Loading
Loading