[llvm] b9567bc - [RISCV] Use SelectionDAG::getVScale in lowerVPReverseExperimental. NFCI (#81694)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 13 20:30:33 PST 2024
Author: Luke Lau
Date: 2024-02-14T12:30:29+08:00
New Revision: b9567bc78f42a6850ddf3b3cf3f9a0d2cc08ffff
URL: https://github.com/llvm/llvm-project/commit/b9567bc78f42a6850ddf3b3cf3f9a0d2cc08ffff
DIFF: https://github.com/llvm/llvm-project/commit/b9567bc78f42a6850ddf3b3cf3f9a0d2cc08ffff.diff
LOG: [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.
Added:
Modified:
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 73492c28815b1d..4caadef694d725 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -11106,8 +11106,8 @@ RISCVTargetLowering::lowerVPReverseExperimental(SDValue Op,
// Slide off any elements from past EVL that were reversed into the low
// elements.
unsigned MinElts = GatherVT.getVectorMinNumElements();
- SDValue VLMax = DAG.getNode(ISD::VSCALE, DL, XLenVT,
- DAG.getConstant(MinElts, DL, XLenVT));
+ SDValue VLMax =
+ DAG.getVScale(DL, XLenVT, APInt(XLenVT.getSizeInBits(), MinElts));
SDValue Diff = DAG.getNode(ISD::SUB, DL, XLenVT, VLMax, EVL);
Result = getVSlidedown(DAG, Subtarget, DL, GatherVT,
More information about the llvm-commits
mailing list