llvm-project
6428706c - [mlir][LLVM] Add strictfp to llvm.func and the call ops (#246250)

Commit
10 hours ago
[mlir][LLVM] Add strictfp to llvm.func and the call ops (#246250) In a function that uses constrained floating-point intrinsics, LLVM requires every call to be `strictfp`, at the call site or on the callee, and its folders check the call before they fold or simplify a libcall. The LLVM dialect could mark only the function, through `passthrough`, so a frontend lowering to it had no way to mark its calls. This adds a `strictfp` unit attribute to `llvm.func`, `llvm.call`, `llvm.invoke`, `llvm.inline_asm` and `llvm.call_intrinsic`, the way the dialect already models `convergent`, `no_unwind` and `will_return`. Export turns it into the LLVM `strictfp` attribute and import reads it back, so a `strictfp` function no longer lands in `passthrough`; the tests cover round-trip, export and import for each op. Calls of the constrained intrinsic ops already get the attribute from IRBuilder. Other named intrinsic ops have no call-site attributes. The inliner now refuses a callee marked `strictfp` and no longer looks for `strictfp` in `passthrough`. Assisted-by: Claude Code (Opus 5.5).
Author
Parents
Loading