summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-08-17 09:46:19 -0700
committerTim Foley <tfoley@nvidia.com>2017-08-17 11:22:22 -0700
commit5de3003af561bad33680940ab1809622c428e94b (patch)
treeceb6f8b5f4d3c7e941f4edd47984b426d03fb980 /source/core
parent5230ad2edb28e176d0d7d2a9873ffb8f65285269 (diff)
IR generation cleanup work
- Make all instructions store their argument count for now, so we can iterate over them easily. - Longer term we might try to optimize for space because the common case is that the operand count is known, but keeping it simpler seems better for now - Split apart the creation of an instruction from adding it to a parent - Use the above capability to make sure that we add a function to its parent *after* all the parameter/result type emission has occured. - Perform simple value numbering for types during IR creation - This logic also tries to pick a good parent for any type instructions, so that types don't get created local to a function unless they really need to - Create all constants at global scope, and re-use when values are identical
Diffstat (limited to 'source/core')
-rw-r--r--source/core/hash.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/core/hash.h b/source/core/hash.h
index 07a14099b..dd2086305 100644
--- a/source/core/hash.h
+++ b/source/core/hash.h
@@ -95,7 +95,10 @@ namespace Slang
return PointerHash<std::is_pointer<TKey>::value>::GetHashCode(key);
}
-
+ inline int combineHash(int left, int right)
+ {
+ return (left * 16777619) ^ right;
+ }
}
#endif \ No newline at end of file