[all-commits] [llvm/llvm-project] b82d18: [AArch64][GlobalISel] Change G_FCONSTANTs feeding ...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Thu Jan 16 15:19:01 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: b82d18e1e8e6a997f304cbf591e92af02e067fdb
      https://github.com/llvm/llvm-project/commit/b82d18e1e8e6a997f304cbf591e92af02e067fdb
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2020-01-16 (Thu, 16 Jan 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64Combine.td
    M llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
    A llvm/test/CodeGen/AArch64/GlobalISel/combine-fconstant.mir

  Log Message:
  -----------
  [AArch64][GlobalISel] Change G_FCONSTANTs feeding into stores into G_CONSTANTS

Given the following situation:

x = G_FCONSTANT (something that can't be materialized)
G_STORE x, some_addr

We know that x must be materialized as at least a single mov. However, at the
time of selection, the G_STORE will have been regbankselected to a FPR store.

So, as a result, you'll get an unnecessary fmov into the G_STORE.

Storing a constant value in a GPR and a constant value in a FPR are the same.
So, whenever you see a G_FCONSTANT that feeds into only G_STORES, so might as
well make it a G_CONSTANT.

This adds a target-specific combine which changes G_FCONSTANTs feeding into
G_STOREs into G_CONSTANTs.

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




More information about the All-commits mailing list