[llvm] [HashRecognize] Track visited in ValueEvolution (PR #147812)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 03:13:36 PDT 2025


https://github.com/artagnon commented:

> Instead of the Visited set, have a ToVisit set initialized with all the loop instructions, erase while visiting and at the end just check if the set is empty.

I tried it, and it's exactly equivalent, with minor regression to the elegance of the code (due to missing erase_range, SmallPtrSetImpl stuff), and same computational complexity. I've simplified the check at the end.

> Instead of a set, only track the number of instructions. This would work if the instructions are visited once - is that the case?

No, the instructions are visited trip-count times.

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


More information about the llvm-commits mailing list