[all-commits] [llvm/llvm-project] f292f9: [InstCombine] Fold select with signbit idiom into ...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Tue Jan 30 23:42:21 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f292f90bc2ec2c1ec4306027e17877bb4603d8d2
      https://github.com/llvm/llvm-project/commit/f292f90bc2ec2c1ec4306027e17877bb4603d8d2
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2024-01-31 (Wed, 31 Jan 2024)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/test/Transforms/InstCombine/fabs.ll

  Log Message:
  -----------
  [InstCombine] Fold select with signbit idiom into fabs (#76342)

This patch folds:
```
((bitcast X to int) <s 0 ? -X : X) -> fabs(X)
((bitcast X to int) >s -1 ? X : -X) -> fabs(X)
((bitcast X to int) <s 0 ? X : -X) -> -fabs(X)
((bitcast X to int) >s -1 ? -X : X) -> -fabs(X)
```
Alive2: https://alive2.llvm.org/ce/z/rGepow




More information about the All-commits mailing list