[PATCH] D95620: [RISCV] Support scalable-vector integer reduction intrinsics
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 29 09:56:25 PST 2021
craig.topper added inline comments.
Herald added a subscriber: vkmr.
================
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.
----------------
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?
================
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));
----------------
Rename this since its not a Splat of 0 anymore. Also update the commit message.
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