[llvm] [AArch64] Signed comparison using CMN is safe when the subtraction is nsw (PR #141993)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 11:57:59 PDT 2025


AZero13 wrote:

> > Is it possible for a sub node to be made without nsw by mistake?
> 
> I guessing the tests that are failing are handwritten without consideration of the `nsw` flag and the test author did not run them through InstCombine to add the flag. Unfortunately, SelectionDAG only propagates the flag from IR and never infers it on any nodes.

> The test author

Yeah that would be me. I wrote these tests without realizing I could use nsw.

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


More information about the llvm-commits mailing list