File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1507,6 +1507,11 @@ impl Options {
1507
1507
pub fn get_symbol_mangling_version ( & self ) -> SymbolManglingVersion {
1508
1508
self . cg . symbol_mangling_version . unwrap_or ( SymbolManglingVersion :: Legacy )
1509
1509
}
1510
+
1511
+ #[ inline]
1512
+ pub fn autodiff_enabled ( & self ) -> bool {
1513
+ self . unstable_opts . autodiff . contains ( & AutoDiff :: Enable )
1514
+ }
1510
1515
}
1511
1516
1512
1517
impl UnstableOptions {
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ impl Session {
658
658
659
659
/// Calculates the flavor of LTO to use for this compilation.
660
660
pub fn lto ( & self ) -> config:: Lto {
661
+ // if autodiff is enabled, use fat lto
662
+ if self . opts . autodiff_enabled ( ) {
663
+ return config:: Lto :: Fat ;
664
+ }
665
+
661
666
// If our target has codegen requirements ignore the command line
662
667
if self . target . requires_lto {
663
668
return config:: Lto :: Fat ;
You can’t perform that action at this time.
0 commit comments