bcl5980 wrote: We should add TTI check for the condition. I believe don't unroll on X86 is a correct decision. Only like AMDGPU or NVPTX these GPU target with heavy stack cost backend target need this. https://github.com/llvm/llvm-project/pull/74268