@@ -574,8 +574,9 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
574
574
// relatively low cost.
575
575
576
576
// If arguments aren't actually supplied, then we cannot determine the
577
- // value of the index.
578
- if (ICA.getArgs ().size () < 2 )
577
+ // value of the index. We also want to skip this on predicate types.
578
+ if (ICA.getArgs ().size () != 2 ||
579
+ ICA.getReturnType ()->getScalarType ()->isIntegerTy (1 ))
579
580
break ;
580
581
LLVMContext &C = RetTy->getContext ();
581
582
EVT MRTy = getTLI ()->getValueType (DL, RetTy);
@@ -586,7 +587,7 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
586
587
if (RLK.first == TargetLoweringBase::TypeLegal &&
587
588
PLK.first == TargetLoweringBase::TypeLegal && Idx &&
588
589
Idx->getZExtValue () == 0 )
589
- return InstructionCost ( 1 ) ;
590
+ return TTI::TCC_Basic ;
590
591
break ;
591
592
}
592
593
case Intrinsic::vector_insert: {
@@ -595,8 +596,9 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
595
596
// relatively low cost.
596
597
597
598
// If arguments aren't actually supplied, then we cannot determine the
598
- // value of the index.
599
- if (ICA.getArgs ().size () < 3 )
599
+ // value of the index. We also want to skip this on predicate types.
600
+ if (ICA.getArgs ().size () != 3 ||
601
+ ICA.getReturnType ()->getScalarType ()->isIntegerTy (1 ))
600
602
break ;
601
603
LLVMContext &C = RetTy->getContext ();
602
604
EVT MTy0 = getTLI ()->getValueType (DL, ICA.getArgTypes ()[0 ]);
@@ -607,7 +609,7 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
607
609
if (LK0.first == TargetLoweringBase::TypeLegal &&
608
610
LK1.first == TargetLoweringBase::TypeLegal && Idx &&
609
611
Idx->getZExtValue () == 0 )
610
- return InstructionCost ( 1 ) ;
612
+ return TTI::TCC_Basic ;
611
613
break ;
612
614
}
613
615
case Intrinsic::bitreverse: {
0 commit comments