This reconstructs the masks vectype based on the the type set by the backend
for any non scalar masks, which resolves the ICE caused by the sve type
attribute in SVE types used for simdclones.
gcc/ChangeLog:
PR target/123016
* tree-vect-stmts.cc (vectorizable_simd_clone_call): use
'build_truth_vector_type_for_mode' to reconstruct mask's vectype for
non-scalar masks.
gcc/testsuite/ChangeLog:
* gfortran.dg/vect/pr123016.f90: New test.
--- /dev/null
+! { dg-do compile }
+! { dg-additional-options "-Ofast" }
+! { dg-additional-options "-mcpu=neoverse-v2" { target aarch64*-*-* } }"
+!GCC$ builtin (expf) attributes simd (notinbranch)
+ MODULE MODULE_CU_BMJ
+ INTEGER:: JTB
+ CONTAINS
+ SUBROUTINE BMJDRVRQVCUTEN
+REAL, DIMENSION(JTB) :: THEOLD,TOLDY2T
+ DO KTH=1,KTHM
+ TH=TH+DTH
+ DENOM=TH
+ IF (DENOM>EPS) THEN
+ QS=EXP(0/DENOM)
+ ELSE
+ QS=0.
+ ENDIF
+ THEOLD(KTH)=EXP(ELOCP*QS)
+ ENDDO
+ CALL SPLINE
+ END
+ END
else
{
masktype = bestn_inbranch->simdclone->args[i].vector_type;
+ /* The aarch64 port will add custom attributes to types
+ for SVE simdclones which make the types different. We
+ should use canonincal types for masks within the
+ vectorizer, hence we construct the related vectype
+ here. */
+ masktype
+ = build_truth_vector_type_for_mode
+ (TYPE_VECTOR_SUBPARTS (masktype),
+ TYPE_MODE (masktype));
callee_nelements = TYPE_VECTOR_SUBPARTS (masktype);
}
auto o = vector_unroll_factor (nunits, callee_nelements);