[llvm] [AArch64] Improve code generation for experimental.cttz.elts (PR #91505)

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 12:43:33 PDT 2024


================
@@ -1852,7 +1852,15 @@ bool AArch64TargetLowering::shouldExpandGetActiveLaneMask(EVT ResVT,
 }
 
 bool AArch64TargetLowering::shouldExpandCttzElements(EVT VT) const {
-  return !Subtarget->hasSVEorSME() || VT != MVT::nxv16i1;
+  if (!Subtarget->hasSVEorSME())
+    return true;
+
+  // We can only use the BRKB + CNTP sequence with legal predicate types.
+  if (VT != MVT::nxv16i1 && VT != MVT::nxv8i1 && VT != MVT::nxv4i1 &&
----------------
hazzlim wrote:

Nice - I've updated with this simplified return statement.

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


More information about the llvm-commits mailing list