[all-commits] [llvm/llvm-project] 993301: [X86] Fold MMX_MOVD64from64rr + store to MMX_MOVQ6...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Mar 22 14:22:40 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9933015fdd761adc1883ce87708a6aaf988031a0
      https://github.com/llvm/llvm-project/commit/9933015fdd761adc1883ce87708a6aaf988031a0
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2022-03-22 (Tue, 22 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86InstrFoldTables.cpp
    M llvm/test/CodeGen/X86/stack-folding-mmx.ll

  Log Message:
  -----------
  [X86] Fold MMX_MOVD64from64rr + store to MMX_MOVQ64mr instead of MMX_MOVD64from64mr.

MMX_MOVD64from64rr moves an MMX register to a 64-bit GPR.

MMX_MOVD64from64mr is the memory version of moving a MMX register to a
64-bit GPR. It requires the REX.W bit to be set. There are no isel
patterns that use this instruction.

MMX_MOVQ64mr is the MMX register store instruction. It doesn't
require a REX.W prefix. This makes it one byte shorter to encode
than MMX_MOVD64from64mr in many cases.

Both store instructions output the same mnemonic string. The assembler
would choose MMX_MOVQ64mr if it was to parse the output. Which is
another reason using it is the correct thing to do.

Reviewed By: RKSimon

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




More information about the All-commits mailing list