[llvm] Update submodule to latest (#1589)

Co-authored-by: Andrew Lenharth <andrew@lenharth.org>
Co-authored-by: Fabian Schuiki <fabian@schuiki.ch>
Co-authored-by: Andrew Young <youngar17@gmail.com>
This commit is contained in:
John Demme 2021-08-18 19:37:43 -07:00 committed by GitHub
parent b1ff19677b
commit 21485874c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 21 deletions

View File

@ -133,7 +133,7 @@ class module:
if self.extern_mod is None:
# Find the top MLIR module.
mod = op
while mod.name != "module":
while mod.parent is not None:
mod = mod.parent
input_ports = [(n.value, o.type) for (n, o) in zip(op_names, op.operands)]
@ -363,7 +363,7 @@ class _Generate:
# Find the top MLIR module.
mod = op
while mod.name != "module":
while mod.parent is not None:
mod = mod.parent
# Assemble the parameters.

View File

@ -1077,7 +1077,7 @@ struct WaitOpConversion : public ConvertToLLVMPattern {
op->getLoc(), i64Ty, transformed.time(), rewriter.getI32ArrayAttr(2));
std::array<Value, 5> args({statePtr, procStateBC, realTime, delta, eps});
rewriter.create<LLVM::CallOp>(op->getLoc(), voidTy,
rewriter.create<LLVM::CallOp>(op->getLoc(), llvm::None,
rewriter.getSymbolRefAttr(llhdSuspendFunc),
args);
}
@ -1232,7 +1232,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
// Add reg state pointer to global state.
initBuilder.create<LLVM::CallOp>(
op->getLoc(), voidTy, rewriter.getSymbolRefAttr(allocEntityFunc),
op->getLoc(), llvm::None, rewriter.getSymbolRefAttr(allocEntityFunc),
ArrayRef<Value>({initStatePtr, owner, regMall}));
// Index of the signal in the entity's signal table.
@ -1442,7 +1442,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
procStateSensesPtr);
std::array<Value, 3> allocProcArgs({initStatePtr, owner, procStateMall});
initBuilder.create<LLVM::CallOp>(op->getLoc(), voidTy,
initBuilder.create<LLVM::CallOp>(op->getLoc(), llvm::None,
rewriter.getSymbolRefAttr(allocProcFunc),
allocProcArgs);
}
@ -1660,7 +1660,7 @@ struct DrvOpConversion : public ConvertToLLVMPattern {
std::array<Value, 7> args(
{statePtr, transformed.signal(), bc, sigWidth, realTime, delta, eps});
// Create the library call.
rewriter.create<LLVM::CallOp>(op->getLoc(), voidTy,
rewriter.create<LLVM::CallOp>(op->getLoc(), llvm::None,
rewriter.getSymbolRefAttr(drvFunc), args);
rewriter.eraseOp(op);

View File

@ -28,20 +28,38 @@ namespace {
/// Check the equivalence of operations by doing a deep comparison of operands
/// and attributes, but does not compare the content of any regions attached to
/// each op.
struct SimpleOperationInfo : public llvm::DenseMapInfo<Operation *> {
struct AlwaysLikeOpInfo : public llvm::DenseMapInfo<Operation *> {
static unsigned getHashValue(const Operation *opC) {
return mlir::OperationEquivalence::computeHash(
const_cast<Operation *>(opC));
const_cast<Operation *>(opC),
/*hashOperands=*/mlir::OperationEquivalence::directHashValue,
/*hashResults=*/mlir::OperationEquivalence::ignoreHashValue,
mlir::OperationEquivalence::IgnoreLocations);
}
static bool isEqual(const Operation *lhsC, const Operation *rhsC) {
auto *lhs = const_cast<Operation *>(lhsC);
auto *rhs = const_cast<Operation *>(rhsC);
// Trivially the same.
if (lhs == rhs)
return true;
// Filter out tombstones and empty ops.
if (lhs == getTombstoneKey() || lhs == getEmptyKey() ||
rhs == getTombstoneKey() || rhs == getEmptyKey())
return false;
return mlir::OperationEquivalence::isEquivalentTo(lhs, rhs);
// Compare attributes.
if (lhs->getName() != rhs->getName() ||
lhs->getAttrDictionary() != rhs->getAttrDictionary() ||
lhs->getNumOperands() != rhs->getNumOperands())
return false;
// Compare operands.
for (auto operandPair : llvm::zip(lhs->getOperands(), rhs->getOperands())) {
Value lhsOperand = std::get<0>(operandPair);
Value rhsOperand = std::get<1>(operandPair);
if (lhsOperand != rhsOperand)
return false;
}
// The two AlwaysOps are similar enough to be combined.
return true;
}
};
@ -135,7 +153,7 @@ void HWCleanupPass::runOnGraphRegion(Region &region, bool shallow) {
// A set of operations in the current block which are mergable. Any
// operation in this set is a candidate for another similar operation to
// merge in to.
DenseSet<Operation *, SimpleOperationInfo> alwaysFFOpsSeen;
DenseSet<Operation *, AlwaysLikeOpInfo> alwaysFFOpsSeen;
llvm::SmallDenseMap<Attribute, Operation *, 4> ifdefOps;
sv::InitialOp initialOpSeen;
sv::AlwaysCombOp alwaysCombOpSeen;

2
llvm

@ -1 +1 @@
Subproject commit 310c9496d80961188e8d8f8ad306cdf44bd7541f
Subproject commit 1689dade4218945db175f7916c2261667f9bf371

View File

@ -40,7 +40,7 @@ int registerOnlyHW() {
return 2;
mlirDialectHandleRegisterDialect(hwHandle, ctx);
if (mlirContextGetNumRegisteredDialects(ctx) != 1)
if (mlirContextGetNumRegisteredDialects(ctx) != 2)
return 3;
if (mlirContextGetNumLoadedDialects(ctx) != 1)
return 4;

View File

@ -15,7 +15,7 @@ firrtl.circuit "InvalidBundle" {
%0 = firrtl.invalidvalue : !firrtl.bundle<inp_d: uint<14>>
}
// expected-error @+1 {{unexpected operation 'func' in a firrtl.circuit}}
// expected-error @+1 {{unexpected operation 'builtin.func' in a firrtl.circuit}}
func private @UnknownFunction() {
return
}

View File

@ -2,7 +2,7 @@
// The firrtl.circuit should be removed, the main module name moved to an
// attribute on the module.
// CHECK-LABEL: {{^}}module attributes {firrtl.mainModule = "Simple"} {
// CHECK-LABEL: {{^}}builtin.module attributes {firrtl.mainModule = "Simple"} {
// CHECK-NOT: firrtl.circuit
// We should get a large header boilerplate.

View File

@ -83,7 +83,7 @@ llhd.entity @convert_prb (%sI1 : !llhd.sig<i1>, %sArr : !llhd.sig<!llhd.array<3x
// CHECK: %[[VAL_18:.*]] = llvm.extractvalue %[[VAL_13]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_19:.*]] = llvm.extractvalue %[[VAL_13]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_20:.*]] = llvm.extractvalue %[[VAL_13]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_21:.*]] = llvm.call @driveSignal(%[[VAL_0]], %[[VAL_4]], %[[VAL_17]], %[[VAL_14]], %[[VAL_18]], %[[VAL_19]], %[[VAL_20]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @driveSignal(%[[VAL_0]], %[[VAL_4]], %[[VAL_17]], %[[VAL_14]], %[[VAL_18]], %[[VAL_19]], %[[VAL_20]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> ()
// CHECK: %[[VAL_22:.*]] = llvm.mlir.constant(1 : i32) : i32
// CHECK: %[[VAL_23:.*]] = llvm.mlir.constant(8 : i64) : i64
// CHECK: %[[VAL_24:.*]] = llvm.mlir.null : !llvm.ptr<array<3 x i5>>
@ -97,7 +97,7 @@ llhd.entity @convert_prb (%sI1 : !llhd.sig<i1>, %sArr : !llhd.sig<!llhd.array<3x
// CHECK: %[[VAL_31:.*]] = llvm.extractvalue %[[VAL_13]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_32:.*]] = llvm.extractvalue %[[VAL_13]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_33:.*]] = llvm.extractvalue %[[VAL_13]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_34:.*]] = llvm.call @driveSignal(%[[VAL_0]], %[[VAL_6]], %[[VAL_30]], %[[VAL_27]], %[[VAL_31]], %[[VAL_32]], %[[VAL_33]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @driveSignal(%[[VAL_0]], %[[VAL_6]], %[[VAL_30]], %[[VAL_27]], %[[VAL_31]], %[[VAL_32]], %[[VAL_33]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> ()
// CHECK: llvm.return
// CHECK: }
llhd.entity @convert_drv (%sI1 : !llhd.sig<i1>, %sArr : !llhd.sig<!llhd.array<3xi5>>) -> () {
@ -116,7 +116,7 @@ llhd.entity @convert_drv (%sI1 : !llhd.sig<i1>, %sArr : !llhd.sig<!llhd.array<3x
// CHECK: llvm.cond_br %[[VAL_19]], ^bb1, ^bb2
// CHECK: ^bb1:
// CHECK: %{{.*}} = llvm.call @driveSignal
// CHECK: llvm.call @driveSignal
// CHECK: llvm.br ^bb2
// CHECK: ^bb2:
// CHECK: llvm.return
@ -195,7 +195,7 @@ llhd.entity @convert_drv_enable (%sI1 : !llhd.sig<i1>) -> () {
// CHECK: %[[VAL_49:.*]] = llvm.extractvalue %[[VAL_41]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_50:.*]] = llvm.extractvalue %[[VAL_41]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_51:.*]] = llvm.extractvalue %[[VAL_41]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_52:.*]] = llvm.call @driveSignal(%[[VAL_0]], %[[VAL_6]], %[[VAL_48]], %[[VAL_43]], %[[VAL_49]], %[[VAL_50]], %[[VAL_51]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @driveSignal(%[[VAL_0]], %[[VAL_6]], %[[VAL_48]], %[[VAL_43]], %[[VAL_49]], %[[VAL_50]], %[[VAL_51]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> ()
// CHECK: llvm.br ^bb8
// CHECK: ^bb8:
// CHECK: llvm.br ^bb9

View File

@ -32,7 +32,7 @@
// CHECK: %[[VAL_24:.*]] = llvm.extractvalue %[[VAL_19]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_25:.*]] = llvm.extractvalue %[[VAL_19]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_26:.*]] = llvm.extractvalue %[[VAL_19]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_27:.*]] = llvm.call @driveSignal(%[[VAL_0]], %[[VAL_5]], %[[VAL_23]], %[[VAL_20]], %[[VAL_24]], %[[VAL_25]], %[[VAL_26]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @driveSignal(%[[VAL_0]], %[[VAL_5]], %[[VAL_23]], %[[VAL_20]], %[[VAL_24]], %[[VAL_25]], %[[VAL_26]]) : (!llvm.ptr<i8>, !llvm.ptr<struct<(ptr<i8>, i64, i64, i64)>>, !llvm.ptr<i8>, i64, i64, i64, i64) -> ()
// CHECK: llvm.return
// CHECK: }

View File

@ -33,7 +33,7 @@
// CHECK: %[[VAL_19:.*]] = llvm.extractvalue %[[VAL_11]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_20:.*]] = llvm.extractvalue %[[VAL_11]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_21:.*]] = llvm.extractvalue %[[VAL_11]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_22:.*]] = llvm.call @llhdSuspend(%[[VAL_0]], %[[VAL_18]], %[[VAL_19]], %[[VAL_20]], %[[VAL_21]]) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @llhdSuspend(%[[VAL_0]], %[[VAL_18]], %[[VAL_19]], %[[VAL_20]], %[[VAL_21]]) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i64, i64, i64) -> ()
// CHECK: llvm.return
// CHECK: ^bb4:
// CHECK: %[[VAL_23:.*]] = llvm.mlir.constant(0 : i32) : i32
@ -168,7 +168,7 @@ llhd.proc @convert_resume_observe_partial (%in0 : !llhd.sig<i1>, %in1 : !llhd.si
// CHECK: %[[VAL_25:.*]] = llvm.extractvalue %[[VAL_13]][0 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_26:.*]] = llvm.extractvalue %[[VAL_13]][1 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_27:.*]] = llvm.extractvalue %[[VAL_13]][2 : i32] : !llvm.array<3 x i64>
// CHECK: %[[VAL_28:.*]] = llvm.call @llhdSuspend(%[[VAL_0]], %[[VAL_24]], %[[VAL_25]], %[[VAL_26]], %[[VAL_27]]) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i64, i64, i64) -> !llvm.void
// CHECK: llvm.call @llhdSuspend(%[[VAL_0]], %[[VAL_24]], %[[VAL_25]], %[[VAL_26]], %[[VAL_27]]) : (!llvm.ptr<i8>, !llvm.ptr<i8>, i64, i64, i64) -> ()
// CHECK: llvm.return
// CHECK: ^bb4:
// CHECK: %[[VAL_29:.*]] = llvm.mlir.constant(0 : i32) : i32

View File

@ -5,6 +5,7 @@
// DIALECT: Available Dialects:
// DIALECT-NEXT: affine
// DIALECT-NEXT: builtin
// DIALECT-NEXT: calyx
// DIALECT-NEXT: comb
// DIALECT-NEXT: esi

View File

@ -35,6 +35,7 @@
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SourceMgr.h"

View File

@ -24,6 +24,7 @@
#include "mlir/Target/LLVMIR/Export.h"
#include "mlir/Transforms/Passes.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/InitLLVM.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/ToolOutputFile.h"