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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Fri May 10 05:28:43 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 &&
----------------
fhahn wrote:

```suggestion
  return VT != MVT::nxv16i1 && VT != MVT::nxv8i1 && VT != MVT::nxv4i1 &&
       VT != MVT::nxv2i1;
```

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


More information about the llvm-commits mailing list