Remove or refactor a few tests under iree/test/e2e/. (#9151)

As part of https://github.com/google/iree/issues/8955 we're looking to move the `iree/test/e2e/` directory to a top level directory (maybe `test`, `tests`, or `integration_tests`). Before that, I wanted to do a bit of cleanup.

* Move `linalg_ext.sort` test from `regression/` to `linalg_ext_ops/`
* Remove `e2e/cpu_specific/dot_exp.mlir`
* Fold `e2e/cuda_specific/dot.mlir` into `e2e/xla_ops/dot.mlir`
* Fold `e2e/xla_ops/partial/` into `e2e/vulkan_specific/`
diff --git a/iree/test/e2e/cpu_specific/BUILD b/iree/test/e2e/cpu_specific/BUILD
deleted file mode 100644
index c66cfaf..0000000
--- a/iree/test/e2e/cpu_specific/BUILD
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-# Tests for end-to-end IREE support specific to the CUDA backend to be able to
-# incrementally enable features.
-
-load("//build_tools/bazel:enforce_glob.bzl", "enforce_glob")
-load("//build_tools/bazel:iree_check_test.bzl", "iree_check_single_backend_test_suite")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-iree_check_single_backend_test_suite(
-    name = "check_dylib-llvm-aot_dylib",
-    srcs = enforce_glob(
-        # keep sorted
-        [
-            "dot_exp.mlir",
-        ],
-        include = ["*.mlir"],
-    ),
-    compiler_flags = [
-        "--iree-input-type=mhlo",
-    ],
-    driver = "dylib",
-    target_backend = "dylib-llvm-aot",
-)
diff --git a/iree/test/e2e/cpu_specific/CMakeLists.txt b/iree/test/e2e/cpu_specific/CMakeLists.txt
deleted file mode 100644
index ebf0c22..0000000
--- a/iree/test/e2e/cpu_specific/CMakeLists.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/test/e2e/cpu_specific/BUILD                                             #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-iree_check_single_backend_test_suite(
-  NAME
-    check_dylib-llvm-aot_dylib
-  SRCS
-    "dot_exp.mlir"
-  TARGET_BACKEND
-    "dylib-llvm-aot"
-  DRIVER
-    "dylib"
-  COMPILER_FLAGS
-    "--iree-input-type=mhlo"
-)
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
diff --git a/iree/test/e2e/cpu_specific/dot_exp.mlir b/iree/test/e2e/cpu_specific/dot_exp.mlir
deleted file mode 100644
index b8cd805..0000000
--- a/iree/test/e2e/cpu_specific/dot_exp.mlir
+++ /dev/null
@@ -1,8 +0,0 @@
-func.func @dot_exp() {
-  %lhs = util.unfoldable_constant dense<1.0> : tensor<384x512xf32>
-  %rhs = util.unfoldable_constant dense<0.0> : tensor<512x128xf32>
-  %0 = "mhlo.dot"(%lhs, %rhs) : (tensor<384x512xf32>, tensor<512x128xf32>) -> tensor<384x128xf32>
-  %1 = "mhlo.exponential"(%0) : (tensor<384x128xf32>) -> tensor<384x128xf32>
-  check.expect_almost_eq_const(%1, dense<1.0> : tensor<384x128xf32>) : tensor<384x128xf32>
-  return
-}
diff --git a/iree/test/e2e/cuda_specific/CMakeLists.txt b/iree/test/e2e/cuda_specific/CMakeLists.txt
deleted file mode 100644
index 78c911f..0000000
--- a/iree/test/e2e/cuda_specific/CMakeLists.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2022 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-# Tests for end-to-end IREE support specific to the CUDA backend to be able to
-# incrementally enable features.
-
-iree_add_all_subdirs()
-
-iree_check_single_backend_test_suite(
-  NAME
-    check_cuda
-  SRCS
-    "dot.mlir"
-  TARGET_BACKEND
-    "cuda"
-  DRIVER
-    "cuda"
-  COMPILER_FLAGS
-    "--iree-input-type=mhlo"
-  LABELS
-    "noasan"
-    "nomsan"
-    "notsan"
-    "noubsan"
-    "requires-gpu-nvidia"
-)
diff --git a/iree/test/e2e/cuda_specific/dot.mlir b/iree/test/e2e/cuda_specific/dot.mlir
deleted file mode 100644
index c26310f..0000000
--- a/iree/test/e2e/cuda_specific/dot.mlir
+++ /dev/null
@@ -1,9 +0,0 @@
-// large aligned case that can be vectorized and goes through fast path of
-// memory promotion and pipelining.
-func.func @large_aligned() {
-  %lhs = util.unfoldable_constant dense<1.0> : tensor<2048x1024xf32>
-  %rhs = util.unfoldable_constant dense<0.4> : tensor<1024x512xf32>
-  %res = "mhlo.dot"(%lhs, %rhs) : (tensor<2048x1024xf32>, tensor<1024x512xf32>) -> tensor<2048x512xf32>
-  check.expect_almost_eq_const(%res, dense<409.596> : tensor<2048x512xf32>) : tensor<2048x512xf32>
-  return
-}
diff --git a/iree/test/e2e/linalg_ext_ops/BUILD b/iree/test/e2e/linalg_ext_ops/BUILD
index 9e893e3..e92d3ab 100644
--- a/iree/test/e2e/linalg_ext_ops/BUILD
+++ b/iree/test/e2e/linalg_ext_ops/BUILD
@@ -20,6 +20,7 @@
         [
             "reverse.mlir",
             "scan.mlir",
+            "sort.mlir",
             "top-k.mlir",
         ],
         include = ["*.mlir"],
@@ -43,6 +44,7 @@
         [
             "reverse.mlir",
             "scan.mlir",
+            "sort.mlir",
             "top-k.mlir",
         ],
         include = ["*.mlir"],
@@ -58,6 +60,7 @@
         [
             "reverse.mlir",
             "scan.mlir",
+            "sort.mlir",
             "top-k.mlir",
         ],
         include = ["*.mlir"],
@@ -74,6 +77,7 @@
             "reverse.mlir",
             # Top-k test disabled due to miscompile on vulkan.
             #    "top-k.mlir",
+            "sort.mlir",
         ],
         include = ["*.mlir"],
         exclude = [
@@ -90,6 +94,7 @@
 test_suite(
     name = "check",
     tests = [
+        ":check_cuda",
         ":check_dylib-llvm-aot_dylib",
         ":check_vmvx_vmvx",
         ":check_vulkan-spirv_vulkan",
diff --git a/iree/test/e2e/linalg_ext_ops/CMakeLists.txt b/iree/test/e2e/linalg_ext_ops/CMakeLists.txt
index 9c74ea6..8672ceb 100644
--- a/iree/test/e2e/linalg_ext_ops/CMakeLists.txt
+++ b/iree/test/e2e/linalg_ext_ops/CMakeLists.txt
@@ -16,6 +16,7 @@
   SRCS
     "reverse.mlir"
     "scan.mlir"
+    "sort.mlir"
     "top-k.mlir"
   TARGET_BACKEND
     "cuda"
@@ -35,6 +36,7 @@
   SRCS
     "reverse.mlir"
     "scan.mlir"
+    "sort.mlir"
     "top-k.mlir"
   TARGET_BACKEND
     "dylib-llvm-aot"
@@ -48,6 +50,7 @@
   SRCS
     "reverse.mlir"
     "scan.mlir"
+    "sort.mlir"
     "top-k.mlir"
   TARGET_BACKEND
     "vmvx"
@@ -60,6 +63,7 @@
     check_vulkan-spirv_vulkan
   SRCS
     "reverse.mlir"
+    "sort.mlir"
   TARGET_BACKEND
     "vulkan-spirv"
   DRIVER
diff --git a/iree/test/e2e/regression/linalg_ext_ops.mlir b/iree/test/e2e/linalg_ext_ops/sort.mlir
similarity index 100%
rename from iree/test/e2e/regression/linalg_ext_ops.mlir
rename to iree/test/e2e/linalg_ext_ops/sort.mlir
diff --git a/iree/test/e2e/regression/BUILD b/iree/test/e2e/regression/BUILD
index bb82ba9..d13a35e 100644
--- a/iree/test/e2e/regression/BUILD
+++ b/iree/test/e2e/regression/BUILD
@@ -28,7 +28,6 @@
     "dynamic_torch_index_select_scalar.mlir",
     "dynamic_torch_index_select_vector.mlir",
     "linalg_ops.mlir",
-    "linalg_ext_ops.mlir",
     "strided_slice.mlir",
 ]
 
diff --git a/iree/test/e2e/regression/CMakeLists.txt b/iree/test/e2e/regression/CMakeLists.txt
index ba70466..f9fdc07 100644
--- a/iree/test/e2e/regression/CMakeLists.txt
+++ b/iree/test/e2e/regression/CMakeLists.txt
@@ -41,7 +41,6 @@
     "dynamic_torch_index_select_negative.mlir"
     "dynamic_torch_index_select_scalar.mlir"
     "dynamic_torch_index_select_vector.mlir"
-    "linalg_ext_ops.mlir"
     "linalg_ops.mlir"
     "lowering_config.mlir"
     "strided_slice.mlir"
@@ -78,7 +77,6 @@
     "dynamic_torch_index_select_negative.mlir"
     "dynamic_torch_index_select_scalar.mlir"
     "dynamic_torch_index_select_vector.mlir"
-    "linalg_ext_ops.mlir"
     "linalg_ops.mlir"
     "strided_slice.mlir"
   TARGET_BACKEND
@@ -101,7 +99,6 @@
     "dynamic_torch_index_select_negative.mlir"
     "dynamic_torch_index_select_scalar.mlir"
     "dynamic_torch_index_select_vector.mlir"
-    "linalg_ext_ops.mlir"
     "linalg_ops.mlir"
     "strided_slice.mlir"
   TARGET_BACKEND
@@ -124,7 +121,6 @@
     "dynamic_torch_index_select_negative.mlir"
     "dynamic_torch_index_select_scalar.mlir"
     "dynamic_torch_index_select_vector.mlir"
-    "linalg_ext_ops.mlir"
     "linalg_ops.mlir"
     "strided_slice.mlir"
   TARGET_BACKEND
diff --git a/iree/test/e2e/vulkan_specific/BUILD b/iree/test/e2e/vulkan_specific/BUILD
index f87a179..2abc086 100644
--- a/iree/test/e2e/vulkan_specific/BUILD
+++ b/iree/test/e2e/vulkan_specific/BUILD
@@ -30,6 +30,8 @@
         ],
         include = ["*.mlir"],
         exclude = [
+            "add_f16.mlir",
+            "dot_f16.mlir",
             "gemm.mlir",
         ],
     ),
@@ -39,6 +41,25 @@
 )
 
 iree_check_single_backend_test_suite(
+    name = "check_vulkan-spirv_vulkan_f16",
+    srcs = [
+        "add_f16.mlir",
+        "dot_f16.mlir",
+    ],
+    compiler_flags = [
+        "--iree-input-type=mhlo",
+        "--iree-vulkan-target-triple=valhall-unknown-android11",
+    ],
+    driver = "vulkan",
+    tags = [
+        "manual",
+        "notap",
+        "vulkan_uses_vk_khr_shader_float16_int8",
+    ],
+    target_backend = "vulkan-spirv",
+)
+
+iree_check_single_backend_test_suite(
     name = "check_vulkan-spirv_vulkan_vectorized_conv",
     srcs = [
         "vectorized_conv.mlir",
diff --git a/iree/test/e2e/vulkan_specific/CMakeLists.txt b/iree/test/e2e/vulkan_specific/CMakeLists.txt
index 61673e2..625b751 100644
--- a/iree/test/e2e/vulkan_specific/CMakeLists.txt
+++ b/iree/test/e2e/vulkan_specific/CMakeLists.txt
@@ -31,6 +31,25 @@
 
 iree_check_single_backend_test_suite(
   NAME
+    check_vulkan-spirv_vulkan_f16
+  SRCS
+    "add_f16.mlir"
+    "dot_f16.mlir"
+  TARGET_BACKEND
+    "vulkan-spirv"
+  DRIVER
+    "vulkan"
+  COMPILER_FLAGS
+    "--iree-input-type=mhlo"
+    "--iree-vulkan-target-triple=valhall-unknown-android11"
+  LABELS
+    "manual"
+    "notap"
+    "vulkan_uses_vk_khr_shader_float16_int8"
+)
+
+iree_check_single_backend_test_suite(
+  NAME
     check_vulkan-spirv_vulkan_vectorized_conv
   SRCS
     "vectorized_conv.mlir"
diff --git a/iree/test/e2e/xla_ops/partial/add_f16.mlir b/iree/test/e2e/vulkan_specific/add_f16.mlir
similarity index 100%
rename from iree/test/e2e/xla_ops/partial/add_f16.mlir
rename to iree/test/e2e/vulkan_specific/add_f16.mlir
diff --git a/iree/test/e2e/xla_ops/partial/dot_f16.mlir b/iree/test/e2e/vulkan_specific/dot_f16.mlir
similarity index 100%
rename from iree/test/e2e/xla_ops/partial/dot_f16.mlir
rename to iree/test/e2e/vulkan_specific/dot_f16.mlir
diff --git a/iree/test/e2e/xla_ops/dot.mlir b/iree/test/e2e/xla_ops/dot.mlir
index 585c8a9..d3979ec 100644
--- a/iree/test/e2e/xla_ops/dot.mlir
+++ b/iree/test/e2e/xla_ops/dot.mlir
@@ -43,7 +43,7 @@
   return
 }
 
-func.func @large() {
+func.func @large_unaligned() {
   %lhs = util.unfoldable_constant dense<1.0> : tensor<250x1024xf32>
   %rhs = util.unfoldable_constant dense<0.4> : tensor<1024x500xf32>
   %res = "mhlo.dot"(%lhs, %rhs) : (tensor<250x1024xf32>, tensor<1024x500xf32>) -> tensor<250x500xf32>
@@ -51,6 +51,14 @@
   return
 }
 
+func.func @large_aligned() {
+  %lhs = util.unfoldable_constant dense<1.0> : tensor<2048x1024xf32>
+  %rhs = util.unfoldable_constant dense<0.4> : tensor<1024x512xf32>
+  %res = "mhlo.dot"(%lhs, %rhs) : (tensor<2048x1024xf32>, tensor<1024x512xf32>) -> tensor<2048x512xf32>
+  check.expect_almost_eq_const(%res, dense<409.596> : tensor<2048x512xf32>) : tensor<2048x512xf32>
+  return
+}
+
 func.func @matvec() {
   %lhs = util.unfoldable_constant dense<1.0> : tensor<250x1024xf32>
   %rhs = util.unfoldable_constant dense<0.5> : tensor<1024xf32>
diff --git a/iree/test/e2e/xla_ops/partial/BUILD b/iree/test/e2e/xla_ops/partial/BUILD
deleted file mode 100644
index 4ad3e5a..0000000
--- a/iree/test/e2e/xla_ops/partial/BUILD
+++ /dev/null
@@ -1,43 +0,0 @@
-# Copyright 2021 The IREE Authors
-#
-# Licensed under the Apache License v2.0 with LLVM Exceptions.
-# See https://llvm.org/LICENSE.txt for license information.
-# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-
-# Tests of end-to-end IREE support for support of specific subsets of ops in the
-# XLA HLO dialect. This is for cases where some variation (e.g. tensor element
-# types) of an op is not supported on all backends. When the test is supported
-# on all backends it should be moved into the corresponding op test in the main
-# xla_ops direcotry. Each test file should have a name matching the
-# corresponding XLA HLO op with a suffix indicating the subset it tests. Only
-# the functionality of that op should be tessted (though it may make use of
-# other ops where necessary). Tests should be written using the IREE Check
-# framework and should always pass on the reference VMVX backend. See
-# https://github.com/google/iree/blob/main/docs/developers/developing_iree/testing_guide.md#iree-core-end-to-end-tests.
-
-load("//build_tools/bazel:iree_check_test.bzl", "iree_check_single_backend_test_suite")
-
-package(
-    default_visibility = ["//visibility:public"],
-    features = ["layering_check"],
-    licenses = ["notice"],  # Apache 2.0
-)
-
-iree_check_single_backend_test_suite(
-    name = "check_vulkan-spirv_vulkan_f16",
-    srcs = [
-        "add_f16.mlir",
-        "dot_f16.mlir",
-    ],
-    compiler_flags = [
-        "--iree-input-type=mhlo",
-        "--iree-vulkan-target-triple=valhall-unknown-android11",
-    ],
-    driver = "vulkan",
-    tags = [
-        "manual",
-        "notap",
-        "vulkan_uses_vk_khr_shader_float16_int8",
-    ],
-    target_backend = "vulkan-spirv",
-)
diff --git a/iree/test/e2e/xla_ops/partial/CMakeLists.txt b/iree/test/e2e/xla_ops/partial/CMakeLists.txt
deleted file mode 100644
index 64158b7..0000000
--- a/iree/test/e2e/xla_ops/partial/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-################################################################################
-# Autogenerated by build_tools/bazel_to_cmake/bazel_to_cmake.py from           #
-# iree/test/e2e/xla_ops/partial/BUILD                                          #
-#                                                                              #
-# Use iree_cmake_extra_content from iree/build_defs.oss.bzl to add arbitrary   #
-# CMake-only content.                                                          #
-#                                                                              #
-# To disable autogeneration for this file entirely, delete this header.        #
-################################################################################
-
-iree_add_all_subdirs()
-
-iree_check_single_backend_test_suite(
-  NAME
-    check_vulkan-spirv_vulkan_f16
-  SRCS
-    "add_f16.mlir"
-    "dot_f16.mlir"
-  TARGET_BACKEND
-    "vulkan-spirv"
-  DRIVER
-    "vulkan"
-  COMPILER_FLAGS
-    "--iree-input-type=mhlo"
-    "--iree-vulkan-target-triple=valhall-unknown-android11"
-  LABELS
-    "manual"
-    "notap"
-    "vulkan_uses_vk_khr_shader_float16_int8"
-)
-
-### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###