[llvm] Fixes [AArch64] Assertion `EltCnt.isKnownEven() && "Cannot halve vector with odd number of elements."' failed. (PR #166528)

Benjamin Maxwell via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 5 05:24:12 PST 2025


================
@@ -1333,6 +1333,11 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
           TargetLowering::TypeSplitVector;
       if ((SplitSrc || SplitDst) && SrcVTy->getElementCount().isVector() &&
           DstVTy->getElementCount().isVector()) {
+        auto SrcEltCnt = SrcVTy->getElementCount();
----------------
MacDue wrote:

You should just change the `SrcVTy->getElementCount().isVector()` and `DstVTy->getElementCount().isVector()` checks above  this to use `.isKnownEven()` rather than `.isVector()`.

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


More information about the llvm-commits mailing list