[all-commits] [llvm/llvm-project] 778fa4: [AArch64] Add some basic handling for bf16 constants.

David Green via All-commits all-commits at lists.llvm.org
Mon Jul 31 13:32:11 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 778fa4edaf207bd2fef3635ceb8782e325ded76a
      https://github.com/llvm/llvm-project/commit/778fa4edaf207bd2fef3635ceb8782e325ded76a
  Author: David Green <david.green at arm.com>
  Date:   2023-07-31 (Mon, 31 Jul 2023)

  Changed paths:
    M llvm/lib/CodeGen/TargetLoweringBase.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64InstrFormats.td
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    A llvm/test/CodeGen/AArch64/bf16-imm.ll

  Log Message:
  -----------
  [AArch64] Add some basic handling for bf16 constants.

This adds some basic handling for bf16 constants, attempting to treat them a
lot like fp16 constants where it can. Zero immediates get lowered to FMOVH0,
others either get lowered to FMOVWHr(MOVi32imm) or use FMOVHi if they can.
Without fp16 they get expanded. This may not always be optimal, but fixes a gap
in our lowering. See llvm/test/CodeGen/AArch64/f16-imm.ll for the equivalent
fp16 test.

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




More information about the All-commits mailing list