Skip to content

Commit a8e9dce

Browse files
authored
[RISCV] Use getELen() instead of hardcoded 64 in lowerBUILD_VECTOR. (#77355)
This is needed to properly support Zve32x.
1 parent b856e77 commit a8e9dce

File tree

2 files changed

+320
-132
lines changed

2 files changed

+320
-132
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,10 +3657,10 @@ static SDValue lowerBuildVectorOfConstants(SDValue Op, SelectionDAG &DAG,
36573657
// would require bit-manipulation instructions to construct the splat value.
36583658
SmallVector<SDValue> Sequence;
36593659
const auto *BV = cast<BuildVectorSDNode>(Op);
3660-
if (VT.isInteger() && EltBitSize < 64 &&
3660+
if (VT.isInteger() && EltBitSize < Subtarget.getELen() &&
36613661
ISD::isBuildVectorOfConstantSDNodes(Op.getNode()) &&
36623662
BV->getRepeatedSequence(Sequence) &&
3663-
(Sequence.size() * EltBitSize) <= 64) {
3663+
(Sequence.size() * EltBitSize) <= Subtarget.getELen()) {
36643664
unsigned SeqLen = Sequence.size();
36653665
MVT ViaIntVT = MVT::getIntegerVT(EltBitSize * SeqLen);
36663666
assert((ViaIntVT == MVT::i16 || ViaIntVT == MVT::i32 ||

0 commit comments

Comments
 (0)