This makes the class usable with types that do not provide their own operator<.
Update MLIR Linalg ComprehensiveBufferize to take advantage of the new template param.
Paths
| Differential D112052
[ADT] Add Compare template param to EquivalenceClasses ClosedPublic Authored by springerm on Oct 18 2021, 8:55 PM.
Details Summary This makes the class usable with types that do not provide their own operator<. Update MLIR Linalg ComprehensiveBufferize to take advantage of the new template param.
Diff Detail
Unit TestsFailed Event TimelineHerald added subscribers: wenzhicui, wrengr, Chia-hungDuan and 21 others. · View Herald TranscriptOct 18 2021, 8:55 PM Herald added subscribers: llvm-commits, limo1996, stephenneuendorffer, nicolasvasilache. · View Herald Transcript
Comment Actions LGTM. Please double-check that all tests pass before landing, premerge checks report some failures. This revision is now accepted and ready to land.Oct 20 2021, 2:54 AM Closed by commit rG0118a8044f8b: [ADT] Add Compare template param to EquivalenceClasses (authored by springerm). · Explain WhyNov 1 2021, 1:38 AM This revision was automatically updated to reflect the committed changes. Comment Actions Could you add some test coverage for the LLVM change in LLVM (an ADT unit test seems appropriate)? Comment Actions
Ping on this ^ Comment Actions
Sorry, I missed your comment. Test case is here: D113461
Revision Contents
Diff 380576 llvm/include/llvm/ADT/EquivalenceClasses.h
mlir/include/mlir/Dialect/Linalg/Transforms/ComprehensiveBufferize.h
mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp
|
It feels expensive to construct the comparator object on each call to operator<. Caching it in the ECValue isn't really a good option because it will consume a lot of space, even if we only keep a reference to the comparator stored in the EquivalenceClassses. Can't we just pass the template parameter down to std::set, potentially wrapped in some extra class? AFAIK, the set implementation will only keep one copy of the comparator.