[llvm] [RISCV] Lower (abd[s|u] a, b) to (abs (sub a, b)) for i32/i64 element when `Zvabd` exists (PR #180494)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 08:46:15 PST 2026


https://github.com/topperc requested changes to this pull request.

This transform isn't valid if the subtract has signed wrap.

absd(2, 0x8000) -> 0x8002

abs(sub(2, 0x8000)) -> (abs (0x8002)) -> 0x7ffe

https://alive2.llvm.org/ce/

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


More information about the llvm-commits mailing list