Skip to content

Commit 5678a83

Browse files
committed
[LLVM] bump to 747d4a95
1 parent fdb946e commit 5678a83

File tree

10 files changed

+36
-37
lines changed

10 files changed

+36
-37
lines changed

lib/Dialect/FIRRTL/Transforms/CheckCombLoops.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class DiscoverLoops {
100100
// destination and the second is the source.
101101
for (auto [dest, source] : df.computeDataFlow())
102102
addDrivenBy(dest, source);
103-
104103
})
105104
.Case<Forceable>([&](Forceable forceableOp) {
106105
// Any declaration that can be forced.
@@ -613,12 +612,12 @@ class DiscoverLoops {
613612
llvm::dbgs() << "\n node:" << getName(drivenBy[node.first].first)
614613
<< "=> probe:" << getName(drivenBy[node.second].first);
615614
}
616-
for (auto i = rwProbeClasses.begin(), e = rwProbeClasses.end(); i != e;
617-
++i) { // Iterate over all of the equivalence sets.
615+
for (const auto &i : rwProbeClasses) {
616+
// Iterate over all of the equivalence sets.
618617
if (!i->isLeader())
619618
continue; // Ignore non-leader sets.
620619
// Print members in this set.
621-
llvm::interleave(llvm::make_range(rwProbeClasses.member_begin(i),
620+
llvm::interleave(llvm::make_range(rwProbeClasses.member_begin(*i),
622621
rwProbeClasses.member_end()),
623622
llvm::dbgs(), "\n");
624623
llvm::dbgs() << "\n dataflow at leader::" << i->getData() << "\n =>"
@@ -649,13 +648,12 @@ class DiscoverLoops {
649648
if (auto defOp = dyn_cast_or_null<Forceable>(baseFieldRef.getDefiningOp()))
650649
if (defOp.isForceable() && !defOp.getDataRef().use_empty()) {
651650
// Assumption, the probe must exist in the equivalence classes.
652-
auto rwProbeNode =
651+
unsigned rwProbeNode =
653652
rwProbeClasses.getLeaderValue(getOrAddNode(defOp.getDataRef()));
654653
// For all the probes, that are in the same eqv class, i.e., refer to
655654
// the same value.
656655
for (auto probe :
657-
llvm::make_range(rwProbeClasses.member_begin(
658-
rwProbeClasses.findValue(rwProbeNode)),
656+
llvm::make_range(rwProbeClasses.findLeader(rwProbeNode),
659657
rwProbeClasses.member_end())) {
660658
auto probeVal = drivenBy[probe].first;
661659
// If the probe is a port, then record the path from the probe to the

lib/Dialect/FIRRTL/Transforms/InferResets.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,11 +1028,10 @@ LogicalResult InferResetsPass::inferAndUpdateResets() {
10281028
llvm::dbgs() << "\n";
10291029
debugHeader("Infer reset types") << "\n\n";
10301030
});
1031-
for (auto it = resetClasses.begin(), end = resetClasses.end(); it != end;
1032-
++it) {
1031+
for (const auto &it : resetClasses) {
10331032
if (!it->isLeader())
10341033
continue;
1035-
ResetNetwork net = llvm::make_range(resetClasses.member_begin(it),
1034+
ResetNetwork net = llvm::make_range(resetClasses.member_begin(*it),
10361035
resetClasses.member_end());
10371036

10381037
// Infer whether this should be a sync or async reset.

lib/Dialect/FIRRTL/Transforms/LowerXMR.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class LowerXMRPass : public circt::firrtl::impl::LowerXMRBase<LowerXMRPass> {
130130
CircuitNamespace ns(getOperation());
131131
circuitNamespace = &ns;
132132

133-
llvm::EquivalenceClasses<Value, ValueComparator> eq;
133+
llvm::EquivalenceClasses<Value> eq;
134134
dataFlowClasses = &eq;
135135

136136
InstanceGraph &instanceGraph = getAnalysis<InstanceGraph>();
@@ -370,12 +370,12 @@ class LowerXMRPass : public circt::firrtl::impl::LowerXMRBase<LowerXMRPass> {
370370
}
371371

372372
LLVM_DEBUG({
373-
for (auto I = dataFlowClasses->begin(), E = dataFlowClasses->end();
374-
I != E; ++I) { // Iterate over all of the equivalence sets.
373+
for (const auto &I : *dataFlowClasses) {
374+
// Iterate over all of the equivalence sets.
375375
if (!I->isLeader())
376376
continue; // Ignore non-leader sets.
377377
// Print members in this set.
378-
llvm::interleave(llvm::make_range(dataFlowClasses->member_begin(I),
378+
llvm::interleave(llvm::make_range(dataFlowClasses->member_begin(*I),
379379
dataFlowClasses->member_end()),
380380
llvm::dbgs(), "\n");
381381
llvm::dbgs() << "\n dataflow at leader::" << I->getData() << "\n =>";
@@ -887,15 +887,7 @@ class LowerXMRPass : public circt::firrtl::impl::LowerXMRBase<LowerXMRPass> {
887887
/// no NextNodeOnPath, which denotes a leaf node on the path.
888888
SmallVector<XMRNode> refSendPathList;
889889

890-
/// llvm::EquivalenceClasses wants comparable elements. This comparator uses
891-
/// uses pointer comparison on the Impl.
892-
struct ValueComparator {
893-
bool operator()(const Value &lhs, const Value &rhs) const {
894-
return lhs.getImpl() < rhs.getImpl();
895-
}
896-
};
897-
898-
llvm::EquivalenceClasses<Value, ValueComparator> *dataFlowClasses;
890+
llvm::EquivalenceClasses<Value> *dataFlowClasses;
899891
// Instance and module ref ports that needs to be removed.
900892
DenseMap<Operation *, llvm::BitVector> refPortsToRemoveMap;
901893

lib/Dialect/HW/Transforms/FlattenModules.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "circt/Support/BackedgeBuilder.h"
1313
#include "mlir/IR/IRMapping.h"
1414
#include "mlir/Pass/Pass.h"
15+
#include "mlir/Transforms/Inliner.h"
1516
#include "mlir/Transforms/InliningUtils.h"
1617
#include "llvm/ADT/PostOrderIterator.h"
1718
#include "llvm/Support/Debug.h"
@@ -128,9 +129,10 @@ void FlattenModulesPass::runOnOperation() {
128129
continue;
129130

130131
bool isLastModuleUse = --numUsesLeft == 0;
131-
132+
mlir::InlinerConfig config;
132133
PrefixingInliner inliner(&getContext(), inst.getInstanceName());
133-
if (failed(mlir::inlineRegion(inliner, &module.getBody(), inst,
134+
if (failed(mlir::inlineRegion(inliner, config.getCloneCallback(),
135+
&module.getBody(), inst,
134136
inst.getOperands(), inst.getResults(),
135137
std::nullopt, !isLastModuleUse))) {
136138
inst.emitError("failed to inline '")

lib/Dialect/LLHD/Transforms/FunctionEliminationPass.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "mlir/IR/Visitors.h"
1919
#include "mlir/Interfaces/CallInterfaces.h"
2020
#include "mlir/Pass/Pass.h"
21+
#include "mlir/Transforms/Inliner.h"
2122
#include "mlir/Transforms/InliningUtils.h"
2223
#include "llvm/Support/LogicalResult.h"
2324

@@ -81,8 +82,9 @@ LogicalResult FunctionEliminationPass::runOnModule(hw::HWModuleOp module) {
8182
auto func = cast<CallableOpInterface>(
8283
table.lookupNearestSymbolFrom(module, symbol.getLeafReference()));
8384

84-
if (succeeded(
85-
mlir::inlineCall(inliner, call, func, func.getCallableRegion()))) {
85+
mlir::InlinerConfig config;
86+
if (succeeded(mlir::inlineCall(inliner, config.getCloneCallback(), call,
87+
func, func.getCallableRegion()))) {
8688
call->erase();
8789
continue;
8890
}

llvm

Submodule llvm updated 8771 files

test/Dialect/Moore/types-errors.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
// RUN: circt-opt --verify-diagnostics --split-input-file %s
22

33
// -----
4-
// expected-error @below {{invalid kind of Type specified}}
4+
// expected-error @below {{invalid kind of type specified}}
55
// expected-error @below {{parameter 'elementType' which is to be a `PackedType`}}
66
unrealized_conversion_cast to !moore.array<4 x string>
77

88
// -----
9-
// expected-error @below {{invalid kind of Type specified}}
9+
// expected-error @below {{invalid kind of type specified}}
1010
// expected-error @below {{parameter 'elementType' which is to be a `PackedType`}}
1111
unrealized_conversion_cast to !moore.open_array<string>
1212

tools/arcilator/arcilator.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,11 @@ static LogicalResult processBuffer(
461461

462462
mlir::ExecutionEngineOptions engineOptions;
463463
engineOptions.jitCodeGenOptLevel = llvm::CodeGenOptLevel::Aggressive;
464-
engineOptions.transformer = mlir::makeOptimizingTransformer(
465-
/*optLevel=*/3, /*sizeLevel=*/0,
466-
/*targetMachine=*/nullptr);
464+
static std::function<llvm::Error(llvm::Module *)> transformer =
465+
mlir::makeOptimizingTransformer(
466+
/*optLevel=*/3, /*sizeLevel=*/0,
467+
/*targetMachine=*/nullptr);
468+
engineOptions.transformer = transformer;
467469
engineOptions.sharedLibPaths = sharedLibraries;
468470

469471
auto executionEngine =

tools/circt-bmc/circt-bmc.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ static LogicalResult executeBMC(MLIRContext &context) {
264264
SmallVector<StringRef, 4> sharedLibraries(sharedLibs.begin(),
265265
sharedLibs.end());
266266
mlir::ExecutionEngineOptions engineOptions;
267-
engineOptions.transformer = mlir::makeOptimizingTransformer(
268-
/*optLevel*/ 3, /*sizeLevel=*/0, /*targetMachine=*/nullptr);
267+
static std::function<llvm::Error(llvm::Module *)> transformer =
268+
mlir::makeOptimizingTransformer(
269+
/*optLevel*/ 3, /*sizeLevel=*/0, /*targetMachine=*/nullptr);
270+
engineOptions.transformer = transformer;
269271
engineOptions.jitCodeGenOptLevel = llvm::CodeGenOptLevel::Aggressive;
270272
engineOptions.sharedLibPaths = sharedLibraries;
271273
engineOptions.enableObjectDump = true;

tools/circt-lec/circt-lec.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,10 @@ static LogicalResult executeLEC(MLIRContext &context) {
304304
SmallVector<StringRef, 4> sharedLibraries(sharedLibs.begin(),
305305
sharedLibs.end());
306306
mlir::ExecutionEngineOptions engineOptions;
307-
engineOptions.transformer = mlir::makeOptimizingTransformer(
308-
/*optLevel*/ 3, /*sizeLevel=*/0, /*targetMachine=*/nullptr);
307+
static std::function<llvm::Error(llvm::Module *)> transformer =
308+
mlir::makeOptimizingTransformer(
309+
/*optLevel*/ 3, /*sizeLevel=*/0, /*targetMachine=*/nullptr);
310+
engineOptions.transformer = transformer;
309311
engineOptions.jitCodeGenOptLevel = llvm::CodeGenOptLevel::Aggressive;
310312
engineOptions.sharedLibPaths = sharedLibraries;
311313
engineOptions.enableObjectDump = true;

0 commit comments

Comments
 (0)