@@ -106,6 +106,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
106106 let mut asm_gen = InlineAssemblyGenerator {
107107 tcx : fx. tcx ,
108108 arch : fx. tcx . sess . asm_arch . unwrap ( ) ,
109+ enclosing_def_id : fx. instance . def_id ( ) ,
109110 template,
110111 operands,
111112 options,
@@ -169,6 +170,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
169170struct InlineAssemblyGenerator < ' a , ' tcx > {
170171 tcx : TyCtxt < ' tcx > ,
171172 arch : InlineAsmArch ,
173+ enclosing_def_id : DefId ,
172174 template : & ' a [ InlineAsmTemplatePiece ] ,
173175 operands : & ' a [ InlineAsmOperand < ' tcx > ] ,
174176 options : InlineAsmOptions ,
@@ -185,7 +187,7 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
185187 let map = allocatable_registers (
186188 self . arch ,
187189 sess. relocation_model ( ) ,
188- & sess . target_features ,
190+ self . tcx . asm_target_features ( self . enclosing_def_id ) ,
189191 & sess. target ,
190192 ) ;
191193 let mut allocated = FxHashMap :: < _ , ( bool , bool ) > :: default ( ) ;
@@ -318,15 +320,9 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
318320 let mut new_slot = |x| new_slot_fn ( & mut slot_size, x) ;
319321
320322 // Allocate stack slots for saving clobbered registers
321- let abi_clobber = InlineAsmClobberAbi :: parse (
322- self . arch ,
323- self . tcx . sess . relocation_model ( ) ,
324- & self . tcx . sess . target_features ,
325- & self . tcx . sess . target ,
326- sym:: C ,
327- )
328- . unwrap ( )
329- . clobbered_regs ( ) ;
323+ let abi_clobber = InlineAsmClobberAbi :: parse ( self . arch , & self . tcx . sess . target , sym:: C )
324+ . unwrap ( )
325+ . clobbered_regs ( ) ;
330326 for ( i, reg) in self . registers . iter ( ) . enumerate ( ) . filter_map ( |( i, r) | r. map ( |r| ( i, r) ) ) {
331327 let mut need_save = true ;
332328 // If the register overlaps with a register clobbered by function call, then
0 commit comments