[all-commits] [llvm/llvm-project] 1c64b5: [ConstantFolding] Fold constrained arithmetic intr...

Serge Pavlov via All-commits all-commits at lists.llvm.org
Fri Jul 23 00:40:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1c64b5dc5ea8c20a7f2ae436f31030bde0c99db3
      https://github.com/llvm/llvm-project/commit/1c64b5dc5ea8c20a7f2ae436f31030bde0c99db3
  Author: Serge Pavlov <sepavloff at gmail.com>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/test/Transforms/InstSimplify/constfold-constrained.ll
    M llvm/test/Transforms/InstSimplify/fdiv-strictfp.ll

  Log Message:
  -----------
  [ConstantFolding] Fold constrained arithmetic intrinsics

Constfold constrained variants of operations fadd, fsub, fmul, fdiv,
frem, fma and fmuladd.

The change also sets up some means to support for removal of unused
constrained intrinsics. They are declared as accessing memory to model
interaction with floating point environment, so they were not removed,
as they have side effect. Now constrained intrinsics that have
"fpexcept.ignore" as exception behavior are removed if they have no uses.
As for intrinsics that have exception behavior other than "fpexcept.ignore",
they can be removed if it is known that they do not raise floating point
exceptions. It happens when doing constant folding, attributes of such
intrinsic are changed so that the intrinsic is not claimed as accessing
memory.

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




More information about the All-commits mailing list