This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Optimize OperationName construction and usage
ClosedPublic

Authored by rriddle on Jan 12 2022, 11:48 PM.

Details

Summary

When constructing an OperationName, the overwhelming majority of
cases are from registered operations. This revision adds a non-locked
lookup into the currently registered operations, which prevents locking
in the common case. This revision also optimizes several uses of
RegisteredOperationName that expect the operation to be registered,
e.g. such as in OpBuilder.

These changes provides a reasonable speedup (5-10%) in some
compilations, especially on platforms where locking is expensive.

Diff Detail

Event Timeline

rriddle created this revision.Jan 12 2022, 11:48 PM
rriddle requested review of this revision.Jan 12 2022, 11:48 PM
lattner accepted this revision.Jan 13 2022, 11:06 AM

This is really great, nice approach to use the registered op information, I didn't realize we had that!

This revision is now accepted and ready to land.Jan 13 2022, 11:06 AM
mehdi_amini accepted this revision.Jan 13 2022, 12:35 PM
This revision was automatically updated to reflect the committed changes.