llvm.org GIT mirror llvm / dbcaf59
[SelectionDAG] combine vextract (v1iX extract_subvector(vNiX, Idx)) into vextract(vNiX,Idx) when creating vextract with getNode(). This case appeared in AVX512 after fixing pr33349 in r310552. Differential revision: https://reviews.llvm.org/D36571 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310828 91177308-0d34-0410-b5e6-96231b3b80d8 Elad Cohen 2 years ago
2 changed file(s) with 9 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
43724372 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0), N2);
43734373 }
43744374 }
4375
4376 // EXTRACT_VECTOR_ELT of v1iX EXTRACT_SUBVECTOR could be formed
4377 // when vector types are scalarized and v1iX is legal.
4378 // vextract (v1iX extract_subvector(vNiX, Idx)) -> vextract(vNiX,Idx)
4379 if (N1.getOpcode() == ISD::EXTRACT_SUBVECTOR &&
4380 N1.getValueType().getVectorNumElements() == 1) {
4381 return getNode(ISD::EXTRACT_VECTOR_ELT, DL, VT, N1.getOperand(0),
4382 N1.getOperand(1));
4383 }
43754384 break;
43764385 case ISD::EXTRACT_ELEMENT:
43774386 assert(N2C && (unsigned)N2C->getZExtValue() < 2 && "Bad EXTRACT_ELEMENT!");
4242 ; SKX-NEXT: kshiftrw $2, %k0, %k1
4343 ; SKX-NEXT: kshiftlw $15, %k1, %k2
4444 ; SKX-NEXT: kshiftrw $15, %k2, %k2
45 ; SKX-NEXT: kshiftlw $15, %k2, %k2
46 ; SKX-NEXT: kshiftrw $15, %k2, %k2
4745 ; SKX-NEXT: kmovd %k2, %eax
4846 ; SKX-NEXT: testb $1, %al
4947 ; SKX-NEXT: fld1
5250 ; SKX-NEXT: fcmovne %st(2), %st(0)
5351 ; SKX-NEXT: kshiftlw $14, %k1, %k1
5452 ; SKX-NEXT: kshiftrw $15, %k1, %k1
55 ; SKX-NEXT: kshiftlw $15, %k1, %k1
56 ; SKX-NEXT: kshiftrw $15, %k1, %k1
5753 ; SKX-NEXT: kmovd %k1, %eax
5854 ; SKX-NEXT: testb $1, %al
5955 ; SKX-NEXT: fld %st(1)
6056 ; SKX-NEXT: fcmovne %st(3), %st(0)
6157 ; SKX-NEXT: kshiftlw $15, %k0, %k1
6258 ; SKX-NEXT: kshiftrw $15, %k1, %k1
63 ; SKX-NEXT: kshiftlw $15, %k1, %k1
64 ; SKX-NEXT: kshiftrw $15, %k1, %k1
6559 ; SKX-NEXT: kmovd %k1, %eax
6660 ; SKX-NEXT: testb $1, %al
6761 ; SKX-NEXT: fld %st(2)
6862 ; SKX-NEXT: fcmovne %st(4), %st(0)
6963 ; SKX-NEXT: kshiftlw $14, %k0, %k0
70 ; SKX-NEXT: kshiftrw $15, %k0, %k0
71 ; SKX-NEXT: kshiftlw $15, %k0, %k0
7264 ; SKX-NEXT: kshiftrw $15, %k0, %k0
7365 ; SKX-NEXT: kmovd %k0, %eax
7466 ; SKX-NEXT: testb $1, %al