[llvm] IVDescriptors: cut wasteful FAnyOf checking (NFC) (PR #118393)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 3 02:19:22 PST 2024
david-arm 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?
https://github.com/llvm/llvm-project/pull/118393
More information about the llvm-commits
mailing list