[all-commits] [llvm/llvm-project] 6f6d2d: [x86] refine conditions for immediate hoisting to ...

RotateRight via All-commits all-commits at lists.llvm.org
Tue Jun 9 12:45:15 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6f6d2d238360883039cd17986c9ef598d04995a3
      https://github.com/llvm/llvm-project/commit/6f6d2d238360883039cd17986c9ef598d04995a3
  Author: Sanjay Patel <spatel at rotateright.com>
  Date:   2020-06-09 (Tue, 09 Jun 2020)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
    M llvm/test/CodeGen/X86/immediate_merging.ll
    M llvm/test/CodeGen/X86/immediate_merging64.ll
    M llvm/test/CodeGen/X86/pr27202.ll

  Log Message:
  -----------
  [x86] refine conditions for immediate hoisting to save code-size

As shown in PR46237:
https://bugs.llvm.org/show_bug.cgi?id=46237

The size-savings win for hoisting an 8-bit ALU immediate (intentionally
excluding store constants) requires extreme conditions; it may not even
be possible when including REX prefix bytes on x86-64.

I did draft a version of this patch that included use counts after the
loop, but I suspect that accounting is not working as expected. I think
that is because the number of constant uses are changing as we select
instructions (for example as we transform shl/add into LEA).

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




More information about the All-commits mailing list