Skip to content

Commit 47a7d19

Browse files
committed
Scalarize i8 vectors with LMUL>=8
1 parent bce8343 commit 47a7d19

File tree

2 files changed

+18550
-0
lines changed

2 files changed

+18550
-0
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "llvm/CodeGen/TargetLowering.h"
1616
#include "llvm/IR/Instructions.h"
1717
#include "llvm/IR/PatternMatch.h"
18+
#include "llvm/Support/TypeSize.h"
1819
#include <cmath>
1920
#include <optional>
2021
using namespace llvm;
@@ -2293,6 +2294,13 @@ bool RISCVTTIImpl::isLegalMaskedExpandLoad(Type *DataTy, Align Alignment) {
22932294

22942295
if (!isLegalMaskedLoadStore(DataTy, Alignment))
22952296
return false;
2297+
2298+
// FIXME: If it is an i8 vector and the element count exceeds 256, we should
2299+
// scalarize these types with LMUL >= maximum fixed-length LMUL.
2300+
if (VTy->getElementType()->isIntegerTy(8))
2301+
if (VTy->getElementCount().getFixedValue() > 256)
2302+
return VTy->getPrimitiveSizeInBits() / ST->getRealMinVLen() <
2303+
ST->getMaxLMULForFixedLengthVectors();
22962304
return true;
22972305
}
22982306

0 commit comments

Comments
 (0)