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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 01:00:17 PST 2023


================
@@ -483,6 +483,26 @@ typedef enum {
 
 typedef unsigned LLVMAttributeIndex;
 
+enum {
+  LLVMFastMathAllowReassoc = (1 << 0),
+  LLVMFastMathNoNaNs = (1 << 1),
+  LLVMFastMathNoInfs = (1 << 2),
+  LLVMFastMathNoSignedZeros = (1 << 3),
+  LLVMFastMathAllowReciprocal = (1 << 4),
+  LLVMFastMathAllowContract = (1 << 5),
+  LLVMFastMathApproxFunc = (1 << 6),
+  LLVMFastMathNone = 0,
+  LLVMFastMathAll = -1,
+};
+
+/**
+ * Flags to indicate what fast-math-style optimizations are allowed
+ * on operations
----------------
nikic wrote:

```suggestion
 * on operations.
```
Here and elsewhere.

https://github.com/llvm/llvm-project/pull/75123


More information about the llvm-commits mailing list