[llvm] [RISCV] Provide a more efficient lowering for experimental.cttz.elts. (PR #88552)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 15 08:40:35 PDT 2024


================
@@ -1484,6 +1484,11 @@ bool RISCVTargetLowering::shouldExpandGetVectorLength(EVT TripCountVT,
   return VF > MaxVF || !isPowerOf2_32(VF);
 }
 
+bool RISCVTargetLowering::shouldExpandCttzElements(EVT VT) const {
+  return !Subtarget.hasVInstructions() ||
+         VT.getVectorElementType() != MVT::i1 || !isTypeLegal(VT);
----------------
topperc wrote:

That's true. I was just trying to cover the new usage from https://github.com/llvm/llvm-project/pull/88385

https://github.com/llvm/llvm-project/pull/88552


More information about the llvm-commits mailing list