Skip to content

Commit fd60a00

Browse files
committed
update known-even condition and test
1 parent 5042eb4 commit fd60a00

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

llvm/include/llvm/CodeGen/BasicTTIImpl.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,13 +1331,8 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
13311331
bool SplitDst =
13321332
TLI->getTypeAction(Dst->getContext(), TLI->getValueType(DL, Dst)) ==
13331333
TargetLowering::TypeSplitVector;
1334-
if ((SplitSrc || SplitDst) && SrcVTy->getElementCount().isVector() &&
1335-
DstVTy->getElementCount().isVector()) {
1336-
auto SrcEltCnt = SrcVTy->getElementCount();
1337-
auto DstEltCnt = DstVTy->getElementCount();
1338-
if (!SrcEltCnt.isKnownEven() || !DstEltCnt.isKnownEven()) {
1339-
return InstructionCost::getInvalid();
1340-
}
1334+
if ((SplitSrc || SplitDst) && SrcVTy->getElementCount().isKnownEven() &&
1335+
DstVTy->getElementCount().isKnownEven()) {
13411336
Type *SplitDstTy = VectorType::getHalfElementsVectorType(DstVTy);
13421337
Type *SplitSrcTy = VectorType::getHalfElementsVectorType(SrcVTy);
13431338
const T *TTI = thisT();
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
; RUN: opt -mtriple=aarch64-unknown-linux-gnu -passes=vector-combine %s -S -o - | FileCheck %s
1+
; RUN: opt -mtriple=aarch64-unknown-linux-gnu -mattr=+sve -passes=vector-combine %s -S -o - | FileCheck %s
22

33
target triple = "aarch64-unknown-linux-gnu"
44

55
define <vscale x 4 x i16> @interleave2_same_const_splat_nxv4i16() {
66
;CHECK-LABEL: @interleave2_same_const_splat_nxv4i16(
7-
;CHECK: call <vscale x 4 x i16> @llvm.vector.interleave2
8-
;CHECK: ret <vscale x 4 x i16> %retval
7+
;CHECK: ret <vscale x 4 x i16> bitcast (<vscale x 2 x i32> splat (i32 196611) to <vscale x 4 x i16>)
98
%retval = call <vscale x 4 x i16> @llvm.vector.interleave2.nxv4i16(<vscale x 2 x i16> splat(i16 3), <vscale x 2 x i16> splat(i16 3))
109
ret <vscale x 4 x i16> %retval
1110
}

0 commit comments

Comments
 (0)