@@ -791,25 +791,34 @@ fn codegen_stmt<'tcx>(
791
791
| StatementKind :: Nop
792
792
| StatementKind :: FakeRead ( ..)
793
793
| StatementKind :: Retag { .. }
794
- // We ignore `assume` intrinsics, they are only useful for optimizations
795
- | StatementKind :: Assume ( ..)
796
794
| StatementKind :: AscribeUserType ( ..) => { }
797
795
798
796
StatementKind :: Coverage { .. } => fx. tcx . sess . fatal ( "-Zcoverage is unimplemented" ) ,
799
- StatementKind :: CopyNonOverlapping ( inner) => {
800
- let dst = codegen_operand ( fx, & inner. dst ) ;
801
- let pointee = dst
802
- . layout ( )
803
- . pointee_info_at ( fx, rustc_target:: abi:: Size :: ZERO )
804
- . expect ( "Expected pointer" ) ;
805
- let dst = dst. load_scalar ( fx) ;
806
- let src = codegen_operand ( fx, & inner. src ) . load_scalar ( fx) ;
807
- let count = codegen_operand ( fx, & inner. count ) . load_scalar ( fx) ;
808
- let elem_size: u64 = pointee. size . bytes ( ) ;
809
- let bytes =
810
- if elem_size != 1 { fx. bcx . ins ( ) . imul_imm ( count, elem_size as i64 ) } else { count } ;
811
- fx. bcx . call_memcpy ( fx. target_config , dst, src, bytes) ;
812
- }
797
+ StatementKind :: Intrinsic ( ref intrinsic) => match & * * intrinsic {
798
+ // We ignore `assume` intrinsics, they are only useful for optimizations
799
+ NonDivergingIntrinsic :: Assume ( _) => { }
800
+ NonDivergingIntrinsic :: CopyNonOverlapping ( mir:: CopyNonOverlapping {
801
+ src,
802
+ dst,
803
+ count,
804
+ } ) => {
805
+ let dst = codegen_operand ( fx, dst) ;
806
+ let pointee = dst
807
+ . layout ( )
808
+ . pointee_info_at ( fx, rustc_target:: abi:: Size :: ZERO )
809
+ . expect ( "Expected pointer" ) ;
810
+ let dst = dst. load_scalar ( fx) ;
811
+ let src = codegen_operand ( fx, src) . load_scalar ( fx) ;
812
+ let count = codegen_operand ( fx, count) . load_scalar ( fx) ;
813
+ let elem_size: u64 = pointee. size . bytes ( ) ;
814
+ let bytes = if elem_size != 1 {
815
+ fx. bcx . ins ( ) . imul_imm ( count, elem_size as i64 )
816
+ } else {
817
+ count
818
+ } ;
819
+ fx. bcx . call_memcpy ( fx. target_config , dst, src, bytes) ;
820
+ }
821
+ } ,
813
822
}
814
823
}
815
824
0 commit comments