1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -O0 -run-pass=instruction-select -verify-machineinstrs %s -global-isel-abort=1 -o - | FileCheck %s
4 # This test checks that a shuffle mask with an undef value, instead of a constant,
5 # doesn't crash. The code generated definitely isn't optimal.
8 name: shuffle_undef_mask_elt
12 tracksRegLiveness: true
13 machineFunctionInfo: {}
18 ; CHECK-LABEL: name: shuffle_undef_mask_elt
20 ; CHECK: [[COPY:%[0-9]+]]:fpr64 = COPY $d0
21 ; CHECK: [[DEF:%[0-9]+]]:gpr32 = IMPLICIT_DEF
22 ; CHECK: [[DEF1:%[0-9]+]]:gpr32 = IMPLICIT_DEF
23 ; CHECK: [[DEF2:%[0-9]+]]:fpr128 = IMPLICIT_DEF
24 ; CHECK: [[INSERT_SUBREG:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF2]], [[DEF]], %subreg.ssub
25 ; CHECK: [[INSvi32gpr:%[0-9]+]]:fpr128 = INSvi32gpr [[INSERT_SUBREG]], 1, [[DEF1]]
26 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY [[INSvi32gpr]].dsub
27 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) %const.0
28 ; CHECK: [[LDRDui:%[0-9]+]]:fpr64 = LDRDui [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) %const.0
29 ; CHECK: [[DEF3:%[0-9]+]]:fpr128 = IMPLICIT_DEF
30 ; CHECK: [[INSERT_SUBREG1:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF3]], [[COPY]], %subreg.dsub
31 ; CHECK: [[DEF4:%[0-9]+]]:fpr128 = IMPLICIT_DEF
32 ; CHECK: [[INSERT_SUBREG2:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF4]], [[COPY1]], %subreg.dsub
33 ; CHECK: [[INSvi64lane:%[0-9]+]]:fpr128 = INSvi64lane [[INSERT_SUBREG1]], 1, [[INSERT_SUBREG2]], 0
34 ; CHECK: [[DEF5:%[0-9]+]]:fpr128 = IMPLICIT_DEF
35 ; CHECK: [[INSERT_SUBREG3:%[0-9]+]]:fpr128 = INSERT_SUBREG [[DEF5]], [[LDRDui]], %subreg.dsub
36 ; CHECK: [[TBLv16i8One:%[0-9]+]]:fpr128 = TBLv16i8One [[INSvi64lane]], [[INSERT_SUBREG3]]
37 ; CHECK: [[COPY2:%[0-9]+]]:fpr64 = COPY [[TBLv16i8One]].dsub
38 ; CHECK: $d0 = COPY [[COPY2]]
39 ; CHECK: RET_ReallyLR implicit $d0
40 %0:fpr(<2 x s32>) = COPY $d0
41 %6:gpr(s32) = G_IMPLICIT_DEF
42 %7:gpr(s32) = G_IMPLICIT_DEF
43 %2:fpr(<2 x s32>) = G_BUILD_VECTOR %6(s32), %7(s32)
44 %1:fpr(<2 x s32>) = G_SHUFFLE_VECTOR %0(<2 x s32>), %2, shufflemask(1, undef)
45 $d0 = COPY %1(<2 x s32>)
46 RET_ReallyLR implicit $d0