- bumps llvm-project to
6c64c8a6f3
- bumps stablehlo to
6e403b1aa6
- Updates type conversion materialization functions to return Value
after API change in llvm-project.

---------

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
pull/3826/head
Max191 2024-10-30 11:38:51 -04:00 committed by GitHub
parent 6b58c89914
commit 8b0bf2e293
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 45 additions and 45 deletions

@ -1 +1 @@
Subproject commit f0b3b6d15b2c0ee2cff2dd31dc075adb5d9a4ff7
Subproject commit 6c64c8a6f3f77c30745c751d4163ff6bf2fc323b

2
externals/stablehlo vendored

@ -1 +1 @@
Subproject commit d40285ef3db0687e3f1e2bb0d716d748485a9739
Subproject commit 6e403b1aa6a71f5eaa09cc720e4ad42f692745e6

View File

@ -57,12 +57,12 @@ static void setupTorchBoolToI1Conversion(ConversionTarget &target,
typeConverter.addConversion([](Torch::BoolType type) -> std::optional<Type> {
return IntegerType::get(type.getContext(), 1);
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
typeConverter.addTargetMaterialization([](OpBuilder &builder,
IntegerType type, ValueRange inputs,
Location loc) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 1 && type.isSignless()))
return std::nullopt;
return Value();
assert(inputs.size() == 1);
assert(isa<Torch::BoolType>(inputs[0].getType()));
return builder.create<ToI1Op>(loc, inputs[0]).getResult();
@ -83,16 +83,16 @@ static void setupTorchIntToI64Conversion(ConversionTarget &target,
typeConverter.addConversion([](Torch::IntType type) -> std::optional<Type> {
return IntegerType::get(type.getContext(), 64);
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
typeConverter.addTargetMaterialization([](OpBuilder &builder,
IntegerType type, ValueRange inputs,
Location loc) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return std::nullopt;
return Value();
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::IntType>(inputs[0].getType()))
return std::nullopt;
return Value();
assert(inputs.size() == 1);
return builder.createOrFold<ToI64Op>(loc, inputs[0]);
});
@ -112,9 +112,9 @@ static void setupTorchFloatToF64Conversion(ConversionTarget &target,
typeConverter.addConversion([](Torch::FloatType type) -> std::optional<Type> {
return Float64Type::get(type.getContext());
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, Float64Type type, ValueRange inputs,
Location loc) -> std::optional<Value> {
typeConverter.addTargetMaterialization([](OpBuilder &builder,
Float64Type type, ValueRange inputs,
Location loc) -> Value {
assert(inputs.size() == 1);
assert(isa<Torch::FloatType>(inputs[0].getType()));
return builder.create<ToF64Op>(loc, inputs[0]).getResult();
@ -137,16 +137,16 @@ static void setupTorchGeneratorToI64Conversion(ConversionTarget &target,
[](Torch::GeneratorType type) -> std::optional<Type> {
return IntegerType::get(type.getContext(), 64);
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
typeConverter.addTargetMaterialization([](OpBuilder &builder,
IntegerType type, ValueRange inputs,
Location loc) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return std::nullopt;
return Value();
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::GeneratorType>(inputs[0].getType()))
return std::nullopt;
return Value();
assert(inputs.size() == 1);
return builder.create<GeneratorToI64Op>(loc, inputs[0]).getResult();
});