@@ -106,6 +106,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
106
106
let mut asm_gen = InlineAssemblyGenerator {
107
107
tcx : fx. tcx ,
108
108
arch : fx. tcx . sess . asm_arch . unwrap ( ) ,
109
+ enclosing_def_id : fx. instance . def_id ( ) ,
109
110
template,
110
111
operands,
111
112
options,
@@ -169,6 +170,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
169
170
struct InlineAssemblyGenerator < ' a , ' tcx > {
170
171
tcx : TyCtxt < ' tcx > ,
171
172
arch : InlineAsmArch ,
173
+ enclosing_def_id : DefId ,
172
174
template : & ' a [ InlineAsmTemplatePiece ] ,
173
175
operands : & ' a [ InlineAsmOperand < ' tcx > ] ,
174
176
options : InlineAsmOptions ,
@@ -185,7 +187,7 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
185
187
let map = allocatable_registers (
186
188
self . arch ,
187
189
sess. relocation_model ( ) ,
188
- & sess . target_features ,
190
+ self . tcx . asm_target_features ( self . enclosing_def_id ) ,
189
191
& sess. target ,
190
192
) ;
191
193
let mut allocated = FxHashMap :: < _ , ( bool , bool ) > :: default ( ) ;
@@ -318,15 +320,9 @@ impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
318
320
let mut new_slot = |x| new_slot_fn ( & mut slot_size, x) ;
319
321
320
322
// 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 ( ) ;
330
326
for ( i, reg) in self . registers . iter ( ) . enumerate ( ) . filter_map ( |( i, r) | r. map ( |r| ( i, r) ) ) {
331
327
let mut need_save = true ;
332
328
// If the register overlaps with a register clobbered by function call, then
0 commit comments