We can simplify the code needed to implement dyn_cast/cast/isa support for MLIR operations with documented interfaces via the CastInfo structures. This will also provide an example of how to use CastInfo.
Depends on D123901
Paths
| Differential D124963
[MLIR][Operation] Simplify Operation casting, NFC ClosedPublic Authored by bzcheeseman on May 4 2022, 2:00 PM.
Details
Summary We can simplify the code needed to implement dyn_cast/cast/isa support for MLIR operations with documented interfaces via the CastInfo structures. This will also provide an example of how to use CastInfo. Depends on D123901
Diff Detail
Event Timelinebzcheeseman retitled this revision from [MLIR][Operations] Simplify Operation casting to [MLIR][Operation] Simplify Operation casting, NFC.May 4 2022, 2:16 PM This revision is now accepted and ready to land.May 11 2022, 9:19 AM Closed by commit rGbc22b5c9a2f7: [MLIR][Operation] Simplify Operation casting, NFC (authored by bzcheeseman). · Explain WhyMay 11 2022, 9:17 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 427387 mlir/include/mlir/IR/Operation.h
|
I wonder if we should have a trait for forwarding the reference variant to the pointer variant of a ToValueCast. Though maybe this is rare enough where it doesn't matter.