[all-commits] [llvm/llvm-project] d3919a: [ConstantFolding] Respect denormal handling mode a...

dcandler via All-commits all-commits at lists.llvm.org
Mon Jun 20 08:43:14 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3919a8cc5031fd3d8c1ce3188abc0d7551306fb
      https://github.com/llvm/llvm-project/commit/d3919a8cc5031fd3d8c1ce3188abc0d7551306fb
  Author: David Candler <david.candler at arm.com>
  Date:   2022-06-20 (Mon, 20 Jun 2022)

  Changed paths:
    M llvm/include/llvm/Analysis/ConstantFolding.h
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/test/Transforms/InstSimplify/constant-fold-fp-denormal.ll

  Log Message:
  -----------
  [ConstantFolding] Respect denormal handling mode attributes when folding instructions

Depending on the environment, a floating point instruction should
treat denormal inputs as zero, and/or flush a denormal output to zero.
Denormals are not currently accounted for when an instruction gets
folded to a constant, which can lead to differences in output between
a folded and a unfolded instruction when running on the target. The
denormal handling mode can be set by the function level attribute
denormal-fp-math, which this patch uses to determine whether any
denormal inputs to or outputs from folding should be zero, and that
the sign is set appropriately.

Reviewed By: spatel

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




More information about the All-commits mailing list