This is an archive of the discontinued LLVM Phabricator instance.

[MLIR] Simplify key construction/hashing in StorageUniquer
ClosedPublic

Authored by jloser on Dec 2 2022, 9:21 PM.

Details

Summary

getKey and getHash use mutually exclusive overloads based on existence of
methods to determine how to compute get the key or hash, respectively. This is
a bit verbose with std::enable_if_t. Simplify it a bit by using `if
constexpr` directly. As an added bonus, this is slightly quicker to compile.

Diff Detail

Event Timeline

jloser created this revision.Dec 2 2022, 9:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 2 2022, 9:21 PM
jloser requested review of this revision.Dec 2 2022, 9:21 PM
rriddle accepted this revision.Dec 2 2022, 11:04 PM

woo for C++17

This revision is now accepted and ready to land.Dec 2 2022, 11:04 PM
This revision was automatically updated to reflect the committed changes.