[MLIR] Simplify key construction/hashing in StorageUniquer
authorJoe Loser <joeloser@fastmail.com>
Sat, 3 Dec 2022 05:18:24 +0000 (22:18 -0700)
committerJoe Loser <joeloser@fastmail.com>
Sun, 4 Dec 2022 00:19:46 +0000 (17:19 -0700)
commit4509fb9c007e13b65153e9e797df4fca00ecb241
treeb8d1a927b9043348ac5a658dc304109a47516f54
parent1623aee41a5c7088954b7f8f890ee3a618f0e8c8
[MLIR] Simplify key construction/hashing in StorageUniquer

`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.

Differential Revision: https://reviews.llvm.org/D139245
mlir/include/mlir/Support/StorageUniquer.h