[all-commits] [llvm/llvm-project] 390b99: [InstCombine] Handle isNanOrInf idioms (#80414)

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Sat Feb 3 15:09:50 PST 2024


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

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

  Log Message:
  -----------
  [InstCombine] Handle isNanOrInf idioms (#80414)

This patch folds:
```
(icmp eq (and (bitcast X to int), ExponentMask), ExponentMask) --> llvm.is.fpclass(X, fcInf|fcNan)
(icmp ne (and (bitcast X to int), ExponentMask), ExponentMask) --> llvm.is.fpclass(X, ~(fcInf|fcNan))
```
Alive2: https://alive2.llvm.org/ce/z/_hXAAF




More information about the All-commits mailing list