Drop unused functions, but do not drop `-Wno-unused-function` (#15502)

This is take two on #15471, now skips straight to the dessert, no
veggies for @benvanik .
diff --git a/compiler/src/iree/compiler/Codegen/Common/BufferizationAnalysis.cpp b/compiler/src/iree/compiler/Codegen/Common/BufferizationAnalysis.cpp
index baa7825..9eebf12 100644
--- a/compiler/src/iree/compiler/Codegen/Common/BufferizationAnalysis.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/BufferizationAnalysis.cpp
@@ -460,42 +460,6 @@
   }
 }
 
-/// Ties together operands for operand fusion as exists today by reusing buffer
-/// for the result for one of the inputs to do in-place update. Ideally we dont
-/// need to do this if the fusion just happens at vector level. To be removed
-/// when that is worked out and can be load-bearing. Conditions checked here are
-/// 1) the result does not use the value of the `outs` buffer.
-/// 2) the input has a single use (this op) and has the same indexing map as the
-///    result.
-/// 3) the input equivalence set does not have an interface binding, i.e. it is
-///    not using a buffer from the dispatch ABI.
-static void tieOperandsForOperandFusion(linalg::LinalgOp linalgOp,
-                                        BufferizationPlan &plan) {
-  for (auto [index, result] : llvm::enumerate(linalgOp.getDpsInitsMutable())) {
-    if (linalgOp.payloadUsesValueFromOperand(&result)) {
-      continue;
-    }
-    for (OpOperand *input : linalgOp.getDpsInputOperands()) {
-      auto tensorType =
-          llvm::dyn_cast<RankedTensorType>(input->get().getType());
-      if (!tensorType)
-        continue;
-      Type inputElementType = tensorType.getElementType();
-      Type resultElementType =
-          llvm::cast<RankedTensorType>(result.get().getType()).getElementType();
-      if (input->get().hasOneUse() && (inputElementType == resultElementType) &&
-          linalgOp.getMatchingIndexingMap(input) ==
-              linalgOp.getMatchingIndexingMap(&result) &&
-          !getEquivalentOpOfType<IREE::HAL::InterfaceBindingSubspanOp>(
-              input->get(), plan) &&
-          !isFromReadOnlyTensor(input->get(), plan)) {
-        plan.unionSets(linalgOp->getResult(index), input->get());
-        break;
-      }
-    }
-  }
-}
-
 void BufferizationPlan::unionSets(Value v1, Value v2) {
   if (!canSetsBeMerged(v1, v2, *this)) {
     return;
diff --git a/compiler/src/iree/compiler/Codegen/Common/FlattenMemRefSubspanPass.cpp b/compiler/src/iree/compiler/Codegen/Common/FlattenMemRefSubspanPass.cpp
index 0fd4129..94b5198 100644
--- a/compiler/src/iree/compiler/Codegen/Common/FlattenMemRefSubspanPass.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/FlattenMemRefSubspanPass.cpp
@@ -705,23 +705,6 @@
   };
 };
 
-/// Returns the number of bytes of the given `type`. Returns std::nullopt if
-/// cannot deduce.
-///
-/// Note that this should be kept consistent with how the byte offset was
-/// calculated in the subspan ops!
-std::optional<int64_t> getNumBytes(Type type) {
-  if (type.isIntOrFloat())
-    return IREE::Util::getRoundedElementByteWidth(type);
-  if (auto vectorType = llvm::dyn_cast<VectorType>(type)) {
-    auto elementBytes = getNumBytes(vectorType.getElementType());
-    if (!elementBytes)
-      return std::nullopt;
-    return elementBytes.value() * vectorType.getNumElements();
-  }
-  return std::nullopt;
-}
-
 /// Erase alignment hints.
 struct RemoveAssumeAlignOp
     : public OpRewritePattern<memref::AssumeAlignmentOp> {
diff --git a/compiler/src/iree/compiler/Codegen/Common/FoldAffineMinInDistributedLoops.cpp b/compiler/src/iree/compiler/Codegen/Common/FoldAffineMinInDistributedLoops.cpp
index ce744b4..1aeca7a 100644
--- a/compiler/src/iree/compiler/Codegen/Common/FoldAffineMinInDistributedLoops.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/FoldAffineMinInDistributedLoops.cpp
@@ -36,16 +36,6 @@
 namespace mlir {
 namespace iree_compiler {
 
-/// Gets the given `attrOrValue` as a Value by creating constant ops for
-/// attributes.
-static Value getAsValue(OpFoldResult attrOrValue, OpBuilder &builder,
-                        Location loc) {
-  if (Value val = attrOrValue.dyn_cast<Value>())
-    return val;
-  auto attr = llvm::cast<IntegerAttr>(attrOrValue.get<Attribute>());
-  return builder.create<arith::ConstantIndexOp>(loc, attr.getInt());
-}
-
 #ifndef NDEBUG
 inline raw_ostream &operator<<(raw_ostream &os,
                                const LoopTilingAndDistributionInfo &info) {
diff --git a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUTensorAlloc.cpp b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUTensorAlloc.cpp
index ea243ff..a7d2eb8 100644
--- a/compiler/src/iree/compiler/Codegen/Common/GPU/GPUTensorAlloc.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/GPU/GPUTensorAlloc.cpp
@@ -80,20 +80,6 @@
   return opInfo.isTranspose();
 }
 
-/// Returns true if the index map represents a transpose that benefits from
-/// shared mem.
-static bool isSharedMemTranspose(AffineMap indexMap) {
-  if (!indexMap.isEmpty() && indexMap.isPermutation()) {
-    // Ensure that the fasted moving dimension (the last one) is permuted,
-    // Otherwise shared memory promotion will not benefit the operation.
-    if (indexMap.getDimPosition(indexMap.getNumDims() - 1) !=
-        indexMap.getNumDims() - 1) {
-      return true;
-    }
-  }
-  return false;
-}
-
 namespace {
 /// Swaps bufferization.alloc_tensor with the copied linalg op result when the
 /// linalg op does not use the output initial value during calculation.
diff --git a/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp b/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp
index a50130c..0102590 100644
--- a/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/GenericVectorization.cpp
@@ -25,49 +25,6 @@
 namespace iree_compiler {
 namespace {
 
-/// Returns the op that contains lowering config. Checks whether the provided op
-/// contains the lowering config and returns it. Otherwise, tries to find the
-/// lowering config across the function. If there are multiple ops with the same
-/// lowering configs, returns the first one found. Returns failure if there are
-/// multiple op with different lowering config.
-static FailureOr<Operation *> getRootOp(Operation *op) {
-  // Check for self first.
-  if (iree_compiler::getLoweringConfig(op)) {
-    return op;
-  }
-
-  // Get the function op.
-  auto funcOp = dyn_cast<func::FuncOp>(op);
-  if (!funcOp) {
-    funcOp = op->getParentOfType<func::FuncOp>();
-  }
-
-  assert(funcOp && "Missing funcOp");
-
-  Operation *rootOp = nullptr;
-  mlir::iree_compiler::IREE::Codegen::LoweringConfigAttr rootLoweringConfig;
-  auto result = funcOp.walk([&](Operation *op) -> WalkResult {
-    auto loweringConfig = iree_compiler::getLoweringConfig(op);
-    if (!loweringConfig) {
-      return WalkResult::advance();
-    }
-    if (rootLoweringConfig) {
-      if (rootLoweringConfig != loweringConfig) {
-        return WalkResult::interrupt();
-      }
-    } else {
-      rootOp = op;
-      rootLoweringConfig = loweringConfig;
-    }
-    return WalkResult::advance();
-  });
-
-  if (!rootOp || result.wasInterrupted()) {
-    return failure();
-  }
-  return rootOp;
-}
-
 /// Tries to infer the vector sizes from an IR using ValueBounds analysis.
 /// Returns failure if vector sizes can't be inferred.
 static FailureOr<SmallVector<int64_t>>
diff --git a/compiler/src/iree/compiler/Codegen/Common/IREEComprehensiveBufferizePass.cpp b/compiler/src/iree/compiler/Codegen/Common/IREEComprehensiveBufferizePass.cpp
index 6a97ab0..e934114 100644
--- a/compiler/src/iree/compiler/Codegen/Common/IREEComprehensiveBufferizePass.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/IREEComprehensiveBufferizePass.cpp
@@ -92,8 +92,6 @@
 };
 } // namespace
 
-static bool isaTensor(Type t) { return llvm::isa<TensorType>(t); };
-
 // Default allocation functions.
 static FailureOr<Value> defaultAllocationFn(OpBuilder &builder, Location loc,
                                             MemRefType allocationType,
diff --git a/compiler/src/iree/compiler/Codegen/Common/RemoveTrivialLoops.cpp b/compiler/src/iree/compiler/Codegen/Common/RemoveTrivialLoops.cpp
index 1f4ac2d..7a673d5 100644
--- a/compiler/src/iree/compiler/Codegen/Common/RemoveTrivialLoops.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/RemoveTrivialLoops.cpp
@@ -91,18 +91,6 @@
   return std::nullopt;
 }
 
-/// Return true if the given tiled loop is distributed to workgroups.
-static bool isWorkgroupLoop(const LoopTilingAndDistributionInfo &info) {
-  auto forOp = cast<scf::ForOp>(info.loop);
-  Operation *lbOp = forOp.getLowerBound().getDefiningOp();
-  if (isa<IREE::HAL::InterfaceWorkgroupIDOp>(lbOp))
-    return true;
-  auto applyOp = dyn_cast<affine::AffineApplyOp>(lbOp);
-  return applyOp && llvm::any_of(applyOp.getMapOperands(), [](Value operand) {
-           return operand.getDefiningOp<IREE::HAL::InterfaceWorkgroupIDOp>();
-         });
-}
-
 static LogicalResult removeOneTripTiledLoops(func::FuncOp funcOp,
                                              ArrayRef<int64_t> workgroupSize,
                                              ArrayRef<int64_t> numWorkgroups) {
diff --git a/compiler/src/iree/compiler/Codegen/Common/TileAndDistributeToWorkgroupsPass.cpp b/compiler/src/iree/compiler/Codegen/Common/TileAndDistributeToWorkgroupsPass.cpp
index e4ddea0..9bd2f4d 100644
--- a/compiler/src/iree/compiler/Codegen/Common/TileAndDistributeToWorkgroupsPass.cpp
+++ b/compiler/src/iree/compiler/Codegen/Common/TileAndDistributeToWorkgroupsPass.cpp
@@ -120,26 +120,6 @@
   return success();
 }
 
-/// Get the materialization information from a `tensor.pack` operation.
-static FailureOr<IREE::LinalgExt::MaterializeEncodingInfo>
-getMaterializationInfo(tensor::PackOp packOp) {
-  IREE::LinalgExt::MaterializeEncodingInfo encodingInfo;
-  SmallVector<OpFoldResult> mixedTileSizes = packOp.getMixedTiles();
-  encodingInfo.innerTileSizes.reserve(mixedTileSizes.size());
-  for (auto tileSize : mixedTileSizes) {
-    if (tileSize.is<Value>()) {
-      encodingInfo.innerTileSizes.push_back(ShapedType::kDynamic);
-    } else {
-      encodingInfo.innerTileSizes.push_back(
-          llvm::cast<IntegerAttr>(tileSize.get<Attribute>()).getInt());
-    }
-  }
-  encodingInfo.innerDimsPos = llvm::to_vector(packOp.getInnerDimsPos());
-  encodingInfo.outerDimsPerm = llvm::to_vector(packOp.getOuterDimsPerm());
-  encodingInfo.srcRank = packOp.getSourceRank();
-  return encodingInfo;
-}
-
 //===---------------------------------------------------------------------===//
 // Patterns to lower operations that are used to compute the number of
 // workgroups.
diff --git a/compiler/src/iree/compiler/Codegen/Interfaces/PartitionableLoopsInterface.cpp b/compiler/src/iree/compiler/Codegen/Interfaces/PartitionableLoopsInterface.cpp
index 77724bf..56e54af 100644
--- a/compiler/src/iree/compiler/Codegen/Interfaces/PartitionableLoopsInterface.cpp
+++ b/compiler/src/iree/compiler/Codegen/Interfaces/PartitionableLoopsInterface.cpp
@@ -51,14 +51,6 @@
   return parallelLoops;
 }
 
-static llvm::SmallVector<utils::IteratorType>
-getIteratorTypesFromAttr(ArrayAttr iteratorTypesAttr) {
-  return llvm::map_to_vector(iteratorTypesAttr, [](Attribute attr) {
-    return utils::symbolizeIteratorType(llvm::cast<StringAttr>(attr).getValue())
-        .value();
-  });
-}
-
 /// External model implementation for all LinalgOps.
 template <typename OpTy>
 struct LinalgOpPartitionableLoops
diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp
index c3b8d2c..220f04e 100644
--- a/compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp
+++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp
@@ -681,25 +681,6 @@
                                                passPipeline, workgroupSize);
 }
 
-/// Return the size of the given dimension in the linalg op.
-// TODO: this should be part of LinalgOp interface, the equivalent member
-// function currently only support the case where all the dimensions are static
-// while we want to support dynamic shapes.
-static std::optional<int64_t> getLinalgDimSize(linalg::LinalgOp op, int64_t d) {
-  for (auto [mapIdx, map] : llvm::enumerate(op.getIndexingMapsArray())) {
-    for (auto [dimIdx, dim] : llvm::enumerate(map.getResults())) {
-      auto expr = dim.dyn_cast<AffineDimExpr>();
-      if (expr && expr.getPosition() == d) {
-        auto type = llvm::cast<ShapedType>(op->getOperand(mapIdx).getType());
-        if (type.isDynamicDim(dimIdx))
-          return std::nullopt;
-        return type.getDimSize(dimIdx);
-      }
-    }
-  }
-  return std::nullopt;
-}
-
 /// Set configuration for transform dialect based strategies.
 static LogicalResult setTransformDialectConfig(func::FuncOp entryPoint,
                                                Operation *op,
diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/LLVMGPULayoutAnalysisAndDistribution.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/LLVMGPULayoutAnalysisAndDistribution.cpp
index 6320d45..058def0 100644
--- a/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/LLVMGPULayoutAnalysisAndDistribution.cpp
+++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/Utils/LLVMGPULayoutAnalysisAndDistribution.cpp
@@ -756,15 +756,6 @@
   return count == 1;
 }
 
-static int getVecSizes(std::array<int, 4> &order, const Layout &layout) {
-  int size = 1;
-  for (int i = 0; i < 4; i++) {
-    if (isVectorId(i))
-      size *= layout.shape[i];
-  }
-  return size;
-}
-
 using bodyType = std::function<void(std::array<int, DimType::NumDims> &)>;
 
 /// This function iterates over the dimensions of a given column/row order
diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/CPU/Common.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/CPU/Common.cpp
index 2bd0a9a..d90454b 100644
--- a/compiler/src/iree/compiler/Codegen/TransformStrategies/CPU/Common.cpp
+++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/CPU/Common.cpp
@@ -138,23 +138,6 @@
 // user-friendliness.
 //===----------------------------------------------------------------------===//
 
-/// Placeholder to encode fixed reductions that should take finer-grained
-/// precedence over other heuristics. In the future, this could be lifted to
-/// e.g. `cpuModel` or higher up in some transform dialect database summary of
-/// "known good things".
-static FailureOr<ReductionConfig> applyKnownGoodReductionConfigurations(
-    const transform_ext::MatchedReductionCaptures &captures,
-    const CPUModel &cpuModel) {
-  int64_t reductionSize = captures.reductionOpSizes.back();
-  if (cpuModel.model == CPUModel::kDefaultCPU) {
-    if (captures.reductionOutputElementalTypeBitWidth == 32) {
-      if (reductionSize == 32)
-        return ReductionConfig{/*vectorSize=*/32};
-    }
-  }
-  return failure();
-}
-
 static ReductionConfig
 getReductionConfig(const transform_ext::MatchedReductionCaptures &captures,
                    const CPUModel &cpuModel) {
diff --git a/compiler/src/iree/compiler/Codegen/TransformStrategies/Common/Common.cpp b/compiler/src/iree/compiler/Codegen/TransformStrategies/Common/Common.cpp
index 080601b..4203118 100644
--- a/compiler/src/iree/compiler/Codegen/TransformStrategies/Common/Common.cpp
+++ b/compiler/src/iree/compiler/Codegen/TransformStrategies/Common/Common.cpp
@@ -390,41 +390,6 @@
 };
 } // namespace
 
-/// Builds transform IR requesting to bubble up the "expand_shape" operation
-/// produced as parent of reduction splitting if necessary for fusion of the
-/// leading elementwise operation.
-// TODO: consider passing a problem-specific struct to control information.
-static ReductionSplitResult
-createBubbleExpand(ImplicitLocOpBuilder &b, Value variantH,
-                   SplitReductionOp splitReductionTransformOp,
-                   bool hasLeadingEltwise, bool hasTrailingEltwise) {
-  ReductionSplitResult result;
-  if (!hasLeadingEltwise) {
-    result.splitFillH = splitReductionTransformOp.getFillOp();
-    result.splitLinalgH = splitReductionTransformOp.getSplitLinalgOp();
-    result.combinerH = splitReductionTransformOp.getCombiningLinalgOp();
-    return result;
-  }
-
-  auto funcH = b.create<MatchOp>(variantH, func::FuncOp::getOperationName());
-  b.create<transform::ApplyPatternsOp>(funcH, [](OpBuilder &b, Location loc) {
-    b.create<
-        iree_compiler::IREE::transform_dialect::ApplyBubbleExpandPatternsOp>(
-        loc);
-  });
-  std::tie(result.originalFillH, result.splitFillH) =
-      matchAndUnpack<2>(b, variantH, linalg::FillOp::getOperationName());
-  if (hasTrailingEltwise) {
-    std::tie(result.leadingEltwiseH, result.splitLinalgH, result.combinerH,
-             result.trailingEltwiseH) =
-        matchAndUnpack<4>(b, variantH, linalg::GenericOp::getOperationName());
-  } else {
-    std::tie(result.leadingEltwiseH, result.splitLinalgH, result.combinerH) =
-        matchAndUnpack<3>(b, variantH, linalg::GenericOp::getOperationName());
-  }
-  return result;
-}
-
 /// Build transform IR to split the reduction into a parallel and combiner part.
 /// Then tile the parallel part and map it to `tileSize` threads, each reducing
 /// on `vectorSize` elements.
diff --git a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp
index 9a2dcd2..d79e9a4 100644
--- a/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp
+++ b/compiler/src/iree/compiler/Dialect/Flow/IR/FlowOpFolders.cpp
@@ -132,23 +132,6 @@
   }
 };
 
-// Turns a tensor type that may have one or more dynamic dimensions into a
-// static type with dynamic dimensions replaced with 0.
-// Example: tensor<?x0x1xf32> -> tensor<0x0x1xf32>
-static Type makeZeroElementsStaticTensorType(Type type) {
-  auto tensorType = llvm::cast<RankedTensorType>(type);
-  if (tensorType.hasStaticShape())
-    return type;
-  SmallVector<int64_t> dims;
-  dims.resize(tensorType.getRank());
-  for (int64_t i = 0; i < tensorType.getRank(); ++i) {
-    int64_t dim = tensorType.getDimSize(i);
-    dims[i] = dim == ShapedType::kDynamic ? 0 : dim;
-  }
-  return RankedTensorType::get(dims, tensorType.getElementType(),
-                               tensorType.getEncoding());
-}
-
 // Returns a new set of dynamic dimensions for a shape carrying op when a type
 // is being changed. This attempts to reuse the existing dimension values if
 // they are available and will drop/insert new ones as required.
diff --git a/compiler/src/iree/compiler/Dialect/Flow/Transforms/FormDispatchRegions.cpp b/compiler/src/iree/compiler/Dialect/Flow/Transforms/FormDispatchRegions.cpp
index ea00c12..cdbbe08 100644
--- a/compiler/src/iree/compiler/Dialect/Flow/Transforms/FormDispatchRegions.cpp
+++ b/compiler/src/iree/compiler/Dialect/Flow/Transforms/FormDispatchRegions.cpp
@@ -158,15 +158,6 @@
   fusionGroups.append(newGroups.begin(), newGroups.end());
   op->setAttr(kFusionGroupsAttr, Builder(op).getI64ArrayAttr(fusionGroups));
 }
-/// Returns true if the given `op` is in the `targetGroup` fusion group.
-static bool isInFusionGroup(Operation *op, unsigned targetGroup) {
-  if (ArrayAttr opGroupAttr = op->getAttrOfType<ArrayAttr>(kFusionGroupsAttr)) {
-    return llvm::any_of(opGroupAttr, [&targetGroup](Attribute attr) {
-      return llvm::cast<IntegerAttr>(attr).getInt() == targetGroup;
-    });
-  }
-  return false;
-}
 /// Removes the fusion groups attribute.
 static void removeFusionGroupsAttribute(Operation *op) {
   op->removeAttr(kFusionGroupsAttr);
diff --git a/compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.cpp b/compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.cpp
index 018cc77..77c2125 100644
--- a/compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.cpp
+++ b/compiler/src/iree/compiler/Dialect/HAL/IR/HALOps.cpp
@@ -195,66 +195,6 @@
 }
 
 //===----------------------------------------------------------------------===//
-// custom<ConditionalTargetRegions>($targets, $objects, $target_regions)
-//===----------------------------------------------------------------------===//
-
-static ParseResult parseConditionalTargetRegions(
-    OpAsmParser &parser, ArrayAttr &targetsAttr, ArrayAttr &objectsAttr,
-    SmallVectorImpl<std::unique_ptr<Region>> &targetRegions) {
-  auto builder = parser.getBuilder();
-  SmallVector<Attribute> targetAttrs;
-  SmallVector<Attribute> objectsAttrs;
-  do {
-    IREE::HAL::ExecutableTargetAttr targetAttr;
-    if (failed(parser.parseAttribute(targetAttr)))
-      return failure();
-    targetAttrs.push_back(targetAttr);
-    std::unique_ptr<Region> targetRegion = std::make_unique<Region>();
-    if (succeeded(parser.parseOptionalKeyword("if"))) {
-      if (failed(parseTargetConditionRegion(parser, *targetRegion)))
-        return failure();
-    }
-    targetRegions.emplace_back(std::move(targetRegion));
-    if (failed(parser.parseEqual()))
-      return failure();
-    ArrayAttr targetObjectsAttr;
-    if (failed(parser.parseAttribute(targetObjectsAttr)))
-      return failure();
-    objectsAttrs.push_back(targetObjectsAttr);
-  } while (succeeded(parser.parseOptionalComma()));
-  targetsAttr = builder.getArrayAttr(targetAttrs);
-  objectsAttr = builder.getArrayAttr(objectsAttrs);
-  return success();
-}
-
-static void
-printConditionalTargetRegions(OpAsmPrinter &p, Operation *op,
-                              ArrayAttr targetsAttr, ArrayAttr objectsAttr,
-                              MutableArrayRef<Region> targetRegions) {
-  p.increaseIndent();
-  p.printNewline();
-  llvm::interleave(
-      llvm::zip_equal(targetsAttr.getAsRange<IREE::HAL::ExecutableTargetAttr>(),
-                      objectsAttr.getAsRange<ArrayAttr>(), targetRegions),
-      [&](auto it) {
-        auto [targetAttr, targetObjectsAttr, targetRegion] = it;
-        p.printAttribute(targetAttr);
-        if (!targetRegion.empty()) {
-          p << " if";
-          printTargetConditionRegion(p, op, targetRegion);
-        }
-        p << " = ";
-        p.printAttribute(targetObjectsAttr);
-      },
-      [&]() {
-        p << ",";
-        p.printNewline();
-      });
-  p.decreaseIndent();
-  p.printNewline();
-}
-
-//===----------------------------------------------------------------------===//
 // custom<WorkgroupCountRegion>($body)
 //===----------------------------------------------------------------------===//
 
diff --git a/compiler/src/iree/compiler/Dialect/Stream/Analysis/ResourceHazards.cpp b/compiler/src/iree/compiler/Dialect/Stream/Analysis/ResourceHazards.cpp
index 4a3383e..84776af 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/Analysis/ResourceHazards.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/Analysis/ResourceHazards.cpp
@@ -33,22 +33,9 @@
 
 // TODO(#6972): move to StreamTypes.h.
 
-static bool doesRead(ResourceAccessBitfield access) {
-  return bitEnumContainsAny(access, ResourceAccessBitfield::Read);
-}
-static bool doesWrite(ResourceAccessBitfield access) {
-  return bitEnumContainsAny(access, ResourceAccessBitfield::Write);
-}
 static bool isReadOnly(ResourceAccessBitfield access) {
   return access == ResourceAccessBitfield::Read;
 }
-static bool isWriteOnly(ResourceAccessBitfield access) {
-  return access == ResourceAccessBitfield::Write;
-}
-static bool isReadWrite(ResourceAccessBitfield access) {
-  return bitEnumContainsAny(access, ResourceAccessBitfield::Read |
-                                        ResourceAccessBitfield::Write);
-}
 
 static bool doesRangeOverlap(AsyncAccessRange &lhs, AsyncAccessRange &rhs) {
   if (lhs.resource != rhs.resource)
diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
index a2a46ac..09b6847 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
@@ -81,25 +81,6 @@
 }
 
 // Verifies that |dynamicDims| contains the appropriate number of dims for all
-// of the dynamic dimensions in |values|.
-static LogicalResult verifyOpDynamicDims(Operation *op, ValueRange values,
-                                         ValueRange dynamicDims) {
-  unsigned requiredCount = 0;
-  for (auto value : values) {
-    if (auto shapedType = llvm::dyn_cast<ShapedType>(value.getType())) {
-      requiredCount += shapedType.getNumDynamicDims();
-    }
-  }
-  if (dynamicDims.size() != requiredCount) {
-    return op->emitOpError()
-           << "value set has " << requiredCount
-           << " dynamic dimensions but only " << dynamicDims.size()
-           << " dimension values are attached";
-  }
-  return success();
-}
-
-// Verifies that |dynamicDims| contains the appropriate number of dims for all
 // the dynamic dimensions in |type|.
 static LogicalResult verifyOpDynamicDims(Operation *op, TypeRange types,
                                          ValueRange dynamicDims) {
diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp
index 40f75b7..756d6cf 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/ElideAsyncCopies.cpp
@@ -432,17 +432,6 @@
   return false;
 }
 
-// Tries to elide |cloneOp| by replacing all uses with its source if safe.
-// Returns true if the op was elided.
-static bool tryElideCloneOp(IREE::Stream::AsyncCloneOp cloneOp,
-                            LastUseAnalysis &analysis) {
-  if (!isSafeToElideCloneOp(cloneOp, analysis))
-    return false;
-  cloneOp.replaceAllUsesWith(cloneOp.getSource());
-  cloneOp.erase();
-  return true;
-}
-
 // Tries to elide copies nested within |region| when safe.
 // Returns true if any ops were elided.
 static bool tryElideAsyncCopiesInRegion(Region &region,
diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp
index 87c38d0..7d2dc62 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/LayoutSlices.cpp
@@ -35,35 +35,6 @@
 
 using Slice = IREE::Stream::ResourcePackOp::Slice;
 
-// Packs slices back-to-back with no aliasing. Useful when debugging to remove
-// the aliasing that makes data breakpoints useless.
-//
-// Slice packed offset SSA values will be updated and start at the given
-// |baseOffset|. Returns |baseOffset| + the total size of the allocation
-// aligned to the requirements of |resourceConfig|.
-static Value
-packSlicesWithNoAliasing(IREE::Stream::ResourcePackOp packOp, Value baseOffset,
-                         ArrayRef<Slice> slices,
-                         IREE::Stream::ResourceConfigAttr resourceConfig,
-                         IndexSet &indexSet, OpBuilder &builder) {
-  auto loc = packOp.getLoc();
-  int64_t offsetAlignment = resourceConfig.getMinBufferOffsetAlignment();
-  int64_t rangeAlignment = resourceConfig.getMinBufferRangeAlignment();
-
-  Value offset = baseOffset;
-  for (auto &slice : slices) {
-    auto sliceSize = builder.createOrFold<IREE::Util::AlignOp>(
-        loc, slice.dynamicSize, rangeAlignment);
-    slice.packedOffset.replaceAllUsesWith(offset);
-    auto valueToAlign =
-        builder.createOrFold<arith::AddIOp>(loc, offset, sliceSize);
-    offset = builder.createOrFold<IREE::Util::AlignOp>(loc, valueToAlign,
-                                                       offsetAlignment);
-  }
-
-  return builder.createOrFold<IREE::Util::AlignOp>(loc, offset, rangeAlignment);
-}
-
 // Packs a set of statically-sized slices by greedy strip packing.
 //
 // This is the same algorithm used in tflite here:
diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp
index ea26f84..e449748 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/PropagateTimepoints.cpp
@@ -527,8 +527,6 @@
   op.erase();
 }
 
-static ValueRange asValueRange(ArrayRef<Value> values) { return values; }
-
 static void expandSwitchOp(mlir::cf::SwitchOp op,
                            IRMapping &resourceTimepointMap) {
   if (!usesResources(op))
diff --git a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp
index 99ad8a2..f2da9a7 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/Transforms/VerifyLowerings.cpp
@@ -236,16 +236,6 @@
       });
 }
 
-static void markStreamCmdOpsIllegal(Verifier &verifier) {
-  verifier.addOpVerifier(
-      [](Operation *op) -> std::optional<Verifier::Legality> {
-        if (op->hasTrait<OpTrait::IREE::Stream::CmdPhaseOp>()) {
-          return Verifier::Legality::ILLEGAL;
-        }
-        return std::nullopt;
-      });
-}
-
 //===----------------------------------------------------------------------===//
 // -iree-stream-verify-input
 //===----------------------------------------------------------------------===//
diff --git a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
index 113e12e..26d4065 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
+++ b/compiler/src/iree/compiler/Dialect/VM/Conversion/VMToEmitC/ConvertVMToEmitC.cpp
@@ -213,30 +213,6 @@
   return success();
 }
 
-FailureOr<int64_t> calculateNumSpans(IREE::VM::CallVariadicOp &callOp) {
-  auto isVariadic = [](APInt segmentSize) {
-    return segmentSize.getSExtValue() != -1;
-  };
-
-  DenseIntElementsAttr segmentSizes = callOp.getSegmentSizes();
-  size_t numSegments = segmentSizes.size();
-  size_t numVariadicSegments = llvm::count_if(segmentSizes, isVariadic);
-
-  if (numVariadicSegments != 1) {
-    callOp.emitError() << "only exactly one variadic segment supported";
-    return failure();
-  }
-
-  auto lastSegmentSize = *(segmentSizes.begin() + (numSegments - 1));
-
-  if (!isVariadic(lastSegmentSize)) {
-    callOp.emitError() << "expected the last segment to be variadic";
-    return failure();
-  }
-
-  return lastSegmentSize.getSExtValue();
-}
-
 std::optional<std::string> buildFunctionName(IREE::VM::ModuleOp &moduleOp,
                                              IREE::VM::ImportOp &importOp) {
   auto callingConvention = makeImportCallingConventionString(importOp);
diff --git a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BytecodeModuleTarget.cpp b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BytecodeModuleTarget.cpp
index 5bce5ee..824bc45 100644
--- a/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BytecodeModuleTarget.cpp
+++ b/compiler/src/iree/compiler/Dialect/VM/Target/Bytecode/BytecodeModuleTarget.cpp
@@ -262,19 +262,6 @@
                                     cconv.value(), attrsRef, fbb);
 }
 
-// Returns a serialized function signature.
-static iree_vm_FunctionSignatureDef_ref_t
-makeInternalFunctionSignatureDef(IREE::VM::FuncOp funcOp,
-                                 llvm::DenseMap<Type, int> &typeTable,
-                                 FlatbufferBuilder &fbb) {
-  // Generate the signature calling convention string based on types.
-  auto cconv = makeCallingConventionString(funcOp);
-  if (!cconv.has_value())
-    return {};
-  return createFunctionSignatureDef(funcOp.getFunctionType(), typeTable,
-                                    cconv.value(), /*attrsRef=*/0, fbb);
-}
-
 // Walks |rootOp| to find all VM features required by it and its children.
 static iree_vm_FeatureBits_enum_t findRequiredFeatures(Operation *rootOp) {
   iree_vm_FeatureBits_enum_t result = 0;
diff --git a/compiler/src/iree/compiler/InputConversion/StableHLO/Preprocessing/StableHLOToStableHLO.cpp b/compiler/src/iree/compiler/InputConversion/StableHLO/Preprocessing/StableHLOToStableHLO.cpp
index 601c4e3..7fcfb04 100644
--- a/compiler/src/iree/compiler/InputConversion/StableHLO/Preprocessing/StableHLOToStableHLO.cpp
+++ b/compiler/src/iree/compiler/InputConversion/StableHLO/Preprocessing/StableHLOToStableHLO.cpp
@@ -46,12 +46,6 @@
   return DenseIntElementsAttr::get(type, integers);
 }
 
-DenseIntElementsAttr make1DElementsAttr(OpBuilder &b, int64_t start,
-                                        int64_t num) {
-  return make1DElementsAttr(
-      b, llvm::to_vector(llvm::seq<int64_t>(start, start + num)));
-}
-
 Value getF32Const(ImplicitLocOpBuilder b, ArrayRef<int64_t> shapes,
                   ArrayRef<float> values) {
   RankedTensorType ty = RankedTensorType::get(shapes, b.getF32Type());
diff --git a/runtime/src/iree/hal/drivers/vulkan/descriptor_set_arena.cc b/runtime/src/iree/hal/drivers/vulkan/descriptor_set_arena.cc
index 528f129..cb54de9 100644
--- a/runtime/src/iree/hal/drivers/vulkan/descriptor_set_arena.cc
+++ b/runtime/src/iree/hal/drivers/vulkan/descriptor_set_arena.cc
@@ -85,22 +85,6 @@
   *out_infos = write_infos.data();
 }
 
-static VkDescriptorSetAllocateInfo PopulateDescriptorSetsAllocateInfo(
-    const DescriptorPool& descriptor_pool,
-    iree_hal_descriptor_set_layout_t* set_layout) {
-  VkDescriptorSetAllocateInfo allocate_info;
-  allocate_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO;
-  allocate_info.pNext = nullptr;
-  allocate_info.descriptorPool = descriptor_pool.handle;
-
-  VkDescriptorSetLayout set_layout_handle =
-      iree_hal_vulkan_native_descriptor_set_layout_handle(set_layout);
-  allocate_info.descriptorSetCount = 1;
-  allocate_info.pSetLayouts = &set_layout_handle;
-
-  return allocate_info;
-}
-
 }  // namespace
 
 DescriptorSetArena::DescriptorSetArena(
diff --git a/runtime/src/iree/modules/hal/inline/module.c b/runtime/src/iree/modules/hal/inline/module.c
index 6f9a21a..2284a5c 100644
--- a/runtime/src/iree/modules/hal/inline/module.c
+++ b/runtime/src/iree/modules/hal/inline/module.c
@@ -203,13 +203,6 @@
 // Utilities
 //===----------------------------------------------------------------------===//
 
-// Casts a VM value to a C host size.
-static iree_host_size_t iree_hal_cast_host_size(int64_t value) {
-  // TODO(benvanik): make this return status and check for overflow if host
-  // size is 32-bits.
-  return (iree_host_size_t)value;
-}
-
 // Casts a VM value to a HAL device size.
 static iree_device_size_t iree_hal_cast_device_size(int64_t value) {
   // TODO(benvanik): make this return status and check for overflow if device
diff --git a/runtime/src/iree/modules/hal/loader/module.c b/runtime/src/iree/modules/hal/loader/module.c
index c775fd8..0126421 100644
--- a/runtime/src/iree/modules/hal/loader/module.c
+++ b/runtime/src/iree/modules/hal/loader/module.c
@@ -93,13 +93,6 @@
   return (iree_host_size_t)value;
 }
 
-// Casts a VM value to a HAL device size.
-static iree_device_size_t iree_hal_cast_device_size(int64_t value) {
-  // TODO(benvanik): make this return status and check for overflow if device
-  // size is 32-bits.
-  return (iree_device_size_t)value;
-}
-
 //===----------------------------------------------------------------------===//
 // Shared argument shims
 //===----------------------------------------------------------------------===//
diff --git a/runtime/src/iree/task/topology_cpuinfo.c b/runtime/src/iree/task/topology_cpuinfo.c
index e0cec12..a0a42ab 100644
--- a/runtime/src/iree/task/topology_cpuinfo.c
+++ b/runtime/src/iree/task/topology_cpuinfo.c
@@ -323,12 +323,6 @@
 typedef bool (*iree_task_topology_core_filter_t)(
     const struct cpuinfo_core* core, uintptr_t user_data);
 
-// Matches all cores.
-static bool iree_task_topology_core_filter_all(const struct cpuinfo_core* core,
-                                               uintptr_t user_data) {
-  return true;
-}
-
 // Matches all cores that have the provided cluster ID.
 static bool iree_task_topology_core_filter_by_cluster_id(
     const struct cpuinfo_core* core, uintptr_t user_data) {
diff --git a/runtime/src/iree/tooling/numpy_io_test.cc b/runtime/src/iree/tooling/numpy_io_test.cc
index b7f8837..554f870 100644
--- a/runtime/src/iree/tooling/numpy_io_test.cc
+++ b/runtime/src/iree/tooling/numpy_io_test.cc
@@ -19,11 +19,6 @@
 using iree::testing::status::StatusIs;
 using ::testing::ElementsAreArray;
 
-std::ostream& operator<<(std::ostream& os, const Status& x) {
-  os << x.ToString();
-  return os;
-}
-
 class NumpyIOTest : public ::testing::Test {
  protected:
   virtual void SetUp() {
diff --git a/runtime/src/iree/tooling/trace_replay.c b/runtime/src/iree/tooling/trace_replay.c
index 6f2c849..06ed094 100644
--- a/runtime/src/iree/tooling/trace_replay.c
+++ b/runtime/src/iree/tooling/trace_replay.c
@@ -370,25 +370,12 @@
   return *state;
 }
 
-// Returns a random uint8_t in the range of [0, UCHAR_MAX].
-static uint8_t iree_trace_replay_pseudorandom_uint8(uint32_t* state) {
-  // return the second-least-signicant out of the 4 bytes of state. it avoids
-  // some mild issues with the least-significant and most-significant bytes.
-  return iree_tree_replay_pseudorandom_uint32(state) >> 8;
-}
-
 // Returns a random uint32_t in the range [0, range).
 static inline uint32_t iree_trace_replay_pseudorandom_range(uint32_t* state,
                                                             uint32_t range) {
   return iree_tree_replay_pseudorandom_uint32(state) % range;
 }
 
-// Returns a random double in the range of [0, 1.0).
-static double iree_trace_replay_pseudorandom_double(uint32_t* state) {
-  const double inv_modulus = 1.0 / IREE_PRNG_MODULUS;
-  return iree_tree_replay_pseudorandom_uint32(state) * inv_modulus;
-}
-
 // Get minimum and maximum for integer-valued uniform distribution.
 static void iree_trace_replay_get_min_max_for_element_type(
     iree_hal_element_type_t element_type, int32_t* min, int32_t* max) {
diff --git a/tools/iree-e2e-matmul-test.c b/tools/iree-e2e-matmul-test.c
index 692615e..503f4a3 100644
--- a/tools/iree-e2e-matmul-test.c
+++ b/tools/iree-e2e-matmul-test.c
@@ -112,26 +112,6 @@
   return result;
 }
 
-// TODO(#5542): check the value type before accessing the union.
-static inline int32_t iree_e2e_test_value_get_i32(
-    iree_e2e_test_value_t* value) {
-  return value->i32;
-}
-
-static inline iree_e2e_test_value_t iree_e2e_test_value_make_i64(
-    int64_t value) {
-  iree_e2e_test_value_t result;
-  result.type = IREE_E2E_TEST_VALUE_TYPE_I64;
-  result.i64 = value;
-  return result;
-}
-
-// TODO(#5542): check the value type before accessing the union.
-static inline int64_t iree_e2e_test_value_get_i64(
-    iree_e2e_test_value_t* value) {
-  return value->i64;
-}
-
 static inline iree_e2e_test_value_t iree_e2e_test_value_make_f16(
     uint16_t value) {
   iree_e2e_test_value_t result;
@@ -155,35 +135,6 @@
   return result;
 }
 
-// TODO(#5542): check the value type before accessing the union.
-static inline float iree_e2e_test_value_get_f32(iree_e2e_test_value_t* value) {
-  return value->f32;
-}
-
-// TODO(#5542): check the value type before accessing the union.
-static inline uint16_t iree_e2e_test_value_get_f16(
-    iree_e2e_test_value_t* value) {
-  return value->f16_u16;
-}
-
-// TODO(#5542): check the value type before accessing the union.
-static inline uint16_t iree_e2e_test_value_get_bf16(
-    iree_e2e_test_value_t* value) {
-  return value->bf16_u16;
-}
-
-static inline iree_e2e_test_value_t iree_e2e_test_value_make_f64(double value) {
-  iree_e2e_test_value_t result;
-  result.type = IREE_E2E_TEST_VALUE_TYPE_F64;
-  result.f64 = value;
-  return result;
-}
-
-// TODO(#5542): check the value type before accessing the union.
-static inline double iree_e2e_test_value_get_f64(iree_e2e_test_value_t* value) {
-  return value->f64;
-}
-
 /*****************************************************************************
  *
  * Part 1:
@@ -289,22 +240,6 @@
   return status;
 }
 
-// Performs a deep copy of host-local |src| into a device-local |dst|.
-// Allocates |dst|.
-static iree_status_t copy_host_buffer_view_to_device(
-    iree_hal_device_t* device, iree_hal_allocator_t* hal_allocator,
-    iree_hal_buffer_view_t* src, iree_hal_buffer_view_t** dst) {
-  iree_hal_buffer_mapping_t src_mapping;
-  IREE_RETURN_IF_ERROR(map_host_local_row_major_data(
-      src, IREE_HAL_MEMORY_ACCESS_READ, &src_mapping));
-  iree_const_byte_span_t const_src_bytes = iree_make_const_byte_span(
-      src_mapping.contents.data, src_mapping.contents.data_length);
-  IREE_RETURN_IF_ERROR(allocate_device_buffer_view_like(
-      device, hal_allocator, src, const_src_bytes, dst));
-  IREE_RETURN_IF_ERROR(iree_hal_buffer_unmap_range(&src_mapping));
-  return iree_ok_status();
-}
-
 // Performs a deep copy of device-local |src| into a device-local |dst|.
 // Allocates |dst|.
 static iree_status_t copy_device_buffer_view_to_device(
@@ -349,32 +284,6 @@
   return iree_ok_status();
 }
 
-// Helper to write an int value to a single buffer element.
-static void write_int_element(iree_hal_element_type_t element_type, int value,
-                              void* dst) {
-#define WRITE_INT_ELEMENT_CASE(ETYPE, CTYPE) \
-  case IREE_HAL_ELEMENT_TYPE_##ETYPE:        \
-    *(CTYPE*)dst = (CTYPE)value;             \
-    break;
-
-  switch (element_type) {
-    WRITE_INT_ELEMENT_CASE(INT_8, int8_t)
-    WRITE_INT_ELEMENT_CASE(INT_32, int32_t)
-    WRITE_INT_ELEMENT_CASE(FLOAT_32, float)
-    case IREE_HAL_ELEMENT_TYPE_FLOAT_16:
-      *(uint16_t*)dst = iree_math_f32_to_f16((float)value);
-      break;
-    case IREE_HAL_ELEMENT_TYPE_BFLOAT_16:
-      *(uint16_t*)dst = iree_math_f32_to_bf16((float)value);
-      break;
-    default:
-      IREE_ASSERT(false, "unhandled element type");
-      break;
-  }
-
-#undef WRITE_INT_ELEMENT_CASE
-}
-
 /*****************************************************************************
  *
  * Part 2:
@@ -388,30 +297,6 @@
  * particular test program is entrenched here.
  *
  *****************************************************************************/
-// Write an int32_t element to a mapped row-major matrix buffer.
-static void write_int_to_matrix_element(int32_t value, iree_hal_dim_t m_size,
-                                        iree_hal_dim_t n_size,
-                                        iree_hal_element_type_t result_type,
-                                        void* data, iree_hal_dim_t m,
-                                        iree_hal_dim_t n) {
-  iree_host_size_t index = n + m * n_size;
-  (void)m_size;
-  if (iree_hal_element_type_is_integer(result_type, 32)) {
-    ((int32_t*)data)[index] = value;
-    return;
-  } else if (result_type == IREE_HAL_ELEMENT_TYPE_FLOAT_16) {
-    ((uint16_t*)data)[index] = iree_math_f32_to_f16((float)value);
-    return;
-  } else if (result_type == IREE_HAL_ELEMENT_TYPE_BFLOAT_16) {
-    ((uint16_t*)data)[index] = iree_math_f32_to_bf16((float)value);
-    return;
-  } else if (result_type == IREE_HAL_ELEMENT_TYPE_FLOAT_32) {
-    ((float*)data)[index] = value;
-    return;
-  }
-  IREE_CHECK_OK(iree_make_status(IREE_STATUS_INVALID_ARGUMENT,
-                                 "unhandled matmul result type"));
-}
 
 // Reads an element from a mapped row-major matrix buffer.
 static iree_e2e_test_value_t read_matrix_element(