[all-commits] [llvm/llvm-project] 5805cf: [InstCombine] Complete folding of fneg-of-fabs

ZCBing via All-commits all-commits at lists.llvm.org
Sun Apr 24 18:54:08 PDT 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5805cfb90127195a9e8aa09716e989f286d0e22b
  Author: Chenbing Zheng <Chenbing.Zheng at streamcomputing.com>
  Date:   2022-04-25 (Mon, 25 Apr 2022)

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

  Log Message:
  [InstCombine] Complete folding of fneg-of-fabs

This patch add a function foldSelectWithFCmpToFabs, and do more combine for
With 'nsz':
fold (X <  +/-0.0) ? X : -X or (X <= +/-0.0) ? X : -X to -fabs(x)
fold (X >  +/-0.0) ? X : -X or (X >= +/-0.0) ? X : -X to -fabs(x)

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D123830

More information about the All-commits mailing list