From: Amara Emerson Date: Wed, 29 Sep 2021 09:09:21 +0000 (-0700) Subject: [AArch64][GlobalISel] Make some vector G_SMULH/G_UMULH legal. X-Git-Tag: upstream/15.0.7~30184 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e6ed880e4757498996d68c3e21bd9f5d06ebf3af;p=platform%2Fupstream%2Fllvm.git [AArch64][GlobalISel] Make some vector G_SMULH/G_UMULH legal. --- diff --git a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp index cb9e51c..b85d517 100644 --- a/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp +++ b/llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp @@ -176,7 +176,8 @@ AArch64LegalizerInfo::AArch64LegalizerInfo(const AArch64Subtarget &ST) .clampScalar(0, s32, s64) .lowerIf(typeIs(1, s1)); - getActionDefinitionsBuilder({G_SMULH, G_UMULH}).legalFor({s32, s64}); + getActionDefinitionsBuilder({G_SMULH, G_UMULH}) + .legalFor({s32, s64, v8s16, v16s8, v4s32}); getActionDefinitionsBuilder({G_SMIN, G_SMAX, G_UMIN, G_UMAX}) .legalFor({v8s8, v16s8, v4s16, v8s16, v2s32, v4s32}) diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir index d1e95f0..5d8d916 100644 --- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir +++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir @@ -6,12 +6,12 @@ body: | bb.0.entry: ; CHECK-LABEL: name: test_scalar_mul_small ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 - ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 - ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) - ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) - ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[TRUNC]], [[TRUNC1]] - ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[MUL]](s32) - ; CHECK: $x0 = COPY [[ANYEXT]](s64) + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 + ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) + ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[TRUNC]], [[TRUNC1]] + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[MUL]](s32) + ; CHECK-NEXT: $x0 = COPY [[ANYEXT]](s64) %0:_(s64) = COPY $x0 %1:_(s64) = COPY $x1 %2:_(s8) = G_TRUNC %0(s64) @@ -27,14 +27,14 @@ body: | bb.0: ; CHECK-LABEL: name: test_smul_overflow ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 - ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 - ; CHECK: [[SMULH:%[0-9]+]]:_(s64) = G_SMULH [[COPY]], [[COPY1]] - ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]] - ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63 - ; CHECK: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[MUL]], [[C]](s64) - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SMULH]](s64), [[ASHR]] - ; CHECK: $x0 = COPY [[MUL]](s64) - ; CHECK: $w0 = COPY [[ICMP]](s32) + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 + ; CHECK-NEXT: [[SMULH:%[0-9]+]]:_(s64) = G_SMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]] + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63 + ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[MUL]], [[C]](s64) + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SMULH]](s64), [[ASHR]] + ; CHECK-NEXT: $x0 = COPY [[MUL]](s64) + ; CHECK-NEXT: $w0 = COPY [[ICMP]](s32) %0:_(s64) = COPY $x0 %1:_(s64) = COPY $x1 %2:_(s64), %3:_(s1) = G_SMULO %0, %1 @@ -49,13 +49,13 @@ body: | bb.0: ; CHECK-LABEL: name: test_umul_overflow ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 - ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 - ; CHECK: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[COPY]], [[COPY1]] - ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 - ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]] - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s64), [[C]] - ; CHECK: $x0 = COPY [[MUL]](s64) - ; CHECK: $w0 = COPY [[ICMP]](s32) + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 + ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[COPY]], [[COPY1]] + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s64), [[C]] + ; CHECK-NEXT: $x0 = COPY [[MUL]](s64) + ; CHECK-NEXT: $w0 = COPY [[ICMP]](s32) %0:_(s64) = COPY $x0 %1:_(s64) = COPY $x1 %2:_(s64), %3:_(s1) = G_UMULO %0, %1 @@ -70,15 +70,15 @@ body: | bb.0: ; CHECK-LABEL: name: test_smul_overflow_s32 ; CHECK: %lhs:_(s32) = COPY $w0 - ; CHECK: %rhs:_(s32) = COPY $w1 - ; CHECK: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH %lhs, %rhs - ; CHECK: %mul:_(s32) = G_MUL %lhs, %rhs - ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31 - ; CHECK: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR %mul, [[C]](s64) - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SMULH]](s32), [[ASHR]] - ; CHECK: $w0 = COPY %mul(s32) - ; CHECK: $w0 = COPY [[ICMP]](s32) - ; CHECK: RET_ReallyLR implicit $w0 + ; CHECK-NEXT: %rhs:_(s32) = COPY $w1 + ; CHECK-NEXT: [[SMULH:%[0-9]+]]:_(s32) = G_SMULH %lhs, %rhs + ; CHECK-NEXT: %mul:_(s32) = G_MUL %lhs, %rhs + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 31 + ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR %mul, [[C]](s64) + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[SMULH]](s32), [[ASHR]] + ; CHECK-NEXT: $w0 = COPY %mul(s32) + ; CHECK-NEXT: $w0 = COPY [[ICMP]](s32) + ; CHECK-NEXT: RET_ReallyLR implicit $w0 %lhs:_(s32) = COPY $w0 %rhs:_(s32) = COPY $w1 %mul:_(s32), %overflow:_(s1) = G_SMULO %lhs, %rhs @@ -94,14 +94,14 @@ body: | bb.0: ; CHECK-LABEL: name: test_umul_overflow_s32 ; CHECK: %lhs:_(s32) = COPY $w0 - ; CHECK: %rhs:_(s32) = COPY $w1 - ; CHECK: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH %lhs, %rhs - ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 - ; CHECK: %mul:_(s32) = G_MUL %lhs, %rhs - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C]] - ; CHECK: $w0 = COPY %mul(s32) - ; CHECK: $w0 = COPY [[ICMP]](s32) - ; CHECK: RET_ReallyLR implicit $w0 + ; CHECK-NEXT: %rhs:_(s32) = COPY $w1 + ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH %lhs, %rhs + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; CHECK-NEXT: %mul:_(s32) = G_MUL %lhs, %rhs + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C]] + ; CHECK-NEXT: $w0 = COPY %mul(s32) + ; CHECK-NEXT: $w0 = COPY [[ICMP]](s32) + ; CHECK-NEXT: RET_ReallyLR implicit $w0 %lhs:_(s32) = COPY $w0 %rhs:_(s32) = COPY $w1 %mul:_(s32), %overflow:_(s1) = G_UMULO %lhs, %rhs @@ -117,20 +117,20 @@ body: | bb.0: ; CHECK-LABEL: name: test_umul_overflow_s24 ; CHECK: %lhs_wide:_(s32) = COPY $w0 - ; CHECK: %rhs_wide:_(s32) = COPY $w1 - ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215 - ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND %lhs_wide, [[C]] - ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND %rhs_wide, [[C]] - ; CHECK: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[AND]], [[AND1]] - ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 - ; CHECK: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[AND]], [[AND1]] - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C1]] - ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[MUL]], [[C]] - ; CHECK: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[MUL]](s32), [[AND2]] - ; CHECK: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[ICMP1]] - ; CHECK: $w0 = COPY [[MUL]](s32) - ; CHECK: $w0 = COPY [[OR]](s32) - ; CHECK: RET_ReallyLR implicit $w0 + ; CHECK-NEXT: %rhs_wide:_(s32) = COPY $w1 + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16777215 + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND %lhs_wide, [[C]] + ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND %rhs_wide, [[C]] + ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s32) = G_UMULH [[AND]], [[AND1]] + ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[AND]], [[AND1]] + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s32), [[C1]] + ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[MUL]], [[C]] + ; CHECK-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[MUL]](s32), [[AND2]] + ; CHECK-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[ICMP]], [[ICMP1]] + ; CHECK-NEXT: $w0 = COPY [[MUL]](s32) + ; CHECK-NEXT: $w0 = COPY [[OR]](s32) + ; CHECK-NEXT: RET_ReallyLR implicit $w0 %lhs_wide:_(s32) = COPY $w0 %rhs_wide:_(s32) = COPY $w1 %lhs:_(s24) = G_TRUNC %lhs_wide @@ -154,14 +154,14 @@ body: | ; CHECK-LABEL: name: vector_mul_scalarize ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0 - ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1 - ; CHECK: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>) - ; CHECK: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>) - ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[UV]], [[UV2]] - ; CHECK: [[MUL1:%[0-9]+]]:_(s64) = G_MUL [[UV1]], [[UV3]] - ; CHECK: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[MUL]](s64), [[MUL1]](s64) - ; CHECK: $q0 = COPY [[BUILD_VECTOR]](<2 x s64>) - ; CHECK: RET_ReallyLR implicit $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1 + ; CHECK-NEXT: [[UV:%[0-9]+]]:_(s64), [[UV1:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY]](<2 x s64>) + ; CHECK-NEXT: [[UV2:%[0-9]+]]:_(s64), [[UV3:%[0-9]+]]:_(s64) = G_UNMERGE_VALUES [[COPY1]](<2 x s64>) + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[UV]], [[UV2]] + ; CHECK-NEXT: [[MUL1:%[0-9]+]]:_(s64) = G_MUL [[UV1]], [[UV3]] + ; CHECK-NEXT: [[BUILD_VECTOR:%[0-9]+]]:_(<2 x s64>) = G_BUILD_VECTOR [[MUL]](s64), [[MUL1]](s64) + ; CHECK-NEXT: $q0 = COPY [[BUILD_VECTOR]](<2 x s64>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 %0:_(<2 x s64>) = COPY $q0 %1:_(<2 x s64>) = COPY $q1 %2:_(<2 x s64>) = G_MUL %0, %1 @@ -191,27 +191,28 @@ body: | ; before it's been defined. ; CHECK-LABEL: name: test_umulo_overflow_no_invalid_mir ; CHECK: liveins: $x0, $x1, $x2 - ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 - ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 - ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2 - ; CHECK: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0 - ; CHECK: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.1 - ; CHECK: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.3 - ; CHECK: G_STORE [[COPY2]](s64), [[FRAME_INDEX]](p0) :: (store (s64)) - ; CHECK: G_STORE [[COPY1]](s64), [[FRAME_INDEX1]](p0) :: (store (s64)) - ; CHECK: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX]](p0) :: (dereferenceable load (s64)) - ; CHECK: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX1]](p0) :: (dereferenceable load (s64)) - ; CHECK: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[LOAD]], [[LOAD1]] - ; CHECK: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 - ; CHECK: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[LOAD]], [[LOAD1]] - ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s64), [[C]] - ; CHECK: G_STORE [[C]](s64), [[FRAME_INDEX2]](p0) :: (store (s64), align 1) - ; CHECK: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 - ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32) - ; CHECK: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C1]] - ; CHECK: $x0 = COPY [[MUL]](s64) - ; CHECK: $x1 = COPY [[AND]](s64) - ; CHECK: RET_ReallyLR implicit $x0 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 + ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2 + ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0 + ; CHECK-NEXT: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.1 + ; CHECK-NEXT: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.3 + ; CHECK-NEXT: G_STORE [[COPY2]](s64), [[FRAME_INDEX]](p0) :: (store (s64)) + ; CHECK-NEXT: G_STORE [[COPY1]](s64), [[FRAME_INDEX1]](p0) :: (store (s64)) + ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX]](p0) :: (dereferenceable load (s64)) + ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX1]](p0) :: (dereferenceable load (s64)) + ; CHECK-NEXT: [[UMULH:%[0-9]+]]:_(s64) = G_UMULH [[LOAD]], [[LOAD1]] + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 0 + ; CHECK-NEXT: [[MUL:%[0-9]+]]:_(s64) = G_MUL [[LOAD]], [[LOAD1]] + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UMULH]](s64), [[C]] + ; CHECK-NEXT: G_STORE [[C]](s64), [[FRAME_INDEX2]](p0) :: (store (s64), align 1) + ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ICMP]](s32) + ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ANYEXT]], [[C1]] + ; CHECK-NEXT: $x0 = COPY [[MUL]](s64) + ; CHECK-NEXT: $x1 = COPY [[AND]](s64) + ; CHECK-NEXT: RET_ReallyLR implicit $x0 %0:_(p0) = COPY $x0 %1:_(s64) = COPY $x1 %2:_(s64) = COPY $x2 @@ -232,3 +233,153 @@ body: | RET_ReallyLR implicit $x0 ... +--- +name: umulh_v8s16 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: umulh_v8s16 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<8 x s16>) = G_UMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<8 x s16>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<8 x s16>) = COPY $q0 + %1:_(<8 x s16>) = COPY $q1 + %mul:_(<8 x s16>) = G_UMULH %0, %1 + $q0 = COPY %mul(<8 x s16>) + RET_ReallyLR implicit $q0 + +... +--- +name: umulh_v16s8 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: umulh_v16s8 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<16 x s8>) = G_UMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<16 x s8>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<16 x s8>) = COPY $q0 + %1:_(<16 x s8>) = COPY $q1 + %mul:_(<16 x s8>) = G_UMULH %0, %1 + $q0 = COPY %mul(<16 x s8>) + RET_ReallyLR implicit $q0 + +... +--- +name: umulh_v4s32 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: umulh_v4s32 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<4 x s32>) = G_UMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<4 x s32>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<4 x s32>) = COPY $q0 + %1:_(<4 x s32>) = COPY $q1 + %mul:_(<4 x s32>) = G_UMULH %0, %1 + $q0 = COPY %mul(<4 x s32>) + RET_ReallyLR implicit $q0 + +... +--- +name: smulh_v8s16 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: smulh_v8s16 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<8 x s16>) = G_SMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<8 x s16>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<8 x s16>) = COPY $q0 + %1:_(<8 x s16>) = COPY $q1 + %mul:_(<8 x s16>) = G_SMULH %0, %1 + $q0 = COPY %mul(<8 x s16>) + RET_ReallyLR implicit $q0 + +... +--- +name: smulh_v16s8 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: smulh_v16s8 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<16 x s8>) = G_SMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<16 x s8>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<16 x s8>) = COPY $q0 + %1:_(<16 x s8>) = COPY $q1 + %mul:_(<16 x s8>) = G_SMULH %0, %1 + $q0 = COPY %mul(<16 x s8>) + RET_ReallyLR implicit $q0 + +... +--- +name: smulh_v4s32 +exposesReturnsTwice: false +tracksRegLiveness: true +liveins: + - { reg: '$q0', virtual-reg: '' } +body: | + bb.1: + liveins: $q0, $q1 + + ; CHECK-LABEL: name: smulh_v4s32 + ; CHECK: liveins: $q0, $q1 + ; CHECK-NEXT: {{ $}} + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0 + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $q1 + ; CHECK-NEXT: %mul:_(<4 x s32>) = G_SMULH [[COPY]], [[COPY1]] + ; CHECK-NEXT: $q0 = COPY %mul(<4 x s32>) + ; CHECK-NEXT: RET_ReallyLR implicit $q0 + %0:_(<4 x s32>) = COPY $q0 + %1:_(<4 x s32>) = COPY $q1 + %mul:_(<4 x s32>) = G_SMULH %0, %1 + $q0 = COPY %mul(<4 x s32>) + RET_ReallyLR implicit $q0 + +...