[all-commits] [llvm/llvm-project] 4c41ca: [x86] improve CMOV codegen by pushing add into ope...

RotateRight via All-commits all-commits at lists.llvm.org
Wed Jul 28 06:11:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4c41caa2871095cf1e936b0eea10079c60f864dc
      https://github.com/llvm/llvm-project/commit/4c41caa2871095cf1e936b0eea10079c60f864dc
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2021-07-28 (Wed, 28 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, part 3

In this episode, we are trying to avoid an x86 micro-arch quirk where complex
(3 operand) LEA potentially costs significantly more than simple LEA. So we
simultaneously push and pull the math around the CMOV to balance the operations.

I looked at the debug spew during instruction selection and decided against
trying a later DAGToDAG transform -- it seems very difficult to match if the
trailing memops are already selected and managing the creation of extra
instructions at that level is always tricky.

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




More information about the All-commits mailing list