[all-commits] [llvm/llvm-project] d4f84d: [GlobalISel] Change widenScalar of G_FCONSTANT to ...

Amara Emerson via All-commits all-commits at lists.llvm.org
Thu Jul 14 11:05:24 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d4f84df0a008b13d0e8440aec1d63651b7520923
      https://github.com/llvm/llvm-project/commit/d4f84df0a008b13d0e8440aec1d63651b7520923
  Author: Amara Emerson <amara at apple.com>
  Date:   2022-07-14 (Thu, 14 Jul 2022)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir
    M llvm/test/CodeGen/AArch64/GlobalISel/legalize-fp16-fconstant.mir

  Log Message:
  -----------
  [GlobalISel] Change widenScalar of G_FCONSTANT to mutate into G_CONSTANT.

Widening a G_FCONSTANT by extending and then generating G_FPTRUNC doesn't produce
the same result all the time. Instead, we can just transform it to a G_CONSTANT
of the same bit pattern and truncate using a plain G_TRUNC instead.

Fixes https://github.com/llvm/llvm-project/issues/56454

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




More information about the All-commits mailing list