1#ifndef PROTEUS_HASHING_HPP
2#define PROTEUS_HASHING_HPP
8#include <llvm/ADT/ArrayRef.h>
10#if LLVM_VERSION_MAJOR >= 18
11#include <llvm/ADT/StableHashing.h>
13#include <llvm/CodeGen/StableHashing.h>
28 inline std::string
toString()
const {
return std::to_string(Value); }
30 return Value ==
Other.Value;
34 return Value <
Other.Value;
49 StringRef{
reinterpret_cast<const char *
>(&
V),
sizeof(
T)});
54 if (
RC.ArrInfo.NumElts <= 0)
56 std::to_string(
RC.ArrInfo.NumElts));
62 StringRef{
reinterpret_cast<const char *
>(
RC.ArrInfo.Blob.get()),
63 sizeof(
T) *
RC.ArrInfo.NumElts});
67 if (
RC.ObjInfo.Size <= 0)
74 StringRef{
reinterpret_cast<const char *
>(
RC.ObjInfo.Blob.get()),
75 static_cast<size_t>(
RC.ObjInfo.Size)});
82 switch (
RC.ArrInfo.EltType) {
103 StringRef{
reinterpret_cast<const char *
>(&
RC.Value),
sizeof(
RC.Value)});
114 for (
int I = 1,
E =
Arr.size();
I <
E; ++
I)
131 [&HashValue, &
Rest]() {
#define PROTEUS_FATAL_ERROR(x)
Definition Error.h:7
#define TIMESCOPE(x)
Definition TimeTracing.hpp:64
Definition Hashing.hpp:20
std::string toString() const
Definition Hashing.hpp:28
bool operator==(const HashT &Other) const
Definition Hashing.hpp:29
stable_hash getValue() const
Definition Hashing.hpp:27
HashT(StringRef S)
Definition Hashing.hpp:26
bool operator<(const HashT &Other) const
Definition Hashing.hpp:33
HashT(const stable_hash HashValue)
Definition Hashing.hpp:25
Definition BuiltinsCUDA.cpp:4
@ ARRAY
Definition CompilerInterfaceTypes.h:33
@ VECTOR
Definition CompilerInterfaceTypes.h:32
@ INT32
Definition CompilerInterfaceTypes.h:25
@ INT64
Definition CompilerInterfaceTypes.h:26
@ FLOAT
Definition CompilerInterfaceTypes.h:27
@ STATIC_ARRAY
Definition CompilerInterfaceTypes.h:31
@ INT8
Definition CompilerInterfaceTypes.h:24
@ BOOL
Definition CompilerInterfaceTypes.h:23
@ OBJECT
Definition CompilerInterfaceTypes.h:34
@ DOUBLE
Definition CompilerInterfaceTypes.h:28
HashT hash(FirstT &&First, RestTs &&...Rest)
Definition Hashing.hpp:126
T getValue(const RuntimeConstant &RC)
Definition RuntimeConstantTypeHelpers.h:95
T getRuntimeConstantValue(void *Arg)
Definition CompilerInterfaceRuntimeConstantInfo.h:114
HashT hashValue(HashT &H)
Definition Hashing.hpp:38
HashT hashArrayRefElement(const RuntimeConstant &RC)
Definition Hashing.hpp:78
HashT hashCombine(HashT A, HashT B)
Definition Hashing.hpp:121
std::string toString(CodegenOption Option)
Definition Config.hpp:26
HashT hashRuntimeConstantObject(const RuntimeConstant &RC)
Definition Hashing.hpp:66
bool isScalarRuntimeConstantType(RuntimeConstantType RCType)
Definition RuntimeConstantTypeHelpers.h:148
HashT hashRuntimeConstantArray(const RuntimeConstant &RC)
Definition Hashing.hpp:53
Definition Hashing.hpp:147
Definition CompilerInterfaceTypes.h:72
std::size_t operator()(const proteus::HashT &Key) const
Definition Hashing.hpp:149