@@ -14,7 +14,6 @@ use rustc_codegen_ssa::traits::{BaseTypeMethods, BuilderMethods};
14
14
#[ cfg( feature = "master" ) ]
15
15
use rustc_hir as hir;
16
16
use rustc_middle:: mir:: BinOp ;
17
- use rustc_middle:: span_bug;
18
17
use rustc_middle:: ty:: layout:: HasTyCtxt ;
19
18
use rustc_middle:: ty:: { self , Ty } ;
20
19
use rustc_span:: { sym, Span , Symbol } ;
@@ -353,24 +352,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
353
352
}
354
353
355
354
if name == sym:: simd_shuffle {
356
- // Make sure this is actually an array or SIMD vector, since typeck only checks the length-suffixed
357
- // version of this intrinsic.
355
+ // Make sure this is actually a SIMD vector.
358
356
let idx_ty = args[ 2 ] . layout . ty ;
359
- let n: u64 = match idx_ty. kind ( ) {
360
- ty:: Array ( ty, len) if matches ! ( * ty. kind( ) , ty:: Uint ( ty:: UintTy :: U32 ) ) => {
361
- len. try_eval_target_usize ( bx. cx . tcx , ty:: ParamEnv :: reveal_all ( ) ) . unwrap_or_else (
362
- || span_bug ! ( span, "could not evaluate shuffle index array length" ) ,
363
- )
364
- }
365
- _ if idx_ty. is_simd ( )
366
- && matches ! (
367
- idx_ty. simd_size_and_type( bx. cx. tcx) . 1 . kind( ) ,
368
- ty:: Uint ( ty:: UintTy :: U32 )
369
- ) =>
370
- {
371
- idx_ty. simd_size_and_type ( bx. cx . tcx ) . 0
372
- }
373
- _ => return_error ! ( InvalidMonomorphization :: SimdShuffle { span, name, ty: idx_ty } ) ,
357
+ let n: u64 = if idx_ty. is_simd ( )
358
+ && matches ! ( idx_ty. simd_size_and_type( bx. cx. tcx) . 1 . kind( ) , ty:: Uint ( ty:: UintTy :: U32 ) )
359
+ {
360
+ idx_ty. simd_size_and_type ( bx. cx . tcx ) . 0
361
+ } else {
362
+ return_error ! ( InvalidMonomorphization :: SimdShuffle { span, name, ty: idx_ty } )
374
363
} ;
375
364
require_simd ! ( ret_ty, InvalidMonomorphization :: SimdReturn { span, name, ty: ret_ty } ) ;
376
365
0 commit comments