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 {
15071507 pub fn get_symbol_mangling_version ( & self ) -> SymbolManglingVersion {
15081508 self . cg . symbol_mangling_version . unwrap_or ( SymbolManglingVersion :: Legacy )
15091509 }
1510+
1511+ #[ inline]
1512+ pub fn autodiff_enabled ( & self ) -> bool {
1513+ self . unstable_opts . autodiff . contains ( & AutoDiff :: Enable )
1514+ }
15101515}
15111516
15121517impl UnstableOptions {
Original file line number Diff line number Diff line change @@ -658,6 +658,11 @@ impl Session {
658658
659659 /// Calculates the flavor of LTO to use for this compilation.
660660 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+
661666 // If our target has codegen requirements ignore the command line
662667 if self . target . requires_lto {
663668 return config:: Lto :: Fat ;
You can’t perform that action at this time.
0 commit comments