Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump llvm to tip of main #7440

Merged
merged 15 commits into from
Aug 9, 2024
10 changes: 7 additions & 3 deletions lib/Conversion/MooreToCore/MooreToCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ static void populateLegality(ConversionTarget &target) {

static void populateTypeConversion(TypeConverter &typeConverter) {
typeConverter.addConversion([&](IntType type) {
return mlir::IntegerType::get(type.getContext(), type.getWidth());
return IntegerType::get(type.getContext(), type.getWidth());
});

typeConverter.addConversion([&](ArrayType type) {
Expand All @@ -868,11 +868,15 @@ static void populateTypeConversion(TypeConverter &typeConverter) {
});

typeConverter.addConversion([&](RefType type) -> std::optional<Type> {
return hw::InOutType::get(typeConverter.convertType(type.getNestedType()));
auto innerType = typeConverter.convertType(type.getNestedType());
if (innerType)
return hw::InOutType::get(innerType);
return {};
});

// Valid target types.
typeConverter.addConversion([](mlir::IntegerType type) { return type; });
typeConverter.addConversion([](IntegerType type) { return type; });

typeConverter.addTargetMaterialization(
[&](mlir::OpBuilder &builder, mlir::Type resultType,
mlir::ValueRange inputs,
Expand Down
1 change: 1 addition & 0 deletions lib/Conversion/SeqToSV/FirMemLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "FirMemLowering.h"
#include "mlir/IR/Threading.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/Support/Debug.h"

using namespace circt;
Expand Down
1 change: 1 addition & 0 deletions lib/Conversion/SeqToSV/FirMemLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "circt/Support/LLVM.h"
#include "circt/Support/Namespace.h"
#include "circt/Support/SymCache.h"
#include "llvm/ADT/MapVector.h"

namespace circt {

Expand Down
1 change: 1 addition & 0 deletions lib/Dialect/Arc/Transforms/Dedup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "llvm/ADT/SetVector.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/SHA256.h"
#include <variant>

#define DEBUG_TYPE "arc-dedup"

Expand Down
5 changes: 1 addition & 4 deletions lib/Dialect/HW/Transforms/FlattenIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ class FlattenIOTypeConverter : public TypeConverter {
results.push_back(type);
else {
for (auto field : structType.getElements())

results.push_back(field.type);
}
return success();
Expand All @@ -185,9 +184,7 @@ class FlattenIOTypeConverter : public TypeConverter {

addTargetMaterialization([](OpBuilder &builder, hw::TypeAliasType type,
ValueRange inputs, Location loc) {
auto structType = getStructType(type);
assert(structType && "expected struct type");
auto result = builder.create<hw::StructCreateOp>(loc, structType, inputs);
auto result = builder.create<hw::StructCreateOp>(loc, type, inputs);
return result.getResult();
});
}
Expand Down
1 change: 1 addition & 0 deletions lib/Dialect/Sim/SimOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "llvm/ADT/MapVector.h"

using namespace mlir;
using namespace circt;
Expand Down
2 changes: 1 addition & 1 deletion llvm
Submodule llvm updated 7907 files
6 changes: 3 additions & 3 deletions test/Conversion/MooreToCore/basic.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -241,13 +241,13 @@ moore.module private @Null() {
// CHECK-SAME: %[[V0:.*]] : i1, in
// CHECK-SAME: %[[V1:.*]] : i1, out out0 : i1) {
moore.module @Top(in %arg0 : !moore.l1, in %arg1 : !moore.l1, out out0 : !moore.l1) {
// CHECK-NEXT: %[[V2:.*]] = hw.instance "inst_0" @SubModule_0(a: %[[V0]]: i1, b: %[[V1]]: i1) -> (c: i1)
// CHECK-NEXT: %[[V2:.*]] = hw.instance "inst_0" @SubModule_0(a: %[[V0]]: i1, b: %[[V1]]: i1) -> (c: i1)
%inst_0.c = moore.instance "inst_0" @SubModule_0(a: %arg0 : !moore.l1, b: %arg1 : !moore.l1) -> (c: !moore.l1)

// CHECK-NEXT: %[[V3:.*]] = hw.instance "inst_1" @SubModule_0(a: %[[V2]]: i1, b: %[[V1]]: i1) -> (c: i1)
// CHECK-NEXT: %[[V3:.*]] = hw.instance "inst_1" @SubModule_0(a: %[[V2]]: i1, b: %[[V1]]: i1) -> (c: i1)
%inst_1.c = moore.instance "inst_1" @SubModule_0(a: %inst_0.c : !moore.l1, b: %arg1 : !moore.l1) -> (c: !moore.l1)

// CHECK-NEXT: hw.output %[[V3]] : i1
// CHECK-NEXT: hw.output %[[V3]] : i1
moore.output %inst_1.c : !moore.l1
}

Expand Down
16 changes: 8 additions & 8 deletions test/Conversion/VerifToSMT/verif-to-smt.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ func.func @test(%arg0: !smt.bv<1>) -> (i1, i1, i1) {

// CHECK: [[EQ:%.+]] = smt.solver() : () -> i1
// CHECK: [[IN0:%.+]] = smt.declare_fun : !smt.bv<32>
// CHECK: [[V0:%.+]] = builtin.unrealized_conversion_cast [[IN0]] : !smt.bv<32> to i32
// CHECK: [[IN1:%.+]] = smt.declare_fun : !smt.bv<32>
// CHECK: [[V1:%.+]] = builtin.unrealized_conversion_cast [[IN1]] : !smt.bv<32> to i32
// CHECK: [[V2:%.+]]:2 = "some_op"([[V0]], [[V1]]) : (i32, i32) -> (i32, i32)
// CHECK: [[V3:%.+]] = builtin.unrealized_conversion_cast [[V2]]#0 : i32 to !smt.bv<32>
// CHECK: [[V4:%.+]] = smt.distinct [[IN0]], [[V3]] : !smt.bv<32>
// CHECK: [[V5:%.+]] = builtin.unrealized_conversion_cast [[V2]]#1 : i32 to !smt.bv<32>
// CHECK: [[V6:%.+]] = smt.distinct [[IN1]], [[V5]] : !smt.bv<32>
// CHECK: [[V7:%.+]] = smt.or [[V4]], [[V6]]
// CHECK-DAG: [[V0:%.+]] = builtin.unrealized_conversion_cast [[IN0]] : !smt.bv<32> to i32
// CHECK-DAG: [[V1:%.+]] = builtin.unrealized_conversion_cast [[IN1]] : !smt.bv<32> to i32
// CHECK-DAG: [[V2:%.+]]:2 = "some_op"([[V0]], [[V1]]) : (i32, i32) -> (i32, i32)
// CHECK-DAG: [[V3:%.+]] = builtin.unrealized_conversion_cast [[V2]]#0 : i32 to !smt.bv<32>
// CHECK-DAG: [[V4:%.+]] = smt.distinct [[IN0]], [[V3]] : !smt.bv<32>
// CHECK-DAG: [[V5:%.+]] = builtin.unrealized_conversion_cast [[V2]]#1 : i32 to !smt.bv<32>
// CHECK-DAG: [[V6:%.+]] = smt.distinct [[IN1]], [[V5]] : !smt.bv<32>
// CHECK-DAG: [[V7:%.+]] = smt.or [[V4]], [[V6]]
// CHECK: smt.assert [[V7]]
// CHECK: [[FALSE:%.+]] = arith.constant false
// CHECK: [[TRUE:%.+]] = arith.constant true
Expand Down
6 changes: 3 additions & 3 deletions test/Dialect/HW/flatten-io.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ hw.module @level2(in %in : !Struct2, out out: !Struct2) {
hw.type_scope @foo {
hw.typedecl @bar : !Struct1
}
!ScopedStruct = !hw.typealias<@foo::@bar,!Struct1>
!ScopedStruct = !hw.typealias<@foo::@bar, !Struct1>

// BASIC-LABEL: hw.module @scoped(in %arg0 : i32, in %in.a : i1, in %in.b : i2, in %arg1 : i32, out out0 : i32, out out.a : i1, out out.b : i2, out out1 : i32) {
// BASIC-NEXT: %0 = hw.struct_create (%in.a, %in.b) : !hw.struct<a: i1, b: i2>
// BASIC-NEXT: %a, %b = hw.struct_explode %0 : !hw.struct<a: i1, b: i2>
// BASIC-NEXT: %0 = hw.struct_create (%in.a, %in.b) : !hw.typealias<@foo::@bar, !hw.struct<a: i1, b: i2>>
// BASIC-NEXT: %a, %b = hw.struct_explode %0 : !hw.typealias<@foo::@bar, !hw.struct<a: i1, b: i2>>
// BASIC-NEXT: hw.output %arg0, %a, %b, %arg1 : i32, i1, i2, i32
// BASIC-NEXT: }
hw.module @scoped(in %arg0 : i32, in %in : !ScopedStruct, in %arg1: i32, out out0 : i32, out out: !ScopedStruct, out out1: i32) {
Expand Down
1 change: 1 addition & 0 deletions tools/circt-verilog/circt-verilog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "circt/Dialect/Moore/MoorePasses.h"
#include "circt/Support/Passes.h"
#include "circt/Support/Version.h"
#include "mlir/IR/AsmState.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/Pass/PassManager.h"
#include "mlir/Support/FileUtilities.h"
Expand Down
1 change: 1 addition & 0 deletions tools/om-linker/om-linker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "circt/Dialect/SV/SVDialect.h"
#include "circt/Dialect/Verif/VerifDialect.h"
#include "circt/Support/Version.h"
#include "mlir/Bytecode/BytecodeWriter.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/Threading.h"
#include "mlir/Parser/Parser.h"
Expand Down
Loading