[PATCH] D69598: WIP: Work on cleaning up denormal mode handling

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 18:32:59 PDT 2019


arsenm created this revision.
arsenm added reviewers: scanon, andrew.w.kaylor, cameron.mcinally, spatel, RKSimon, olista01, SjoerdMeijer.
Herald added subscribers: dexonsmith, hiraditya, tpr, mgorny, wdng.
Herald added a project: LLVM.

Cleanup handling of the denormal-fp-math attribute. Consolidate places
checking the allowed names in one place. Also begin migrating towards
the current IEEE-754's standard's preferred terminology of subnormal
over denormal.

      

This is in preparation for introducing FP type specific variants of
the denorm-fp-mode attribute. AMDGPU will switch to using this in
place of the current hacky use of subtarget features for the denormal
mode.

      

Introduce a new header for dealing with FP modes. The constrained
intrinsic classes define related enums that should also be moved into
this header for uses in other contexts.

      

The verifier could use a check to make sure the denorm-fp-mode
attribute is sane, but there currently isn't one.

      

There is a problem with this patch as is. The one place currently
checking this attribute in buildSqrtEstimateImpl (added by D42323 <https://reviews.llvm.org/D42323>)
oddly doesn't assume the ieee behavior if the attribute isn't
specified as I would expect. The question of why this behaves this way
needs to be resolved to proceed as tests fail due to assuming IEEE
behavior on undecorated functions.


https://reviews.llvm.org/D69598

Files:
  clang/include/clang/Basic/CodeGenOptions.h
  clang/lib/CodeGen/CGCall.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  llvm/include/llvm/ADT/FloatingPointMode.h
  llvm/include/llvm/CodeGen/MachineFunction.h
  llvm/lib/CodeGen/MachineFunction.cpp
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/unittests/ADT/CMakeLists.txt
  llvm/unittests/ADT/FloatingPointMode.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69598.227011.patch
Type: text/x-patch
Size: 9496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191030/0d1c03b7/attachment.bin>


More information about the cfe-commits mailing list