[PATCH] D146170: InstCombine: Fold is.fpclass for single infinity to fcmp

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 14:53:27 PDT 2023


arsenm created this revision.
arsenm added reviewers: jcranmer-intel, kpn, sepavloff, foad, cameron.mcinally, andrew.w.kaylor.
Herald added subscribers: StephenFan, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D146170

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146170.505632.patch
Type: text/x-patch
Size: 22684 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230315/6e43d346/attachment.bin>


More information about the llvm-commits mailing list