Skip to content
Commit ededcb00 authored by Momchil Velikov's avatar Momchil Velikov
Browse files

[AArch64] Refactor AArch64InstrInfo::isAsCheapAsAMove (NFC)

    - remove `FeatureCustomCheapAsMoveHandling`: when you have target
      features affecting `isAsCheapAsAMove` that can be given on command
      line or passed via attributes, then every sub-target effectively has
      custom handling

    - remove special handling of `FMOVD0`/etc: `FVMOV` with an immediate
      zero operand is never[1] more expensive tha an `FMOV` with a
      register operand.

    - remove special handling of `COPY` - copy is trivially as cheap as
      itself

    - make the function default to the `MachineInstr` attribute
      `isAsCheapAsAMove`

    - remove special handling of `ANDWrr`/etc and of `ANDWri`/etc: the
      fallback `MachineInstr` attribute is already non-zero.

    - remove special handling of `ADDWri`/`SUBWri`/`ADDXri`/`SUBXri` -
      there are always[1] one cycle latency with maximum (for the
      micro-architecture) throughput

    - check if `MOVi32Imm`/`MOVi64Imm` can be expanded into a "cheap"
      sequence of instructions

      There is a little twist with determining whether a
      MOVi32Imm`/`MOVi64Imm` is "as-cheap-as-a-move". Even if one of these
      pseudo-instructions needs to be expanded to more than one MOVZ,
      MOVN, or MOVK instructions, materialisation may be preferrable to
      allocating a register to hold the constant. For the moment a cutoff
      at two instructions seems like a reasonable compromise.

    [1] according to 19 software optimisation manuals

Reviewed By: dmgreen

Differential Revision: https://reviews.llvm.org/D154722
parent b4301df6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment