================ @@ -568,6 +568,32 @@ AArch64TTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, } return Cost; } + case Intrinsic::vector_extract: { + // If both the vector argument and the return type are legal types, then + // this should be a no-op or simple operation; return a relatively low cost. + LLVMContext &C = RetTy->getContext(); + EVT MRTy = getTLI()->getValueType(DL, RetTy); + EVT MPTy = getTLI()->getValueType(DL, ICA.getArgTypes()[0]); + TargetLoweringBase::LegalizeKind RLK = getTLI()->getTypeConversion(C, MRTy); + TargetLoweringBase::LegalizeKind PLK = getTLI()->getTypeConversion(C, MPTy); + if (RLK.first == TargetLoweringBase::TypeLegal && + PLK.first == TargetLoweringBase::TypeLegal) + return InstructionCost(1); ---------------- sdesmalen-arm wrote:
Just pointing out that the code isn't updated yet to handle predicates differently, as those inserts/extracts are indeed not free. https://github.com/llvm/llvm-project/pull/81135 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits