[PATCH] D95620: [RISCV] Support scalable-vector integer reduction intrinsics
Fraser Cormack via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 10:41:38 PST 2021
frasercrmck marked an inline comment as done.
frasercrmck added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:915
+ // The lowering for reductions returns a vector whose first element is the
+ // result of the reduction. Use the VMV_X_S node to extract the first
+ // element: that way we can infer information about the sign bits.
----------------
craig.topper wrote:
> Shouldn't we always lower EXTRACT_ELEMENT for types less than XLen to VMV_X_S? Why is knowing sign extension important for this operation, but not any extract element?
Yes, we really should. I'll put up a patch which addresses that first, then can rebase this on top of that.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1681
+ MVT M1VT = MVT::getScalableVectorVT(VecEltVT, NumElts);
+ SDValue Splat0 =
+ DAG.getSplatVector(M1VT, DL, DAG.getConstant(IdentityVal, DL, VecEltVT));
----------------
craig.topper wrote:
> Rename this since its not a Splat of 0 anymore. Also update the commit message.
Done, thanks for reminding me.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95620/new/
https://reviews.llvm.org/D95620
More information about the llvm-commits
mailing list