[all-commits] [llvm/llvm-project] ec2234: InstCombine: Fold is.fpclass for single infinity t...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Fri Mar 17 08:52:32 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ec2234a21a5dbffcc7b8eb0996e3aba288a4009a
      https://github.com/llvm/llvm-project/commit/ec2234a21a5dbffcc7b8eb0996e3aba288a4009a
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2023-03-17 (Fri, 17 Mar 2023)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/test/Transforms/InstCombine/create-class-from-logic-fcmp.ll
    M llvm/test/Transforms/InstCombine/is_fpclass.ll

  Log Message:
  -----------
  InstCombine: Fold is.fpclass for single infinity to fcmp

llvm.is.fpclass(x, fcPosInf) -> fcmp oeq x, +inf
llvm.is.fpclass(x, fcNegInf) -> fcmp oeq x, -inf
llvm.is.fpclass(x, ~fcPosInf) -> fcmp one x, +inf
llvm.is.fpclass(x, ~fcNegInf) -> fcmp one x, -inf

llvm.is.fpclass(x, fcPosInf|fcNan) -> fcmp ueq x, +inf
llvm.is.fpclass(x, fcNegInf|fcNan) -> fcmp ueq, -inf
llvm.is.fpclass(x, ~fcPosInf & ~fcNan) -> fcmp one, x, +inf
llvm.is.fpclass(x, ~fcNegInf & ~fcNan) -> fcmp one, x, -inf

This regresses some of the logic of fcmp tests. These should be restored
in a future patch to better handle combining logic of fcmp and class.




More information about the All-commits mailing list