[llvm] [X86] abs i8 - perform as abs i32 if we have access to CMOV (PR #95101)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 19 17:40:22 PDT 2024


goldsteinn wrote:

> It's annoying that we end up having to copy/extend the non-negated param:
> 
> ```assembly
> movsbl %dil, %ecx
> movl %ecx, %eax
> negl %eax
> cmovsl %ecx, %eax
> ```
> 
> when we should be able to get away with
> 
> ```assembly
> movsbl %dil, %eax
> negl %eax
> cmovnsl %edi, %eax
> ```

I'd think that would be better handled by a different/new pass. There are a lot of places we conservatively extend.

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


More information about the llvm-commits mailing list