Drop absl flat_hash_set and some unused includes. (#5346)
Progress on https://github.com/google/iree/issues/3848
diff --git a/build_tools/embed_data/BUILD b/build_tools/embed_data/BUILD
index 57cf2a2..37097f6 100644
--- a/build_tools/embed_data/BUILD
+++ b/build_tools/embed_data/BUILD
@@ -29,7 +29,6 @@
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
"@com_google_absl//absl/strings",
- "@com_google_absl//absl/time",
],
)
diff --git a/build_tools/embed_data/CMakeLists.txt b/build_tools/embed_data/CMakeLists.txt
index 48f566d..7f28f75 100644
--- a/build_tools/embed_data/CMakeLists.txt
+++ b/build_tools/embed_data/CMakeLists.txt
@@ -21,7 +21,6 @@
absl::flags
absl::flags_parse
absl::strings
- absl::time
)
install(TARGETS generate_cc_embed_data
COMPONENT generate_cc_embed_data
diff --git a/build_tools/embed_data/generate_cc_embed_data_main.cc b/build_tools/embed_data/generate_cc_embed_data_main.cc
index fed4f13..0ded0e6 100644
--- a/build_tools/embed_data/generate_cc_embed_data_main.cc
+++ b/build_tools/embed_data/generate_cc_embed_data_main.cc
@@ -21,7 +21,6 @@
#include "absl/strings/escaping.h"
#include "absl/strings/str_split.h"
#include "absl/strings/strip.h"
-#include "absl/time/time.h"
ABSL_FLAG(std::string, identifier, "resources",
"name of the resources function");
diff --git a/iree/hal/buffer_view.cc b/iree/hal/buffer_view.cc
index 501cffe..7ee1081 100644
--- a/iree/hal/buffer_view.cc
+++ b/iree/hal/buffer_view.cc
@@ -20,7 +20,6 @@
#include <vector>
#include "absl/strings/ascii.h"
-#include "absl/strings/match.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_join.h"
#include "absl/strings/str_split.h"
diff --git a/iree/modules/vmla/BUILD b/iree/modules/vmla/BUILD
index b5adc58..98bf100 100644
--- a/iree/modules/vmla/BUILD
+++ b/iree/modules/vmla/BUILD
@@ -41,7 +41,6 @@
"//iree/base:status",
"//iree/base:tracing",
"@com_google_absl//absl/algorithm",
- "@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/types:span",
"@com_google_ruy//ruy",
"@com_google_ruy//ruy:context",
diff --git a/iree/modules/vmla/CMakeLists.txt b/iree/modules/vmla/CMakeLists.txt
index 0528095..0fffe1c 100644
--- a/iree/modules/vmla/CMakeLists.txt
+++ b/iree/modules/vmla/CMakeLists.txt
@@ -25,7 +25,6 @@
"op_kernels_ruy.h"
DEPS
absl::algorithm
- absl::flat_hash_set
absl::span
iree::base::status
iree::base::tracing
diff --git a/iree/modules/vmla/op_kernels_generic.h b/iree/modules/vmla/op_kernels_generic.h
index 203f23d..cb5e22a 100644
--- a/iree/modules/vmla/op_kernels_generic.h
+++ b/iree/modules/vmla/op_kernels_generic.h
@@ -16,13 +16,14 @@
#define IREE_MODULES_VMLA_OP_KERNELS_GENERIC_H_
#include <algorithm>
+#include <array>
#include <cmath>
#include <iostream>
#include <iterator>
#include <numeric>
+#include <unordered_set>
#include <vector>
-#include "absl/container/flat_hash_set.h"
#include "absl/types/span.h"
#include "iree/base/status.h"
@@ -542,14 +543,14 @@
strides[dim_i] = stride;
stride *= src_shape[dim_i];
}
- absl::flat_hash_set<int32_t> dims_set(dimensions.begin(), dimensions.end());
+ std::unordered_set<int32_t> dims_set(dimensions.begin(), dimensions.end());
for (size_t dst_i = 0; dst_i < dst_buffer.size(); ++dst_i) {
size_t src_i = 0;
size_t t = dst_i;
for (int dim_i = 0; dim_i < rank; ++dim_i) {
size_t ratio = t / strides[dim_i];
t -= ratio * strides[dim_i];
- bool do_reverse = dims_set.contains(dim_i);
+ bool do_reverse = dims_set.count(dim_i) > 0;
src_i += (do_reverse ? (src_shape[dim_i] - 1 - ratio) : ratio) *
strides[dim_i];
}