[llvm] [LoopIdiom] Use HashRecognize to optimize CRC (PR #143208)
Ramkumar Ramachandra via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 9 08:40:26 PDT 2025
artagnon wrote:
> > What if the input loop did other things aside from calculating the CRC (such as calling `extern` functions)? Will we abandon this transform or preserve the non-CRC operations?
>
> We will abandon the transform, since HashRecognize will always abort on stray operations. Added a test.
Actually, if the call isn't in the use-def chain (say `call void @foo()`), it will still remain in the transformed loop as ValueEvolution doesn't see it. However, if the call is side-effecting, the transform would be unsound, as the number of loop iterations have changed: this is probably a bug in HashRecognize, and I'll look into this.
https://github.com/llvm/llvm-project/pull/143208
More information about the llvm-commits
mailing list