Page MenuHomePhabricator

[mlir] Refactor StorageUniquer to require registration of possible storage types
Needs ReviewPublic

Authored by rriddle on Thu, Jun 25, 1:36 PM.

Details

Summary

This allows for bucketing the different possible storage types, with each bucket having its own allocator/mutex/instance map. This greatly reduces the amount of lock contention when multi-threading is enabled. On some non-trivial .mlir modules (>300K operations), this led to a compile time decrease of a single conversion pass by around half a second(>25%).

Depends On D82595

Diff Detail

Event Timeline

rriddle created this revision.Thu, Jun 25, 1:36 PM
Herald added a project: Restricted Project. · View Herald Transcript
jpienaar added inline comments.Sat, Jul 4, 9:38 AM
mlir/lib/Dialect/SDBM/SDBMDialect.cpp
18

Could we keep these sorted?

mlir/lib/Support/StorageUniquer.cpp
19

Mmm, this is one definition of simple, but simple is not very descriptive. KindUniquer ? OneOfKindUniquer ?

Or could go ParametricKindUniquer vs NonparametricKindUniquer as this is about whether the kind's uniquer has additional parameters to consider when uniquering.

Perhaps others would disagree here. This is also a local class ...

95

Can both be used at the same time? Would a given kind be able to use both?