[llvm] [LoopIdiomRecognizer] Implement CRC recognition (PR #79295)

Mikhail Gudim via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 21:34:20 PST 2024


mgudim wrote:

> So the return value is the quotient? Doesn't that complicate the expression of CRC? What we need for CRC is surely something like premstep instead?

Yes, you're right.

> Would it be easier to have a bit reversed variation of the intrinsic? We'd have to identify these bitreverse intrinsics upon expansion anyway. It would just avoid having to insert and then recognize it.

I am OK with that too. I just didn't want to introduce more intrinsics than we need.

>  would the first MR be just recognition and creation of the division intrinsic? 

I think first MR should be just defining the intrinsics.

> would the first MR be just recognition and creation of the division intrinsic? I.E strip the table based lookup from this MR 

yes.

> but would error in the backend.

Only emit intrinsic if a flag is passed so it doesn't break anything. Name of the flag could indicate that at this point the code gen doesn't work yet for the intrinsic. But at the same time you should be able to add tests to your MR.


https://github.com/llvm/llvm-project/pull/79295


More information about the llvm-commits mailing list