kper wrote: Thanks for the clarification, I misunderstood how the method works. I integrated the fold into `simplifyWithOpsReplaced`. Additionally, I added a check for the range. If it's not the expected range then I don't apply the fold. https://github.com/llvm/llvm-project/pull/168505