Currently the Instruction cost of getReductionPatternCost returns an Invalid cost to specify "did not find the pattern". This changes that to return an Optional with None specifying not found, allowing Invalid to mean an infinite cost as is used elsewhere.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
The patch looks fine to me, although this might be an incentive to add a new UnknownCost state to InstructionCost? Is this something you've considered?
Comment Actions
Thanks. I felt like this should be separate from Instruction Cost. It is whether the reduction pattern was found or not, not what the cost of the underlying instructions would be, so is a little different.