[PATCH] D139904: InstCombine: Fold logic of fp_classes together

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 18:50:38 PST 2022


arsenm created this revision.
arsenm added reviewers: spatel, sepavloff, kpn, foad, jcranmer-intel.
Herald added a subscriber: hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

Move logical operators on pairs of llvm.is.fpclass on the same value
into the test mask of a single is_fpclass.

      

or (class x, mask0), (class x, mask1) -> class x, (mask0 | mask1)
and (class x, mask0), (class x, mask1) -> class x, (mask0 & mask1)
xor (class x, mask0), (class x, mask1) -> class x, (mask0 ^ mask1)

      

The and/or cases should appear frequently in the builtin math
libraries; haven't seen the xor case but handle it for completeness.


https://reviews.llvm.org/D139904

Files:
  llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/test/Transforms/InstCombine/is_fpclass.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139904.482335.patch
Type: text/x-patch
Size: 17638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221213/6bf36377/attachment.bin>


More information about the llvm-commits mailing list