Skip to content

Commit c891cca

Browse files
Properly check if scalar type is legal for RVV
1 parent c6f05aa commit c891cca

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1626,22 +1626,9 @@ bool RISCVTTIImpl::isLegalMaskedCompressStore(Type *DataTy, Align Alignment) {
16261626
if (!VTy || VTy->isScalableTy() || !ST->hasVInstructions())
16271627
return false;
16281628

1629-
Type *ScalarTy = VTy->getScalarType();
1630-
if (ScalarTy->isFloatTy() || ScalarTy->isDoubleTy())
1631-
return true;
1632-
1633-
if (!ScalarTy->isIntegerTy())
1629+
if (!TLI->isLegalElementTypeForRVV(
1630+
TLI->getValueType(DL, VTy->getElementType())))
16341631
return false;
16351632

1636-
switch (ScalarTy->getIntegerBitWidth()) {
1637-
case 8:
1638-
case 16:
1639-
case 32:
1640-
case 64:
1641-
break;
1642-
default:
1643-
return false;
1644-
}
1645-
16461633
return getRegUsageForType(VTy) <= 8;
16471634
}

0 commit comments

Comments
 (0)