Skip to content

Commit 4598975

Browse files
authored
1 parent f1f32d8 commit 4598975

File tree

15 files changed

+154
-68
lines changed

15 files changed

+154
-68
lines changed

BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,6 @@ cc_library(
519519
"stablehlo/conversions/linalg/transforms/StablehloToLinalgRandom.cpp",
520520
"stablehlo/conversions/linalg/transforms/StablehloToLinalgReduce.cpp",
521521
"stablehlo/conversions/linalg/transforms/TypeConversion.cpp",
522-
"stablehlo/transforms/conversions/TypeConversion.cpp",
523-
"stablehlo/transforms/conversions/TypeConversion.h",
524522
],
525523
hdrs = [
526524
"stablehlo/conversions/linalg/transforms/LegalizeToLinalgUtils.h",
@@ -531,6 +529,7 @@ cc_library(
531529
],
532530
strip_include_prefix = ".",
533531
deps = [
532+
"stablehlo_type_conversions",
534533
":base",
535534
":chlo_ops",
536535
":linalg_pass_inc_gen",
@@ -995,7 +994,7 @@ cc_library(
995994
":linalg_passes",
996995
":reference_api",
997996
":reference_configuration",
998-
":stablehlo_dialect_capi",
997+
":stablehlo_dialect_capi_objects",
999998
":stablehlo_ops",
1000999
":stablehlo_passes",
10011000
":stablehlo_portable_api",

WORKSPACE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ workspace(name = "stablehlo")
1717

1818
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1919

20-
LLVM_COMMIT = "f8287f6c373fcf993643dd6f0e30dde304c1be73"
20+
LLVM_COMMIT = "0e779ad4998ef65907502101c5b82ede05ddfa4e"
2121

22-
LLVM_SHA256 = "add2841174abc79c45aa309bdf0cf631aa8f97e7a4df57dcfca57c60df27527f"
22+
LLVM_SHA256 = "d5c2560b2d9ce3ced7951113f2b5d1ea428665678f4dcb1fb8780eb1219ca615"
2323

2424
http_archive(
2525
name = "llvm-raw",

build_tools/llvm_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f8287f6c373fcf993643dd6f0e30dde304c1be73
1+
0e779ad4998ef65907502101c5b82ede05ddfa4e

docs/generated/interpreter_passes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
23
### `-interpreter-instrument-with-probe`
34

45
_Inserts interpreter.probe ops in a StableHLO program._
@@ -26,6 +27,7 @@ sequence: `probe1`, `probe2`, ... See `interpreter.probe` for additional
2627
information on how data is serialized.
2728

2829
#### Options
30+
2931
```
3032
-useDebugInfo : Whether or not to use location debug data as `probe_id` values.
3133
```

docs/generated/stablehlo_linalg_passes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
23
### `-stablehlo-legalize-to-linalg`
34

45
_Legalize StableHLO to LinAlg_
56

6-
7-
87
#### Options
8+
99
```
1010
-enable-primitive-ops : Lower to primitive Linalg ops (map, reduce and transpose) when possible, instead of linalg.generic
1111
-enable-sparse-ops : Lower to Sparse Tensor ops (sparse_tensor.concatenate)when possible, instead of linalg.generic

docs/generated/stablehlo_optimization_passes.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
23
### `-stablehlo-aggressive-folder`
34

45
_Folds StableHLO operations_
56

6-
7-
87
#### Options
8+
99
```
1010
-fold-float : Allow for potentially lossy computations using float type.
1111
```
12+
1213
### `-stablehlo-aggressive-simplification`
1314

1415
_Canonicalizes StableHLO operations_
@@ -98,6 +99,7 @@ Performs graph simplifications, including:
9899

99100
This list is pulled from code comments so is not fully exhaustive, but has
100101
high coverage of the pass today.
102+
101103
### `-stablehlo-target-independent-optimization`
102104

103105
_Runs canonicalizers, folders, and other target-independent optimizations._

docs/generated/stablehlo_passes.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
23
### `-chlo-legalize-to-stablehlo`
34

45
_Legalizes from CHLO ops flow to StableHLO and Shape ops_
56

6-
77
### `-shape-legalize-to-stablehlo`
88

99
_Legalize shape-related ops to StableHLO._
@@ -13,6 +13,7 @@ An experimental pass that legalizes shape-related ops to StableHLO ops.
1313
Bringing shape and data computations together via an optional pass will
1414
make it possible for the StableHLO ecosystem to potentially leverage the
1515
compilation pipelines that use StableHLO operations to model dynamism.
16+
1617
### `-stablehlo-canonicalize-dynamism`
1718

1819
_Canonicalizes dynamic StableHLO ops into static ops._
@@ -30,6 +31,7 @@ these ops are actually constants.
3031
3132
%0 = stablehlo.broadcast_in_dim %cst, dims = [] : (tensor<f32>) -> tensor<16xf32>
3233
```
34+
3335
### `-stablehlo-compatibility-expander`
3436

3537
_Compatibility expander for StableHLO operations._
@@ -68,9 +70,11 @@ func.func @tan_op_non_complex(%arg0: tensor<4xf64>) -> tensor<4xf64> {
6870
```
6971

7072
#### Options
73+
7174
```
7275
-target : The target version. Must be a version of the form #.#.#.
7376
```
77+
7478
### `-stablehlo-complex-math-expander`
7579

7680
_Expander for StableHLO complex math operations._
@@ -98,11 +102,11 @@ func.func @sqrt_op_complex(%arg0: tensor<4xcomplex<f64>>) -> tensor<4xcomplex<f6
98102
return %2 : tensor<4xcomplex<f64>>
99103
}
100104
```
105+
101106
### `-stablehlo-convert-to-signless`
102107

103108
_Pass to transform the IR to be on signless integers._
104109

105-
106110
### `-stablehlo-legalize-composite-to-call`
107111

108112
_Replaces composite ops with a call to their decomposition._
@@ -133,9 +137,11 @@ stablehlo-opt --stablehlo-legalize-composite-to-call=except='foo.baz,foo.qux'
133137
```
134138

135139
#### Options
140+
136141
```
137142
-except : Names of composites that should not be replaced with calls.
138143
```
144+
139145
### `-stablehlo-legalize-deprecated-ops`
140146

141147
_Legalize deprecated ops to well-supported ops._
@@ -146,9 +152,11 @@ removals in various compilation pipelines by legalizing them to their
146152
long-term supported counterparts.
147153

148154
#### Options
155+
149156
```
150157
-fail-on-unused : Fail on (mostly) unused ops that are deprecated without any fallback.
151158
```
159+
152160
### `-stablehlo-legalize-qdq-to-quantized-op`
153161

154162
_Fuse (de-quantize, floating-point operation and quantize) pattern into StableHLO quantized operation_
@@ -177,6 +185,7 @@ func.func @add(%arg0: tensor<16x16x!quant.uniform<u8:f32, 3.400000e+01:16>>) ->
177185
return %2 : tensor<16x16x!quant.uniform<u8:f32, 3.400000e+01:16>>
178186
}
179187
```
188+
180189
### `-stablehlo-legalize-quant-to-math`
181190

182191
_Convert from StableHLO quantized ops to StableHLO primitive math ops._
@@ -219,6 +228,7 @@ func.func @add(%arg0: tensor<i8>, %arg1: tensor<i8>) -> tensor<i8> {
219228
return %13 : tensor<i8>
220229
}
221230
```
231+
222232
### `-stablehlo-legalize-quantized-op-to-qdq`
223233

224234
_Decompose quantized StableHLO operation to (de-quantize, floating-point operation and quantize) pattern._
@@ -244,11 +254,11 @@ func.func @add(%arg0: tensor<!quant.uniform<i8:f32, 1.000000e+00>>, %arg1: tenso
244254
return %3 : tensor<!quant.uniform<i8:f32, 3.000000e+00:2>>
245255
}
246256
```
257+
247258
### `-stablehlo-legalize-to-vhlo`
248259

249260
_Legalize StableHLO to VHLO._
250261

251-
252262
### `-stablehlo-refine-arguments`
253263

254264
_Refines the argument shapes of the main function._
@@ -277,9 +287,11 @@ passed to the pass create method. The refinement type list must specify the
277287
type of every argument to the `main` method being refined.
278288

279289
#### Options
290+
280291
```
281292
-types : The new types to be used for the main function's arguments, specified as an MLIR TypeRange 'tensor<1x2xf32>, ...'
282293
```
294+
283295
### `-stablehlo-refine-shapes`
284296

285297
_Refines shapes across a StableHLO program._
@@ -325,18 +337,17 @@ Modules valid for shape refinement must have the following properties:
325337
returning constant values after refinement. These functions are inlined.
326338
* All calls to a single function resolve to the same argument shapes, and no
327339
recursive / co-recursive function calls are made.
340+
328341
### `-vhlo-legalize-to-stablehlo`
329342

330343
_Legalize VHLO to StableHLO._
331344

332-
333345
### `-vhlo-to-version`
334346

335347
_Convert between versions of VHLO._
336348

337-
338-
339349
#### Options
350+
340351
```
341352
-target : The target version. Must be a version of the form #.#.# .
342353
```

docs/generated/stablehlo_tosa_passes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
<!-- Autogenerated by mlir-tblgen; don't manually edit -->
2+
23
### `-stablehlo-legalize-to-tosa`
34

45
_Legalize StableHLO to TOSA_
56

6-
77
### `-stablehlo-prepare-for-tosa`
88

99
_Prepare StableHLO for legalization to TOSA_
1010

1111
This pass adds rewriters to make StableHLO ops more compatible with TOSA ops.
1212
Currently simplifies stablehlo.dot_general into stablehlo.dot for easier lowering.
13+
1314
### `-stablehlo-quant-legalize-to-tosa-rescale`
1415

1516
_Legalize StableHLO Quantized operations to TOSA rescale operations_
1617

1718
This pass rewrites StableHLO quantized operations to integer operations
1819
by inserting TOSA rescale operations at the inputs and outputs of the
1920
integer operations.
21+
2022
### `-tosa-rescale-legalize-to-stablehlo`
2123

2224
_Legalize TOSA rescales to StableHlo primitive math operations_

0 commit comments

Comments
 (0)