[all-commits] [llvm/llvm-project] effde7: InstCombine: Match pattern that appears in clang's...

Matt Arsenault via All-commits all-commits at lists.llvm.org
Mon Dec 19 05:12:45 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: effde7f43e26091678dcd5a8f3eb8f344f1be8a7
      https://github.com/llvm/llvm-project/commit/effde7f43e26091678dcd5a8f3eb8f344f1be8a7
  Author: Matt Arsenault <Matthew.Arsenault at amd.com>
  Date:   2022-12-19 (Mon, 19 Dec 2022)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/test/Transforms/InstCombine/and-fcmp.ll
    M llvm/test/Transforms/InstCombine/create-class-from-logic-fcmp.ll

  Log Message:
  -----------
  InstCombine: Match pattern that appears in clang's __builtin_isnormal

and (fcmp ord x, 0), (fcmp u* x, inf) -> fcmp o* x, inf
and (fcmp ord x, 0), (fcmp u* fabs(x), inf) -> fcmp o* x, inf

Clang emits this peculiar pattern as an isfinite check in
__builtin_isnormal which can be simplified. We should fix clang to
emit this in the first place, but should also fold it here.




More information about the All-commits mailing list