[PATCH] D62731: [RFC] Add support for options -fp-model= and -fp-speculation= : specify floating point behavior

Melanie Blower via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 09:11:55 PDT 2019


mibintc updated this revision to Diff 211770.
mibintc added a comment.
Herald added subscribers: hiraditya, mgorny.

The IRBuilder now has  been taught about constrained fadd and friends.  I simply updated my patches to work with the committed revision.  Note that this diff now contains what was formerly being reviewed separately in clang+llvm.  Also let's discuss the new llvm file fpState.h. In this revision I didn't spend a lot of time pondering the best way to support this in the current world, i just made a simple update so it would build.

I could put the entire patch under clang and not create new files in llvm.  I think it would be an advantage to have the interpretation of the floating point command line switches occur in llvm itself. For one reason, because Intel plans to contribute the same options in the Fortran compiler as well as the clang compiler. This puts the switch logic into a single place.  Other languages may want to add support for the options too. Note, we also plan to implement inline pragma's for clang which allow the fp modes to be set for the duration of a code block.

I think it would be convenient to have an "unset" setting for the different constrained modes, otherwise you need a boolean that says "no value was provided for this option".  But i'm a frontend person so I may need to have my attitude adjusted.

When I was coding this before, I needed to pull out FPState.h from within IRBuilder because otherwise I needed to sprinkle additional include directives in many clang files, if it's pulled out like this to be more or less standalone then that problem resolved.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62731/new/

https://reviews.llvm.org/D62731

Files:
  clang/include/clang/Basic/LangOptions.h
  clang/include/clang/Driver/CC1Options.td
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/Driver/clang_f_opts.c
  llvm/include/llvm/IR/FPState.h
  llvm/lib/IR/CMakeLists.txt
  llvm/lib/IR/FPState.cpp
  llvm/unittests/IR/IRBuilderTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62731.211770.patch
Type: text/x-patch
Size: 19771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190725/c37368ad/attachment.bin>


More information about the llvm-commits mailing list