Opt compiler: Basic simplification for arithmetic operations.
The optimisations in this patch do not look further than the
inputs of each operation.
Change-Id: Iddd0ab6b360b9e7bb042db22086d51a31be85530
diff --git a/runtime/utils.h b/runtime/utils.h
index d294f4b..7a96672 100644
--- a/runtime/utils.h
+++ b/runtime/utils.h
@@ -271,6 +271,12 @@
}
template<typename T>
+static inline int WhichPowerOf2(T x) {
+ DCHECK((x != 0) && IsPowerOfTwo(x));
+ return CTZ(x);
+}
+
+template<typename T>
static constexpr int POPCOUNT(T x) {
return (sizeof(T) == sizeof(uint32_t))
? __builtin_popcount(x)