[PATCH] D114002: [LoopVectorize] Check the number of uses of an FAdd before classifying as ordered

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 07:01:53 PST 2021


kmclaughlin added a comment.

In D114002#3136096 <https://reviews.llvm.org/D114002#3136096>, @dmgreen wrote:

> The underlying issue seems to be that AddReductionVar returns a reduction, whereas getReductionOpChain cannot find the chain. Are there more situations that could happen? Would it be better to somehow detect that getReductionOpChain will fail to find the chain?

Thanks for taking a look at this, @dmgreen! I do think it would be worth checking if getReductionOpChain will fail to find the chain in AddReductionVar, so that we don't classify a reduction as ordered if it won't be found by collectInLoopReductions. I tried adding something like this to AddReductionVar, though at the point checkOrderedReduction is called we haven't created the RecurrenceDescriptor yet. I think with some refactoring it would be possible to do this, and I'm happy to follow up on this separately? For now I think this patch ensures that we are at least as strict as getReductionOpChain in terms of checking the number of uses of the FAdd.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114002/new/

https://reviews.llvm.org/D114002



More information about the llvm-commits mailing list