[all-commits] [llvm/llvm-project] c8ca98: [InstCombine] Handle IsInf/IsZero idioms (#80607)

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Wed Feb 7 21:45:39 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c8ca98a2a9796797f2eab00cc6516610c133633a
      https://github.com/llvm/llvm-project/commit/c8ca98a2a9796797f2eab00cc6516610c133633a
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-02-08 (Thu, 08 Feb 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/test/Transforms/InstCombine/fpclass-check-idioms.ll

  Log Message:
  -----------
  [InstCombine] Handle IsInf/IsZero idioms (#80607)

This patch does the following folds:
```
icmp eq/ne (bitcast X to int), (bitcast +/-inf to int) -> llvm.is.fpclass(X, (~)fcPosInf/fcNegInf)
icmp eq/ne (bitcast X to int), (bitcast +0/-0 to int) -> llvm.is.fpclass(X, (~)fcPosZero/fcNegZero)
```
Alive2: https://alive2.llvm.org/ce/z/JJmEE9




More information about the All-commits mailing list