[all-commits] [llvm/llvm-project] d5c953: [C API] Add getters and setters for fast-math flag...

Benji Smith via All-commits all-commits at lists.llvm.org
Tue Dec 12 08:15:18 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d5c95302b9736b4e785c77463d7f2026b772ba1b
      https://github.com/llvm/llvm-project/commit/d5c95302b9736b4e785c77463d7f2026b772ba1b
  Author: Benji Smith <6193112+Benjins at users.noreply.github.com>
  Date:   2023-12-12 (Tue, 12 Dec 2023)

  Changed paths:
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm-c/Core.h
    M llvm/lib/IR/Core.cpp
    M llvm/test/Bindings/llvm-c/echo.ll
    A llvm/test/Bindings/llvm-c/float_ops.ll
    M llvm/tools/llvm-c-test/echo.cpp

  Log Message:
  -----------
  [C API] Add getters and setters for fast-math flags on relevant instructions (#75123)

These flags are usable on floating point arithmetic, as well as call,
select, and phi instructions whose resulting type is floating point, or
a vector of, or an array of, a valid type. Whether or not the flags are
valid for a given instruction can be checked with the new
LLVMCanValueUseFastMathFlags function.

These are exposed using a new LLVMFastMathFlags type, which is an alias
for unsigned. An anonymous enum defines the bit values for it.

Tests are added in echo.ll for select/phil/call, and the floating point
types in the new float_ops.ll bindings test.

Select and the floating point arithmetic instructions were not
implemented in llvm-c-test/echo.cpp, so they were added as well.




More information about the All-commits mailing list