Add pass to uplift from arith mulf + addf ops to math.fma if fastmath flags allow it.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Just some nits
mlir/lib/Dialect/Arith/Utils/Utils.cpp | ||
---|---|---|
175–182 | Could we use llvm::enum_seq to iterate over these? | |
mlir/lib/Dialect/Math/Transforms/UpliftToFMA.cpp | ||
34 | nit: public is the default for structs. Instead, consider adding final: struct UpliftFma final : OpRewrite... | |
57 | nit: The type of fmt it not obvious here -- we should spell it out instead of using auto | |
63–64 | nit: also here | |
mlir/test/Dialect/Math/uplift-to-fma.mlir | ||
1 | nit: this mixes short (-xyz) and long options (--xyz) |
mlir/lib/Dialect/Arith/Utils/Utils.cpp | ||
---|---|---|
175–182 | They are bitfields and not consecutive values, I don't this it will work. |
mlir/lib/Dialect/Arith/Utils/Utils.cpp | ||
---|---|---|
183 | I always check (a & flag) == flag. |
mlir/lib/Dialect/Math/Transforms/UpliftToFMA.cpp | ||
---|---|---|
49 | Please ignore that comment. Apologies. |
mlir/lib/Dialect/Math/Transforms/UpliftToFMA.cpp | ||
---|---|---|
53 | Nit: prefer rewriter.notifyMatchFailure to be able to give context during debugging as to match failures. |
I don't think we need arith here if the pass doesn't create any arith ops.