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

via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 9 06:38:06 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.

We make SUB nodes in dagcombine, and they do not carry flags, so this check is still good.

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


More information about the llvm-commits mailing list