[PATCH] D106918: [x86] improve CMOV codegen by pushing add into operands, part 3

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 27 14:30:06 PDT 2021


spatel created this revision.
spatel added reviewers: craig.topper, pengfei, lebedev.ri, RKSimon.
Herald added subscribers: hiraditya, mcrosier.
spatel requested review of this revision.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D106918

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/add-cmov.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106918.362176.patch
Type: text/x-patch
Size: 4867 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210727/38485530/attachment.bin>


More information about the llvm-commits mailing list