[all-commits] [llvm/llvm-project] 028eb4: [x86] add tests for add X, (cmov constants); NFC

RotateRight via All-commits all-commits at lists.llvm.org
Fri Jul 23 06:41:16 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 028eb436546a75a434931f9bbbb073b353920a74
      https://github.com/llvm/llvm-project/commit/028eb436546a75a434931f9bbbb073b353920a74
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    A llvm/test/CodeGen/X86/add-cmov.ll

  Log Message:
  -----------
  [x86] add tests for add X, (cmov constants); NFC


  Commit: f060aa1cf3f42ca967c3f63e18381d3579bb12d9
      https://github.com/llvm/llvm-project/commit/f060aa1cf3f42ca967c3f63e18381d3579bb12d9
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/add-cmov.ll

  Log Message:
  -----------
  [x86] improve CMOV codegen by pushing add into operands

This is not the transform direction we want in general,
but by the time we have a CMOV, we've already tried
everything else that could be better.
The transform increases the uses of the other add operand,
but that is safe according to Alive2:
https://alive2.llvm.org/ce/z/Yn6p-A

We could probably extend this to other binops (not just add).
This is the motivating pattern discussed in:
https://llvm.org/PR51069

The test with i8 shows a missed fold because there's a trunc
sitting in front of the add. That can be handled with a small
follow-up.

Differential Revision: https://reviews.llvm.org/D106607


Compare: https://github.com/llvm/llvm-project/compare/253b8145dedb...f060aa1cf3f4


More information about the All-commits mailing list