mirror of https://github.com/llvm/circt.git
Bump LLVM (#7223)
This commit is contained in:
parent
20e08c092c
commit
bf7c4e722e
|
@ -675,9 +675,6 @@ void HWToLLVMLoweringPass::runOnOperation() {
|
|||
populateHWToLLVMTypeConversions(converter);
|
||||
|
||||
LLVMConversionTarget target(getContext());
|
||||
target.addLegalOp<UnrealizedConversionCastOp>();
|
||||
target.addLegalOp<ModuleOp>();
|
||||
target.addLegalDialect<LLVM::LLVMDialect>();
|
||||
target.addIllegalDialect<hw::HWDialect>();
|
||||
|
||||
// Setup the conversion.
|
||||
|
|
|
@ -1884,14 +1884,13 @@ void LLHDToLLVMLoweringPass::runOnOperation() {
|
|||
|
||||
LLVMConversionTarget target(getContext());
|
||||
target.addIllegalOp<InstOp>();
|
||||
target.addLegalOp<UnrealizedConversionCastOp>();
|
||||
cf::populateControlFlowToLLVMConversionPatterns(converter, patterns);
|
||||
arith::populateArithToLLVMConversionPatterns(converter, patterns);
|
||||
|
||||
// Apply the partial conversion.
|
||||
if (failed(
|
||||
applyPartialConversion(getOperation(), target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
return signalPassFailure();
|
||||
patterns.clear();
|
||||
|
||||
// Setup the full conversion.
|
||||
|
@ -1907,21 +1906,10 @@ void LLHDToLLVMLoweringPass::runOnOperation() {
|
|||
populateCombToArithConversionPatterns(converter, patterns);
|
||||
arith::populateArithToLLVMConversionPatterns(converter, patterns);
|
||||
|
||||
target.addLegalDialect<LLVM::LLVMDialect>();
|
||||
target.addLegalOp<ModuleOp>();
|
||||
|
||||
// Apply a full conversion to remove unrealized conversion casts.
|
||||
if (failed(applyFullConversion(getOperation(), target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
|
||||
patterns.clear();
|
||||
|
||||
mlir::populateReconcileUnrealizedCastsPatterns(patterns);
|
||||
target.addIllegalOp<UnrealizedConversionCastOp>();
|
||||
|
||||
// Apply the full conversion.
|
||||
if (failed(applyFullConversion(getOperation(), target, std::move(patterns))))
|
||||
signalPassFailure();
|
||||
return signalPassFailure();
|
||||
}
|
||||
|
||||
/// Create an LLHD to LLVM conversion pass.
|
||||
|
|
|
@ -1505,7 +1505,8 @@ public:
|
|||
// will only be established later in the conversion process, so ensure
|
||||
// that rewriter optimizations (especially DCE) are disabled.
|
||||
GreedyRewriteConfig config;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification =
|
||||
mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
if (runOnce)
|
||||
config.maxIterations = 1;
|
||||
|
||||
|
|
|
@ -1707,7 +1707,8 @@ public:
|
|||
// will only be established later in the conversion process, so ensure
|
||||
// that rewriter optimizations (especially DCE) are disabled.
|
||||
GreedyRewriteConfig config;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification =
|
||||
mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
if (runOnce)
|
||||
config.maxIterations = 1;
|
||||
|
||||
|
|
|
@ -179,21 +179,4 @@ void ConvertVerifToSMTPass::runOnOperation() {
|
|||
if (failed(mlir::applyPartialConversion(getOperation(), target,
|
||||
std::move(patterns))))
|
||||
return signalPassFailure();
|
||||
|
||||
// Cleanup as many unrealized conversion casts as possible. This is applied
|
||||
// separately because we would otherwise need to make them entirely illegal,
|
||||
// but we want to allow them such that we can run a series of conversion
|
||||
// passes to SMT converting different dialects. Also, not marking the
|
||||
// unrealized conversion casts legal above (but adding the simplification
|
||||
// patterns) does not work, because the dialect conversion framework adds
|
||||
// IRRewrite patterns to replace values which are only applied after all
|
||||
// operations are legalized. This means, folding the casts away will not be
|
||||
// possible in many cases (especially the explicitly inserted target
|
||||
// materializations in the lowering of the 'miter' operation).
|
||||
RewritePatternSet cleanupPatterns(&getContext());
|
||||
populateReconcileUnrealizedCastsPatterns(cleanupPatterns);
|
||||
|
||||
if (failed(mlir::applyPatternsAndFoldGreedily(getOperation(),
|
||||
std::move(cleanupPatterns))))
|
||||
return signalPassFailure();
|
||||
}
|
||||
|
|
|
@ -599,7 +599,7 @@ void ArcCanonicalizerPass::runOnOperation() {
|
|||
DenseMap<StringAttr, StringAttr> arcMapping;
|
||||
|
||||
mlir::GreedyRewriteConfig config;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
config.maxIterations = 10;
|
||||
config.useTopDownTraversal = true;
|
||||
ArcListener listener(&cache);
|
||||
|
|
|
@ -21,7 +21,7 @@ using namespace ibis;
|
|||
static std::unique_ptr<Pass> createSimpleCanonicalizerPass() {
|
||||
mlir::GreedyRewriteConfig config;
|
||||
config.useTopDownTraversal = true;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
return mlir::createCanonicalizerPass(config);
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ struct OperationPruner : public Reduction {
|
|||
static std::unique_ptr<Pass> createSimpleCanonicalizerPass() {
|
||||
GreedyRewriteConfig config;
|
||||
config.useTopDownTraversal = true;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
return createCanonicalizerPass(config);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,6 @@ using namespace circt;
|
|||
std::unique_ptr<Pass> circt::createSimpleCanonicalizerPass() {
|
||||
mlir::GreedyRewriteConfig config;
|
||||
config.useTopDownTraversal = true;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
return mlir::createCanonicalizerPass(config);
|
||||
}
|
||||
|
|
2
llvm
2
llvm
|
@ -1 +1 @@
|
|||
Subproject commit 00bb18a77c6c25fa7d6150ae724ffb8a37334ecb
|
||||
Subproject commit 2ee2b6aa7a3d9ba6ba13f6881b25e26d7d12c823
|
|
@ -1,9 +1,9 @@
|
|||
// RUN: circt-opt %s --convert-hw-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-hw-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: @convertBitcast
|
||||
func.func @convertBitcast(%arg0 : i32, %arg1: !hw.array<2xi32>, %arg2: !hw.struct<foo: i32, bar: i32>) {
|
||||
// CHECK-NEXT: %[[AARG1:.*]] = builtin.unrealized_conversion_cast %arg1 : !hw.array<2xi32> to !llvm.array<2 x i32>
|
||||
// CHECK-NEXT: %[[AARG2:.*]] = builtin.unrealized_conversion_cast %arg2 : !hw.struct<foo: i32, bar: i32> to !llvm.struct<(i32, i32)>
|
||||
// CHECK-NEXT: %[[AARG1:.*]] = builtin.unrealized_conversion_cast %arg1 : !hw.array<2xi32> to !llvm.array<2 x i32>
|
||||
|
||||
// CHECK-NEXT: %[[ONE1:.*]] = llvm.mlir.constant(1 : i32) : i32
|
||||
// CHECK-NEXT: %[[A1:.*]] = llvm.alloca %[[ONE1]] x i32 {alignment = 4 : i64} : (i32) -> !llvm.ptr
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm --split-input-file | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts --split-input-file | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @convert_empty(
|
||||
// CHECK-SAME: %arg0: !llvm.ptr, %arg1: !llvm.ptr, %arg2: !llvm.ptr) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @convertSigExtract(
|
||||
// CHECK-SAME: %arg0: i5, %arg1: !llvm.ptr)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @lower_var(
|
||||
// CHECK-SAME: %arg0: i1, %arg1: i32) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK: @dummyA
|
||||
// CHECK: @dummyB
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @driveSignal(!llvm.ptr, !llvm.ptr, !llvm.ptr, i64, i64, i64, i64)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @driveSignal(!llvm.ptr, !llvm.ptr, !llvm.ptr, i64, i64, i64, i64)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @llhdSuspend(!llvm.ptr, !llvm.ptr, i64, i64, i64)
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ llhd.entity @root() -> () {
|
|||
}
|
||||
|
||||
llhd.entity @initUsesProbedValue () -> () {
|
||||
// expected-error @+1 {{failed to legalize operation 'hw.constant'}}
|
||||
%0 = hw.constant 0 : i1
|
||||
%1 = llhd.sig "sig" %0 : i1
|
||||
%2 = llhd.prb %1 : !llhd.sig<i1>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-llhd-to-llvm | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-llhd-to-llvm --reconcile-unrealized-casts | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: llvm.func @llhd_init
|
||||
// CHECK-SAME: %arg0: !llvm.ptr) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s --convert-verif-to-smt -allow-unregistered-dialect | FileCheck %s
|
||||
// RUN: circt-opt %s --convert-verif-to-smt --reconcile-unrealized-casts -allow-unregistered-dialect | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: func @test
|
||||
// CHECK-SAME: ([[ARG0:%.+]]: !smt.bv<1>)
|
||||
|
@ -10,8 +10,6 @@ func.func @test(%arg0: !smt.bv<1>) -> (i1, i1, i1) {
|
|||
verif.assert %0 : i1
|
||||
|
||||
// CHECK: [[EQ:%.+]] = smt.solver() : () -> i1
|
||||
// CHECK: [[TRUE:%.+]] = arith.constant true
|
||||
// CHECK: [[FALSE:%.+]] = arith.constant false
|
||||
// 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>
|
||||
|
@ -23,6 +21,8 @@ func.func @test(%arg0: !smt.bv<1>) -> (i1, i1, i1) {
|
|||
// CHECK: [[V6:%.+]] = smt.distinct [[IN1]], [[V5]] : !smt.bv<32>
|
||||
// CHECK: [[V7:%.+]] = smt.or [[V4]], [[V6]]
|
||||
// CHECK: smt.assert [[V7]]
|
||||
// CHECK: [[FALSE:%.+]] = arith.constant false
|
||||
// CHECK: [[TRUE:%.+]] = arith.constant true
|
||||
// CHECK: [[V8:%.+]] = smt.check
|
||||
// CHECK: smt.yield [[FALSE]]
|
||||
// CHECK: smt.yield [[FALSE]]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=false' --allow-unregistered-dialect | FileCheck %s
|
||||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=disabled' --allow-unregistered-dialect | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: @narrowMux
|
||||
hw.module @narrowMux(in %a: i8, in %b: i8, in %c: i1, out o: i4) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt -pass-pipeline='builtin.module(firrtl.circuit(firrtl-imconstprop), canonicalize{top-down region-simplify}, firrtl.circuit(firrtl.module(firrtl-register-optimizer)))' %s | FileCheck %s
|
||||
// RUN: circt-opt -pass-pipeline='builtin.module(firrtl.circuit(firrtl-imconstprop), canonicalize{top-down region-simplify=aggressive}, firrtl.circuit(firrtl.module(firrtl-register-optimizer)))' %s | FileCheck %s
|
||||
// github.com/chipsalliance/firrtl: test/scala/firrtlTests/ConstantPropagationTests.scala
|
||||
|
||||
//propagate constant inputs
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
firrtl.circuit "Casts" {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
// The following tests are derived from `ConstantPropagationSingleModule` in [1].
|
||||
// They are intended to closely follow the module test case structure in the
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt --split-input-file -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt --split-input-file -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
|
||||
firrtl.circuit "ReadOnlyMemory" {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: hw.module @extract_noop(in %arg0 : i3, out "" : i3) {
|
||||
// CHECK-NEXT: hw.output %arg0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// NOTE: Assertions have been autogenerated by utils/generate-test-checks.py
|
||||
|
||||
// RUN: circt-opt -split-input-file -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt -split-input-file -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: handshake.func @simple(
|
||||
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=true' | FileCheck %s
|
||||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=aggressive' | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: @const_hoisting
|
||||
// CHECK-SAME: %[[SIG:.*]]: !llhd.sig<i32>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=true' | FileCheck %s
|
||||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=aggressive' | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: @sigExtractOp
|
||||
func.func @sigExtractOp(%arg0 : !llhd.sig<i32>, %arg1: i5) -> (!llhd.sig<i32>, !llhd.sig<i32>) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=true' | FileCheck %s
|
||||
// RUN: circt-opt %s -canonicalize='top-down=true region-simplify=aggressive' | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: @drv_folding
|
||||
// CHECK-SAME: %[[SIG:.*]]: !llhd.sig<i32>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=true' %s | FileCheck %s
|
||||
// RUN: circt-opt -canonicalize='top-down=true region-simplify=aggressive' %s | FileCheck %s
|
||||
|
||||
// CHECK-LABEL: func @if_dead_condition(%arg0: i1) {
|
||||
// CHECK-NEXT: [[FD:%.*]] = hw.constant -2147483646 : i32
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "circt/InitAllPasses.h"
|
||||
#include "circt/Support/LoweringOptions.h"
|
||||
#include "circt/Support/Version.h"
|
||||
#include "mlir/Conversion/Passes.h"
|
||||
#include "mlir/Dialect/Affine/IR/AffineOps.h"
|
||||
#include "mlir/Dialect/Arith/IR/Arith.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
|
||||
|
@ -67,6 +68,7 @@ int main(int argc, char **argv) {
|
|||
mlir::registerCanonicalizerPass();
|
||||
mlir::registerViewOpGraphPass();
|
||||
mlir::registerSymbolDCEPass();
|
||||
mlir::registerReconcileUnrealizedCastsPass();
|
||||
llvm::cl::AddExtraVersionPrinter(
|
||||
[](llvm::raw_ostream &os) { os << circt::getCirctVersion() << '\n'; });
|
||||
|
||||
|
|
|
@ -228,7 +228,7 @@ static LoweringOptionsOption loweringOptions(mainCategory);
|
|||
static std::unique_ptr<Pass> createSimpleCanonicalizerPass() {
|
||||
mlir::GreedyRewriteConfig config;
|
||||
config.useTopDownTraversal = true;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
return mlir::createCanonicalizerPass(config);
|
||||
}
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ static LoweringOptionsOption loweringOptions(mainCategory);
|
|||
static std::unique_ptr<Pass> createSimpleCanonicalizerPass() {
|
||||
mlir::GreedyRewriteConfig config;
|
||||
config.useTopDownTraversal = true;
|
||||
config.enableRegionSimplification = false;
|
||||
config.enableRegionSimplification = mlir::GreedySimplifyRegionLevel::Disabled;
|
||||
return mlir::createCanonicalizerPass(config);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "circt/Dialect/LLHD/Simulator/Trace.h"
|
||||
#include "circt/Support/Version.h"
|
||||
|
||||
#include "mlir/Conversion/ReconcileUnrealizedCasts/ReconcileUnrealizedCasts.h"
|
||||
#include "mlir/Dialect/ControlFlow/IR/ControlFlow.h"
|
||||
#include "mlir/Dialect/Func/IR/FuncOps.h"
|
||||
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
|
||||
|
@ -156,6 +157,7 @@ static LogicalResult applyMLIRPasses(ModuleOp module) {
|
|||
PassManager pm(module.getContext());
|
||||
|
||||
pm.addPass(createConvertLLHDToLLVMPass());
|
||||
pm.addPass(::mlir::createReconcileUnrealizedCastsPass());
|
||||
|
||||
return pm.run(module);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue