[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 23:00:44 PST 2026


topperc wrote:

> > 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/
> 
> The Alive2 link is not correct, can you share it again?

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

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


More information about the llvm-commits mailing list