Given a cmpf of either uitofp or sitofp and a constant, attempt to canonicalize it to a cmpi.
This PR rewrites equivalent code within LLVM to now apply to MLIR arith.
Paths
| Differential D117257
[MLIR][Arith] Canonicalize cmpf(int to fp) to cmpi ClosedPublic Authored by wsmoses on Jan 13 2022, 3:03 PM.
Details Summary Given a cmpf of either uitofp or sitofp and a constant, attempt to canonicalize it to a cmpi. This PR rewrites equivalent code within LLVM to now apply to MLIR arith.
Diff Detail
Event TimelineHerald added subscribers: sdasgup3, wenzhicui, wrengr and 18 others. · View Herald TranscriptJan 13 2022, 3:03 PM This revision now requires changes to proceed.Jan 13 2022, 3:06 PM
This revision is now accepted and ready to land.Feb 23 2022, 9:14 AM Comment Actions Remove rdar
Closed by commit rG1b2a1f847354: [MLIR][Arith] Canonicalize cmpf(int to fp) to cmpi (authored by wsmoses). · Explain WhyFeb 23 2022, 11:09 AM This revision was automatically updated to reflect the committed changes. max-kudr added inline comments.
Revision Contents
Diff 399803 mlir/include/mlir/Dialect/Arithmetic/IR/ArithmeticOps.td
mlir/include/mlir/IR/BuiltinTypes.h
mlir/lib/Dialect/Arithmetic/IR/ArithmeticOps.cpp
mlir/lib/IR/BuiltinTypes.cpp
mlir/test/Dialect/Arithmetic/canonicalize.mlir
|
I would remove this. If either this or the other get out of sync (for some number of reasons), this comment is just confusing. Ideally all of the code here should be properly documented and lay out whatever invariants are driving the transformation. I wouldn't constrain/limit whatever we do here with what has been done in InstCombine.