[llvm] [HashRecognize] Fix the analysis result (PR #144742)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 18 12:03:54 PDT 2025


artagnon wrote:

> I thought about that, yes. I did lean towards making it a PM-level analysis for ease of testing. I leverage the existing infrastructure in update_analyze_test_checks to auto-generate the result, with a simple opt invocation in the RUN line. If this weren't a PM-level analysis, I'd have to hand-craft unit-tests in C++.
> 
> I think the specific problem you mentioned can be easily tackled by not preserving the analysis result in LIR. I don't think LIR runs more than once anyway, so I don't think it's ever computed more than once.
> 
> Besides, I plan to grow HashRecognize in size by also including other polynomial hashes, and possibly requiring more analysis results. In that sense, I think it is less like ConstraintSystem, and more like an independent analysis.

Actually, for testing, I only need the Printer pass. I thought about it some more, and I think it would make sense to strip the analysis pass entirely, and just pass SE and L for now. If we need more things, we can always get it in LIR, and pass it: I don't expect this to be used outside LIR anyway.

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


More information about the llvm-commits mailing list