[llvm] [ARM] Replace ABS and tABS machine nodes with custom lowering (PR #156717)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 14 13:47:27 PDT 2025


AZero13 wrote:

> This sounds like a nice cleanup. I've wondered why the default lowering used these ABS pseudos. It is a shame it needs custom lowers, that can have downsides, but in this case with the custom lowering being so odd and the midend already canonicalizing to abs instructions it probably makes sense.
> 
> Can you update the costs to match the expansion?

Expansion costs seem accurate. Not only does it match how it is done for AArch64, but a drop from 5 to 4 when it is in fact 4 in codesize, Lat, and throughput makes sense. Even if what you were saying is right, the original cost of 5 isn't accurate anyway. 

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


More information about the llvm-commits mailing list