@@ -366,6 +366,9 @@ impl<'a, F: Function> Env<'a, F> {
366366
367367 for pos in & [ OperandPos :: Late , OperandPos :: Early ] {
368368 for op in self . func . inst_operands ( inst) {
369+ if op. as_fixed_nonallocatable ( ) . is_some ( ) {
370+ continue ;
371+ }
369372 if op. pos ( ) == * pos {
370373 let was_live = live. get ( op. vreg ( ) . vreg ( ) ) ;
371374 trace ! ( "op {:?} was_live = {}" , op, was_live) ;
@@ -511,6 +514,9 @@ impl<'a, F: Function> Env<'a, F> {
511514 let mut reused_input = None ;
512515 for op in self . func . inst_operands ( inst) {
513516 if let OperandConstraint :: Reuse ( i) = op. constraint ( ) {
517+ debug_assert ! ( self . func. inst_operands( inst) [ i]
518+ . as_fixed_nonallocatable( )
519+ . is_none( ) ) ;
514520 reused_input = Some ( self . func . inst_operands ( inst) [ i] . vreg ( ) ) ;
515521 break ;
516522 }
@@ -931,6 +937,9 @@ impl<'a, F: Function> Env<'a, F> {
931937 let mut operand_rewrites: FxHashMap < usize , Operand > = FxHashMap :: default ( ) ;
932938 let mut late_def_fixed: SmallVec < [ ( PReg , Operand , usize ) ; 2 ] > = smallvec ! [ ] ;
933939 for ( i, & operand) in self . func . inst_operands ( inst) . iter ( ) . enumerate ( ) {
940+ if operand. as_fixed_nonallocatable ( ) . is_some ( ) {
941+ continue ;
942+ }
934943 if let OperandConstraint :: FixedReg ( preg) = operand. constraint ( ) {
935944 match operand. pos ( ) {
936945 OperandPos :: Late => {
@@ -952,6 +961,9 @@ impl<'a, F: Function> Env<'a, F> {
952961 }
953962 }
954963 for ( i, & operand) in self . func . inst_operands ( inst) . iter ( ) . enumerate ( ) {
964+ if operand. as_fixed_nonallocatable ( ) . is_some ( ) {
965+ continue ;
966+ }
955967 if let OperandConstraint :: FixedReg ( preg) = operand. constraint ( ) {
956968 match operand. pos ( ) {
957969 OperandPos :: Early => {
@@ -1057,6 +1069,15 @@ impl<'a, F: Function> Env<'a, F> {
10571069 operand
10581070 ) ;
10591071
1072+ // If this is a "fixed non-allocatable
1073+ // register" operand, set the alloc
1074+ // immediately and then ignore the operand
1075+ // hereafter.
1076+ if let Some ( preg) = operand. as_fixed_nonallocatable ( ) {
1077+ self . set_alloc ( inst, i, Allocation :: reg ( preg) ) ;
1078+ continue ;
1079+ }
1080+
10601081 match operand. kind ( ) {
10611082 OperandKind :: Def | OperandKind :: Mod => {
10621083 trace ! ( "Def of {} at {:?}" , operand. vreg( ) , pos) ;
0 commit comments