Skip to content

Commit 4ad5186

Browse files
author
git apple-llvm automerger
committed
Merge commit '69b3baf9b87e' from llvm.org/release/17.x into stable/20230725
2 parents 6c348b3 + 69b3baf commit 4ad5186

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,7 @@ class LLVM_LIBRARY_VISIBILITY DAGTypeLegalizer {
10001000
SDValue WidenVecOp_EXTRACT_VECTOR_ELT(SDNode *N);
10011001
SDValue WidenVecOp_INSERT_SUBVECTOR(SDNode *N);
10021002
SDValue WidenVecOp_EXTRACT_SUBVECTOR(SDNode *N);
1003+
SDValue WidenVecOp_EXTEND_VECTOR_INREG(SDNode *N);
10031004
SDValue WidenVecOp_STORE(SDNode* N);
10041005
SDValue WidenVecOp_VP_STORE(SDNode *N, unsigned OpNo);
10051006
SDValue WidenVecOp_VP_STRIDED_STORE(SDNode *N, unsigned OpNo);

llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5946,6 +5946,11 @@ bool DAGTypeLegalizer::WidenVectorOperand(SDNode *N, unsigned OpNo) {
59465946
case ISD::EXPERIMENTAL_VP_STRIDED_STORE:
59475947
Res = WidenVecOp_VP_STRIDED_STORE(N, OpNo);
59485948
break;
5949+
case ISD::ANY_EXTEND_VECTOR_INREG:
5950+
case ISD::SIGN_EXTEND_VECTOR_INREG:
5951+
case ISD::ZERO_EXTEND_VECTOR_INREG:
5952+
Res = WidenVecOp_EXTEND_VECTOR_INREG(N);
5953+
break;
59495954
case ISD::MSTORE: Res = WidenVecOp_MSTORE(N, OpNo); break;
59505955
case ISD::MGATHER: Res = WidenVecOp_MGATHER(N, OpNo); break;
59515956
case ISD::MSCATTER: Res = WidenVecOp_MSCATTER(N, OpNo); break;
@@ -6338,6 +6343,11 @@ SDValue DAGTypeLegalizer::WidenVecOp_EXTRACT_VECTOR_ELT(SDNode *N) {
63386343
N->getValueType(0), InOp, N->getOperand(1));
63396344
}
63406345

6346+
SDValue DAGTypeLegalizer::WidenVecOp_EXTEND_VECTOR_INREG(SDNode *N) {
6347+
SDValue InOp = GetWidenedVector(N->getOperand(0));
6348+
return DAG.getNode(N->getOpcode(), SDLoc(N), N->getValueType(0), InOp);
6349+
}
6350+
63416351
SDValue DAGTypeLegalizer::WidenVecOp_STORE(SDNode *N) {
63426352
// We have to widen the value, but we want only to store the original
63436353
// vector type.

llvm/test/CodeGen/PowerPC/pr70208.ll

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2+
; RUN: llc -verify-machineinstrs -mtriple=ppc64le-unknown-linux-gnu < %s | FileCheck %s
3+
4+
define <4 x i64> @widget(<8 x i16> %call) {
5+
; CHECK-LABEL: widget:
6+
; CHECK: # %bb.0:
7+
; CHECK-NEXT: addis 3, 2, .LCPI0_0@toc@ha
8+
; CHECK-NEXT: addis 4, 2, .LCPI0_1@toc@ha
9+
; CHECK-NEXT: xxlxor 37, 37, 37
10+
; CHECK-NEXT: addi 3, 3, .LCPI0_0@toc@l
11+
; CHECK-NEXT: lxvd2x 0, 0, 3
12+
; CHECK-NEXT: addi 3, 4, .LCPI0_1@toc@l
13+
; CHECK-NEXT: lxvd2x 1, 0, 3
14+
; CHECK-NEXT: xxswapd 35, 0
15+
; CHECK-NEXT: xxswapd 32, 1
16+
; CHECK-NEXT: vperm 4, 5, 2, 3
17+
; CHECK-NEXT: vperm 3, 5, 2, 0
18+
; CHECK-NEXT: vmr 2, 4
19+
; CHECK-NEXT: blr
20+
%bitcast = bitcast <8 x i16> %call to <16 x i8>
21+
%shufflevector = shufflevector <16 x i8> <i8 poison, i8 poison, i8 0, i8 0, i8 poison, i8 poison, i8 0, i8 0, i8 poison, i8 poison, i8 0, i8 0, i8 poison, i8 poison, i8 0, i8 0>, <16 x i8> %bitcast, <16 x i32> <i32 16, i32 17, i32 2, i32 3, i32 18, i32 19, i32 6, i32 7, i32 20, i32 21, i32 10, i32 11, i32 22, i32 23, i32 14, i32 15>
22+
%bitcast1 = bitcast <16 x i8> %shufflevector to <4 x i32>
23+
%zext = zext <4 x i32> %bitcast1 to <4 x i64>
24+
ret <4 x i64> %zext
25+
}

0 commit comments

Comments
 (0)