[PATCH] D106607: [x86] improve CMOV codegen by pushing add into operands

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 23 05:49:20 PDT 2021


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

I think byte-sized add should be dealt with separately.
LG unless there are other comments.



================
Comment at: llvm/test/CodeGen/X86/add-cmov.ll:51-52
 ; CHECK-NEXT:    movl $45, %eax
 ; CHECK-NEXT:    cmovnel %ecx, %eax
 ; CHECK-NEXT:    addb %dil, %al
 ; CHECK-NEXT:    # kill: def $al killed $al killed $eax
----------------
spatel wrote:
> lebedev.ri wrote:
> > I guess you need to look past a truncation when looking for the cmov,
> > and then widen everything to the cmov type.
> Yes - or we try to carve out another case where we prefer i32 instead of trying to narrow the add. Changing the preferred type would probably be the better choice, but there will likely be a lot of test diffs...
I think we should in general widen everything less than i32 to i32,
but here i'd guess it would be better to just look past trunc.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106607/new/

https://reviews.llvm.org/D106607



More information about the llvm-commits mailing list