[InstCombine] Propagate NSW/NUW flags for `(X - Y) - Z -> X - (Y + Z)` (#72693)
commitdfe1d35c629f2948c0e8cf29d926729b1dbc1709
authorYingwei Zheng <dtcxzyw2333@gmail.com>
Sun, 19 Nov 2023 16:02:23 +0000 (20 00:02 +0800)
committerGitHub <noreply@github.com>
Sun, 19 Nov 2023 16:02:23 +0000 (20 00:02 +0800)
tree32f56e594275c0ca110fa45176420d5d52cd68aa
parent5a305cea52bf45d4070b366fd7bc7592b6db0072
[InstCombine] Propagate NSW/NUW flags for `(X - Y) - Z -> X - (Y + Z)` (#72693)

Alive2: https://alive2.llvm.org/ce/z/gqeaVo

Related patch:
https://github.com/llvm/llvm-project/commit/31d219d2997fed1b7dc97e0adf170d5aaf65883e
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/test/Transforms/InstCombine/sub-from-sub.ll