Skip to content

Commit b9567bc

Browse files
authored
[RISCV] Use SelectionDAG::getVScale in lowerVPReverseExperimental. NFCI (#81694)
Use a slightly more idiomatic way of getting vscale. getVScale performs additional constant folding, but I presume computeKnownBits also catches these cases too.
1 parent bc08cc2 commit b9567bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11106,8 +11106,8 @@ RISCVTargetLowering::lowerVPReverseExperimental(SDValue Op,
1110611106
// Slide off any elements from past EVL that were reversed into the low
1110711107
// elements.
1110811108
unsigned MinElts = GatherVT.getVectorMinNumElements();
11109-
SDValue VLMax = DAG.getNode(ISD::VSCALE, DL, XLenVT,
11110-
DAG.getConstant(MinElts, DL, XLenVT));
11109+
SDValue VLMax =
11110+
DAG.getVScale(DL, XLenVT, APInt(XLenVT.getSizeInBits(), MinElts));
1111111111
SDValue Diff = DAG.getNode(ISD::SUB, DL, XLenVT, VLMax, EVL);
1111211112

1111311113
Result = getVSlidedown(DAG, Subtarget, DL, GatherVT,

0 commit comments

Comments
 (0)