Skip to content

Commit 6e403b1

Browse files
authored
1 parent 5ae7716 commit 6e403b1

File tree

6 files changed

+21
-13
lines changed

6 files changed

+21
-13
lines changed

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 = "12bcea3292a1559ecad549b5d34c8abcf19f2626"
20+
LLVM_COMMIT = "6c64c8a6f3f77c30745c751d4163ff6bf2fc323b"
2121

22-
LLVM_SHA256 = "1ce4ec480f47e8b46cea858a652d18dff18844c821d18836c41edbf36151c209"
22+
LLVM_SHA256 = "a27f8452e8a4267acb7bf59ea4dae012cec22e37624a67206b927985554e3640"
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-
12bcea3292a1559ecad549b5d34c8abcf19f2626
1+
6c64c8a6f3f77c30745c751d4163ff6bf2fc323b

docs/generated/stablehlo_linalg_passes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
_Legalize StableHLO to LinAlg_
55

66

7+
78
#### Options
89
```
910
-enable-primitive-ops : Lower to primitive Linalg ops (map, reduce and transpose) when possible, instead of linalg.generic

docs/generated/stablehlo_passes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
_Legalizes from CHLO ops flow to StableHLO and Shape ops_
55

6+
67
### `-shape-legalize-to-stablehlo`
78

89
_Legalize shape-related ops to StableHLO._
@@ -17,6 +18,7 @@ compilation pipelines that use StableHLO operations to model dynamism.
1718
_Folds StableHLO operations_
1819

1920

21+
2022
#### Options
2123
```
2224
-fold-float : Allow for potentially lossy computations using float type.
@@ -25,6 +27,7 @@ _Folds StableHLO operations_
2527

2628
_Canonicalizes StableHLO operations_
2729

30+
2831
### `-stablehlo-canonicalize-dynamism`
2932

3033
_Canonicalizes dynamic StableHLO ops into static ops._
@@ -87,6 +90,7 @@ func.func @tan_op_non_complex(%arg0: tensor<4xf64>) -> tensor<4xf64> {
8790

8891
_Pass to transform the IR to be on signless integers._
8992

93+
9094
### `-stablehlo-legalize-composite-to-call`
9195

9296
_Replaces composite ops with a call to their decomposition._
@@ -232,6 +236,7 @@ func.func @add(%arg0: tensor<!quant.uniform<i8:f32, 1.000000e+00>>, %arg1: tenso
232236

233237
_Legalize StableHLO to VHLO._
234238

239+
235240
### `-stablehlo-refine-arguments`
236241

237242
_Refines the argument shapes of the main function._
@@ -293,11 +298,13 @@ static shapes throughout the program.
293298

294299
_Legalize VHLO to StableHLO._
295300

301+
296302
### `-vhlo-to-version`
297303

298304
_Convert between versions of VHLO._
299305

300306

307+
301308
#### Options
302309
```
303310
-target : The target version. Must be a version of the form #.#.# .

docs/generated/stablehlo_tosa_passes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
_Legalize StableHLO to TOSA_
55

6+
67
### `-stablehlo-prepare-for-tosa`
78

89
_Prepare StableHLO for legalization to TOSA_

stablehlo/conversions/linalg/transforms/TypeConversion.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,35 @@ Type convertShapedType(ShapedType shapedType) {
4747
return shapedType;
4848
}
4949

50-
std::optional<Value> materializeCastFromIllegal(OpBuilder &builder, Type type,
51-
ValueRange inputs,
52-
Location loc) {
50+
Value materializeCastFromIllegal(OpBuilder &builder, Type type,
51+
ValueRange inputs, Location loc) {
5352
Type fromType = getElementTypeOrSelf(inputs[0].getType());
5453
Type toType = getElementTypeOrSelf(type);
5554
if ((!fromType.isSignedInteger() && !fromType.isUnsignedInteger()) ||
5655
!toType.isSignlessInteger())
57-
return std::nullopt;
56+
return Value();
5857
// Use unrealized conversion casts to do signful->signless conversions.
5958
return builder.create<UnrealizedConversionCastOp>(loc, type, inputs[0])
6059
->getResult(0);
6160
}
6261

63-
std::optional<Value> materializeCastToIllegal(OpBuilder &builder, Type type,
64-
ValueRange inputs, Location loc) {
62+
Value materializeCastToIllegal(OpBuilder &builder, Type type, ValueRange inputs,
63+
Location loc) {
6564
Type fromType = getElementTypeOrSelf(inputs[0].getType());
6665
Type toType = getElementTypeOrSelf(type);
6766
if (!fromType.isSignlessInteger() ||
6867
(!toType.isSignedInteger() && !toType.isUnsignedInteger()))
69-
return std::nullopt;
68+
return Value();
7069
// Use unrealized conversion casts to do signless->signful conversions.
7170
return builder.create<UnrealizedConversionCastOp>(loc, type, inputs[0])
7271
->getResult(0);
7372
}
7473

75-
std::optional<Value> scalarToTensor(OpBuilder &builder, Type type,
76-
ValueRange inputs, Location loc) {
74+
Value scalarToTensor(OpBuilder &builder, Type type, ValueRange inputs,
75+
Location loc) {
7776
assert(inputs.size() == 1);
7877
if (mlir::isa<ShapedType>(inputs.front().getType())) {
79-
return std::nullopt;
78+
return Value();
8079
}
8180
Value result =
8281
builder

0 commit comments

Comments
 (0)