Files
clang-p2996/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Jun Zhang 3ecf731376 [InstCombine] Reduce absolute diff from min+max+sub
This patch implements fold: max(a,b) nsw/nuw - min(a,b) --> abs(a nsw - b)

Alive2: https://alive2.llvm.org/ce/z/4yLp7D
Fixes: https://github.com/llvm/llvm-project/issues/61228

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D145540
2023-03-10 08:00:40 +08:00

97 KiB