Skip to content

Commit

Permalink
[RISCV] Use getELen() instead of hardcoded 64 in lowerBUILD_VECTOR.
Browse files Browse the repository at this point in the history
This is needed to properly support Zve32x.
  • Loading branch information
topperc committed Jan 8, 2024
1 parent eb42868 commit f810cf1
Show file tree
Hide file tree
Showing 2 changed files with 320 additions and 132 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3657,10 +3657,10 @@ static SDValue lowerBuildVectorOfConstants(SDValue Op, SelectionDAG &DAG,
// would require bit-manipulation instructions to construct the splat value.
SmallVector<SDValue> Sequence;
const auto *BV = cast<BuildVectorSDNode>(Op);
if (VT.isInteger() && EltBitSize < 64 &&
if (VT.isInteger() && EltBitSize < Subtarget.getELen() &&
ISD::isBuildVectorOfConstantSDNodes(Op.getNode()) &&
BV->getRepeatedSequence(Sequence) &&
(Sequence.size() * EltBitSize) <= 64) {
(Sequence.size() * EltBitSize) <= Subtarget.getELen()) {
unsigned SeqLen = Sequence.size();
MVT ViaIntVT = MVT::getIntegerVT(EltBitSize * SeqLen);
assert((ViaIntVT == MVT::i16 || ViaIntVT == MVT::i32 ||
Expand Down
Loading

0 comments on commit f810cf1

Please sign in to comment.