[llvm] [InstCombine] Preserve the nsw flag for (X | Op01C) + Op1C --> X + (Op01C + Op1C) (PR #94586)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 7 00:47:58 PDT 2024


csstormq wrote:

> Your proof is not for the transform you actually implement. The transform is still incorrect in general, you merely picked out one example where it is correct. I have already shared what you need to do to make it correct in my second comment. The necessary pre-condition can be implemented using the willNotOverflowSignedAdd helper.

I guess I have fixed up, and add more test cases. Thanks a lot for your help. Please review again.

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


More information about the llvm-commits mailing list