[llvm] [LoopVectorize] Add the cost of VPInstruction::AnyOf to vplan (PR #125058)
Hassnaa Hamdi via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 08:23:54 PST 2025
================
@@ -709,6 +709,20 @@ Value *VPInstruction::generate(VPTransformState &State) {
}
}
+InstructionCost VPInstruction::computeCost(ElementCount VF,
+ VPCostContext &Ctx) const {
+ switch (getOpcode()) {
+ case VPInstruction::AnyOf: {
+ auto *VecI1Ty = VectorType::get(Type::getInt1Ty(Ctx.LLVMCtx), VF);
+ return Ctx.TTI.getArithmeticReductionCost(Instruction::Or, VecI1Ty,
----------------
hassnaaHamdi wrote:
Aha, I see. Thanks for the clarification.
https://github.com/llvm/llvm-project/pull/125058
More information about the llvm-commits
mailing list