[llvm] [SDAG][abd] Remove duplicate legality check (PR #181538)

via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 19 00:55:06 PST 2026


natanelh-mobileye wrote:

the case I encountered it in the wild is as follows: scalar type that isnt legal (i8 , similarly to riscv), if we do not perform this optimization then we get a lot of instructions (sub, sub, select, some sort of trunc/zext...), but if we do this then we could for example, convert that into a vector op (abd), bitcast and one scalar op (neg), which is cheaper than all these 5 scalar ops. I could try to replace with a check for isTypeLegal but I don't think it'd help with the case I was looking at.

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


More information about the llvm-commits mailing list