Skip to content

Commit

Permalink
Revert "Bump LLVM to llvm/llvm-project@6c64c8a6f3f7 (#3818)"
Browse files Browse the repository at this point in the history
This reverts commit 8b0bf2e.
  • Loading branch information
rahuls-cerebras committed Jan 3, 2025
1 parent 581e203 commit db020a6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 45 deletions.
2 changes: 1 addition & 1 deletion externals/llvm-project
Submodule llvm-project updated 2641 files
2 changes: 1 addition & 1 deletion externals/stablehlo
Submodule stablehlo updated 44 files
+0 −16 BUILD.bazel
+0 −4 CMakeLists.txt
+2 −2 WORKSPACE.bazel
+1 −1 build_tools/llvm_version.txt
+0 −1 docs/generated/stablehlo_linalg_passes.md
+0 −7 docs/generated/stablehlo_passes.md
+0 −1 docs/generated/stablehlo_tosa_passes.md
+2 −6 docs/spec.md
+0 −199 rfcs/20241001-microscaling-formats.md
+0 −19 stablehlo/conversions/linalg/tests/miscellaneous.mlir
+10 −9 stablehlo/conversions/linalg/transforms/TypeConversion.cpp
+19 −2 stablehlo/dialect/Base.cpp
+2 −3 stablehlo/dialect/Base.td
+4 −44 stablehlo/dialect/StablehloOps.cpp
+2 −5 stablehlo/dialect/Version.cpp
+1 −1 stablehlo/dialect/Version.h
+1 −49 stablehlo/dialect/VhloBytecode.cpp
+0 −1 stablehlo/dialect/VhloDialect.td
+0 −24 stablehlo/dialect/VhloTypes.cpp
+0 −12 stablehlo/dialect/VhloTypes.td
+43 −15 stablehlo/reference/Tensor.cpp
+4 −6 stablehlo/reference/Types.cpp
+1 −1 stablehlo/testdata/igamma_float64_20_20_float64_20_20_chlo.mlir
+1 −1 stablehlo/testdata/igammac_float64_20_20_float64_20_20_chlo.mlir
+0 −32 stablehlo/tests/interpret/constant.mlir
+8 −40 stablehlo/tests/ops_stablehlo.mlir
+53 −53 stablehlo/tests/ops_stablehlo_quantized.mlir
+0 −4 stablehlo/tests/ops_stablehlo_roundtrip.mlir
+0 −220 stablehlo/tests/transforms/stablehlo_aggressive_folder.mlir
+528 −552 stablehlo/tests/transforms/stablehlo_aggressive_simplification.mlir
+0 −2,936 stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.1_8_0.mlir
+ stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.1_8_0.mlir.bc
+0 −32 stablehlo/tests/vhlo/stablehlo_legalize_to_vhlo.mlir
+0 −35 stablehlo/tests/vhlo/vhlo_to_version_downgrade_invalid.1_7_0.mlir
+0 −15 stablehlo/tests/vhlo/vhlo_to_version_downgrade_patch.mlir
+2 −7 stablehlo/transforms/CMakeLists.txt
+2 −31 stablehlo/transforms/PassUtils.cpp
+12 −27 stablehlo/transforms/PassUtils.h
+0 −5 stablehlo/transforms/Passes.h
+0 −2 stablehlo/transforms/Passes.td
+7 −245 stablehlo/transforms/StablehloAggressiveFolder.cpp
+492 −98 stablehlo/transforms/StablehloAggressiveSimplification.cpp
+0 −281 stablehlo/transforms/StablehloAggressiveSimplificationPatterns.td
+0 −7 stablehlo/transforms/VhloToVersion.cpp
86 changes: 43 additions & 43 deletions lib/Dialect/TorchConversion/Transforms/BackendTypeConversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ 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) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 1 && type.isSignless()))
return Value();
assert(inputs.size() == 1);
assert(isa<Torch::BoolType>(inputs[0].getType()));
return builder.create<ToI1Op>(loc, inputs[0]).getResult();
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 1 && type.isSignless()))
return std::nullopt;
assert(inputs.size() == 1);
assert(isa<Torch::BoolType>(inputs[0].getType()));
return builder.create<ToI1Op>(loc, inputs[0]).getResult();
});
auto sourceMaterialization = [](OpBuilder &builder, Torch::BoolType type,
ValueRange inputs, Location loc) -> Value {
assert(inputs.size() == 1);
Expand All @@ -83,19 +83,19 @@ 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) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return Value();
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::IntType>(inputs[0].getType()))
return Value();
assert(inputs.size() == 1);
return builder.createOrFold<ToI64Op>(loc, inputs[0]);
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return std::nullopt;
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::IntType>(inputs[0].getType()))
return std::nullopt;
assert(inputs.size() == 1);
return builder.createOrFold<ToI64Op>(loc, inputs[0]);
});
auto sourceMaterialization = [](OpBuilder &builder, Torch::IntType type,
ValueRange inputs, Location loc) -> Value {
assert(inputs.size() == 1);
Expand All @@ -112,13 +112,13 @@ 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) -> Value {
assert(inputs.size() == 1);
assert(isa<Torch::FloatType>(inputs[0].getType()));
return builder.create<ToF64Op>(loc, inputs[0]).getResult();
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, Float64Type type, ValueRange inputs,
Location loc) -> std::optional<Value> {
assert(inputs.size() == 1);
assert(isa<Torch::FloatType>(inputs[0].getType()));
return builder.create<ToF64Op>(loc, inputs[0]).getResult();
});
auto sourceMaterialization = [](OpBuilder &builder, Torch::FloatType type,
ValueRange inputs, Location loc) -> Value {
assert(inputs.size() == 1);
Expand All @@ -137,19 +137,19 @@ 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) -> Value {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return Value();
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::GeneratorType>(inputs[0].getType()))
return Value();
assert(inputs.size() == 1);
return builder.create<GeneratorToI64Op>(loc, inputs[0]).getResult();
});
typeConverter.addTargetMaterialization(
[](OpBuilder &builder, IntegerType type, ValueRange inputs,
Location loc) -> std::optional<Value> {
// Other builtin integer types could be handled by other materializers.
if (!(type.getWidth() == 64 && type.isSignless()))
return std::nullopt;
// Other input type to be converted to i64 are handled by other
// materializers.
if (!isa<Torch::GeneratorType>(inputs[0].getType()))
return std::nullopt;
assert(inputs.size() == 1);
return builder.create<GeneratorToI64Op>(loc, inputs[0]).getResult();
});
auto sourceMaterialization = [](OpBuilder &builder, Torch::GeneratorType type,
ValueRange inputs, Location loc) -> Value {
assert(inputs.size() == 1);
Expand Down

0 comments on commit db020a6

Please sign in to comment.