Convert func->util as part of input conversion. (#16411)
We now use `util.func` in place of `func.func` in all host code in the
compiler. flow/stream/hal executables continue to use `func.func` as
before for compatibility with upstream code and the benefits of the util
ops are fewer. Most code is still written against the
function/callable/call op interfaces so that we support initializers and
other future function types we may add. All tests have been updated to
use `util.func` for consistency even if the pass does still work with
`func.func`.
There's a few TODOs around better supporting tied function operands in
IPO and other passes but we aren't currently ever producing functions
with tied operands so they are hacked to bail in cases where they are
(IPO doesn't act on functions/calls with tied operands, etc).
diff --git a/tools/test/compile_to_phase.mlir b/tools/test/compile_to_phase.mlir
index 0e2b853..0390564 100644
--- a/tools/test/compile_to_phase.mlir
+++ b/tools/test/compile_to_phase.mlir
@@ -1,9 +1,9 @@
// RUN: iree-compile --compile-to=input %s | FileCheck %s --check-prefix=INPUT-PHASE
-// INPUT-PHASE: func.func @abs(%[[ARG0:.+]]: tensor<f32>)
+// INPUT-PHASE: util.func public @abs(%[[ARG0:.+]]: tensor<f32>)
// INPUT-PHASE: math.absf %[[ARG0]] : tensor<f32>
// RUN: iree-compile --compile-to=abi %s | FileCheck %s --check-prefix=ABI-PHASE
-// ABI-PHASE: func.func @abs(%[[ARG0:.+]]: !hal.buffer_view)
+// ABI-PHASE: util.func public @abs(%[[ARG0:.+]]: !hal.buffer_view)
// ABI-PHASE: %[[INPUT:.+]] = hal.tensor.import %[[ARG0]] "input0" : !hal.buffer_view -> tensor<f32>
// ABI-PHASE: math.absf %[[INPUT]] : tensor<f32>