[Mlir-commits] [mlir] [mlir][spirv] Remove `enableFastMathMode` flag from SPIR-V conversion (PR #86578)
Ivan Butygin
llvmlistbot at llvm.org
Wed Mar 27 14:38:21 PDT 2024
================
@@ -8,7 +8,7 @@ module attributes {
// CHECK-SAME: %[[LHS:.+]]: f32, %[[RHS:.+]]: f32
func.func @cmpf_ordered(%arg0 : f32, %arg1 : f32) -> i1 {
// CHECK: %[[T:.+]] = spirv.Constant true
- %0 = arith.cmpf ord, %arg0, %arg1 : f32
+ %0 = arith.cmpf ord, %arg0, %arg1 fastmath<fast> : f32
----------------
Hardcode84 wrote:
> Is there a pass in upstream MLIR to add fastmath attributes to arith dialect ops?
I don't think upstream have such pass, but it should be straightforward to implement such pass without enumerating specific ops. All arith ops which support fastmath are implementing `ArithFastMathInterface`, so pass may look something like this:
```
void runOnOperation() {
getOperation()->walk([](ArithFastMathInterface iface) {
... set fastmath attribute
});
}
```
https://github.com/llvm/llvm-project/pull/86578
More information about the Mlir-commits
mailing list