Add basic cost modeling to the dialect conversion infrastructure. This initial cost...
authorRiver Riddle <riverriddle@google.com>
Tue, 11 Jun 2019 22:38:13 +0000 (15:38 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 20 Jun 2019 05:59:06 +0000 (22:59 -0700)
commit5da741f671ed5d7a25d0f0dc1a0636edce0e2b27
treea6be5fbc88f2b4ac69f7d44fe61bb6262d254b1d
parentbab53a94849f7ff76ce5ed665c0aa1903acd2d31
Add basic cost modeling to the dialect conversion infrastructure. This initial cost model favors specific patterns based upon two criteria:
1) Lowest minimum pattern stack depth when legalizing.
  - This leads the system to favor patterns that have lower legalization stacks, i.e. represent a more direct mapping to the target.

2)  Pattern benefit.
  - When considering multiple patterns with the same legalization depth, this favors patterns with a larger specified benefit.

PiperOrigin-RevId: 252713470
mlir/lib/Transforms/DialectConversion.cpp
mlir/test/TestDialect/TestOps.td
mlir/test/TestDialect/TestPatterns.cpp
mlir/test/Transforms/test-legalizer.mlir [new file with mode: 0644]