[llvm] IVDescriptors: unify RecurKinds IAnyOf and FAnyOf (PR #118393)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 3 03:39:11 PST 2024
artagnon wrote:
> > > This effectively makes FAnyOf dead, right? In that case it should be removed and `IAnyOf` -> `AnyOf`?
> >
> >
> > There is still FAnyOf matching with FCmp, and IAnyOf matching with ICmp, so I don't think it can be removed. See getReductionOpChain's call to getOpcode for example.
> > See also the return statement in isAnyOfPattern:
> > ```
> > return InstDesc(I, isa<ICmpInst>(I->getOperand(0)) ? RecurKind::IAnyOf
> > : RecurKind::FAnyOf);
> > ```
>
> I agree with @fhahn. Looking at the code after this patch lands there is no logical reason for distinguishing between IAnyOf and FAnyOf. You should be able to condense the two RecurKind types into a single AnyOf I think. When creating `InstDesc` you just always initialise it with `RecurKind::AnyOf` and in `isAnyOfRecurrenceKind` just check for `AnyOf`. It looks like the only place we actually distinguish between the two is in `RecurrenceDescriptor::getOpcode`, but you can probably infer the opcode from the type?
Thanks, both. FAnyOf has now been stripped altogether, and IAnyOf has been renamed to AnyOf.
https://github.com/llvm/llvm-project/pull/118393
More information about the llvm-commits
mailing list