mirror of https://github.com/llvm/torch-mlir
Bump LLVM to llvm/llvm-project@6c64c8a6f3 (#3818)
- bumps llvm-project topull/3826/head6c64c8a6f3
- bumps stablehlo to6e403b1aa6
- Updates type conversion materialization functions to return Value after API change in llvm-project. --------- Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
parent
6b58c89914
commit
8b0bf2e293
|
@ -1 +1 @@
|
||||||
Subproject commit f0b3b6d15b2c0ee2cff2dd31dc075adb5d9a4ff7
|
Subproject commit 6c64c8a6f3f77c30745c751d4163ff6bf2fc323b
|
|
@ -1 +1 @@
|
||||||
Subproject commit d40285ef3db0687e3f1e2bb0d716d748485a9739
|
Subproject commit 6e403b1aa6a71f5eaa09cc720e4ad42f692745e6
|
|
@ -57,16 +57,16 @@ static void setupTorchBoolToI1Conversion(ConversionTarget &target,
|
||||||
typeConverter.addConversion([](Torch::BoolType type) -> std::optional<Type> {
|
typeConverter.addConversion([](Torch::BoolType type) -> std::optional<Type> {
|
||||||
return IntegerType::get(type.getContext(), 1);
|
return IntegerType::get(type.getContext(), 1);
|
||||||
});
|
});
|
||||||
typeConverter.addTargetMaterialization(
|
typeConverter.addTargetMaterialization([](OpBuilder &builder,
|
||||||
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
|
IntegerType type, ValueRange inputs,
|
||||||
Location loc) -> std::optional<Value> {
|
Location loc) -> Value {
|
||||||
// Other builtin integer types could be handled by other materializers.
|
// Other builtin integer types could be handled by other materializers.
|
||||||
if (!(type.getWidth() == 1 && type.isSignless()))
|
if (!(type.getWidth() == 1 && type.isSignless()))
|
||||||
return std::nullopt;
|
return Value();
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
assert(isa<Torch::BoolType>(inputs[0].getType()));
|
assert(isa<Torch::BoolType>(inputs[0].getType()));
|
||||||
return builder.create<ToI1Op>(loc, inputs[0]).getResult();
|
return builder.create<ToI1Op>(loc, inputs[0]).getResult();
|
||||||
});
|
});
|
||||||
auto sourceMaterialization = [](OpBuilder &builder, Torch::BoolType type,
|
auto sourceMaterialization = [](OpBuilder &builder, Torch::BoolType type,
|
||||||
ValueRange inputs, Location loc) -> Value {
|
ValueRange inputs, Location loc) -> Value {
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
|
@ -83,19 +83,19 @@ static void setupTorchIntToI64Conversion(ConversionTarget &target,
|
||||||
typeConverter.addConversion([](Torch::IntType type) -> std::optional<Type> {
|
typeConverter.addConversion([](Torch::IntType type) -> std::optional<Type> {
|
||||||
return IntegerType::get(type.getContext(), 64);
|
return IntegerType::get(type.getContext(), 64);
|
||||||
});
|
});
|
||||||
typeConverter.addTargetMaterialization(
|
typeConverter.addTargetMaterialization([](OpBuilder &builder,
|
||||||
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
|
IntegerType type, ValueRange inputs,
|
||||||
Location loc) -> std::optional<Value> {
|
Location loc) -> Value {
|
||||||
// Other builtin integer types could be handled by other materializers.
|
// Other builtin integer types could be handled by other materializers.
|
||||||
if (!(type.getWidth() == 64 && type.isSignless()))
|
if (!(type.getWidth() == 64 && type.isSignless()))
|
||||||
return std::nullopt;
|
return Value();
|
||||||
// Other input type to be converted to i64 are handled by other
|
// Other input type to be converted to i64 are handled by other
|
||||||
// materializers.
|
// materializers.
|
||||||
if (!isa<Torch::IntType>(inputs[0].getType()))
|
if (!isa<Torch::IntType>(inputs[0].getType()))
|
||||||
return std::nullopt;
|
return Value();
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
return builder.createOrFold<ToI64Op>(loc, inputs[0]);
|
return builder.createOrFold<ToI64Op>(loc, inputs[0]);
|
||||||
});
|
});
|
||||||
auto sourceMaterialization = [](OpBuilder &builder, Torch::IntType type,
|
auto sourceMaterialization = [](OpBuilder &builder, Torch::IntType type,
|
||||||
ValueRange inputs, Location loc) -> Value {
|
ValueRange inputs, Location loc) -> Value {
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
|
@ -112,13 +112,13 @@ static void setupTorchFloatToF64Conversion(ConversionTarget &target,
|
||||||
typeConverter.addConversion([](Torch::FloatType type) -> std::optional<Type> {
|
typeConverter.addConversion([](Torch::FloatType type) -> std::optional<Type> {
|
||||||
return Float64Type::get(type.getContext());
|
return Float64Type::get(type.getContext());
|
||||||
});
|
});
|
||||||
typeConverter.addTargetMaterialization(
|
typeConverter.addTargetMaterialization([](OpBuilder &builder,
|
||||||
[](OpBuilder &builder, Float64Type type, ValueRange inputs,
|
Float64Type type, ValueRange inputs,
|
||||||
Location loc) -> std::optional<Value> {
|
Location loc) -> Value {
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
assert(isa<Torch::FloatType>(inputs[0].getType()));
|
assert(isa<Torch::FloatType>(inputs[0].getType()));
|
||||||
return builder.create<ToF64Op>(loc, inputs[0]).getResult();
|
return builder.create<ToF64Op>(loc, inputs[0]).getResult();
|
||||||
});
|
});
|
||||||
auto sourceMaterialization = [](OpBuilder &builder, Torch::FloatType type,
|
auto sourceMaterialization = [](OpBuilder &builder, Torch::FloatType type,
|
||||||
ValueRange inputs, Location loc) -> Value {
|
ValueRange inputs, Location loc) -> Value {
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
|
@ -137,19 +137,19 @@ static void setupTorchGeneratorToI64Conversion(ConversionTarget &target,
|
||||||
[](Torch::GeneratorType type) -> std::optional<Type> {
|
[](Torch::GeneratorType type) -> std::optional<Type> {
|
||||||
return IntegerType::get(type.getContext(), 64);
|
return IntegerType::get(type.getContext(), 64);
|
||||||
});
|
});
|
||||||
typeConverter.addTargetMaterialization(
|
typeConverter.addTargetMaterialization([](OpBuilder &builder,
|
||||||
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
|
IntegerType type, ValueRange inputs,
|
||||||
Location loc) -> std::optional<Value> {
|
Location loc) -> Value {
|
||||||
// Other builtin integer types could be handled by other materializers.
|
// Other builtin integer types could be handled by other materializers.
|
||||||
if (!(type.getWidth() == 64 && type.isSignless()))
|
if (!(type.getWidth() == 64 && type.isSignless()))
|
||||||
return std::nullopt;
|
return Value();
|
||||||
// Other input type to be converted to i64 are handled by other
|
// Other input type to be converted to i64 are handled by other
|
||||||
// materializers.
|
// materializers.
|
||||||
if (!isa<Torch::GeneratorType>(inputs[0].getType()))
|
if (!isa<Torch::GeneratorType>(inputs[0].getType()))
|
||||||
return std::nullopt;
|
return Value();
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
return builder.create<GeneratorToI64Op>(loc, inputs[0]).getResult();
|
return builder.create<GeneratorToI64Op>(loc, inputs[0]).getResult();
|
||||||
});
|
});
|
||||||
auto sourceMaterialization = [](OpBuilder &builder, Torch::GeneratorType type,
|
auto sourceMaterialization = [](OpBuilder &builder, Torch::GeneratorType type,
|
||||||
ValueRange inputs, Location loc) -> Value {
|
ValueRange inputs, Location loc) -> Value {
|
||||||
assert(inputs.size() == 1);
|
assert(inputs.size() == 1);
|
||||||
|
|
Loading…
Reference in New Issue