[all-commits] [llvm/llvm-project] 94d3ff: [GlobalISel] Don't use G_FPTOSI in G_ISNAN legaliz...

Jessica Paquette via All-commits all-commits at lists.llvm.org
Tue Aug 31 10:27:08 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 94d3ff09cfa8d7aecf480e54da9a5334e262e76b
      https://github.com/llvm/llvm-project/commit/94d3ff09cfa8d7aecf480e54da9a5334e262e76b
  Author: Jessica Paquette <jpaquette at apple.com>
  Date:   2021-08-31 (Tue, 31 Aug 2021)

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

  Log Message:
  -----------
  [GlobalISel] Don't use G_FPTOSI in G_ISNAN legalization

As noted in the comments in D108227, using G_FPTOSI produces wrong results for
G_ISNAN. Drop the G_FPTOSI and perform the operation on integer types.

Elsewhere in LLVM, a bitcast would be the appropriate choice (as it is in SDAG).
GlobalISel does not distinguish between integer and FP types, so a bitcast would
be meaningless here.




More information about the All-commits mailing list