Skip to content

Commit fdfc673

Browse files
authored
Bump LLVM to ebc7efbab5c58b46f7215d63be6d0208cb588192. (#8089)
This is a relatively straightforward LLVM bump, but there were a few things updated here. llvm/llvm-project@abba01a This updated PointerUnion to deprecate get and is in favor of llvm::cast and llvm::isa, so this PR updates the relevant callsites. llvm/llvm-project@f023da1 This updated FloatType to remove the helpers like getF64. FloatType was previously turned into a TypeInterface, and the helpers are now static get methods on the concrete FloatType implementations, so this PR updates FloatType::getF64 to Float64Type::get. llvm/llvm-project@b39c5cb6 This updated InlinerInterface to add a new allowSingleBlockOptimization method. We need to define that on our PrefixInliner, or else we will hit the new assertion.
1 parent 76cc791 commit fdfc673

File tree

16 files changed

+37
-30
lines changed

16 files changed

+37
-30
lines changed

include/circt/Dialect/Arc/ArcOps.td

+3-3
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def StateOp : ArcOp<"state", [
235235

236236
/// Set the callee for this operation.
237237
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
238-
(*this)->setAttr(getArcAttrName(), callee.get<mlir::SymbolRefAttr>());
238+
(*this)->setAttr(getArcAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
239239
}
240240
}];
241241
}
@@ -276,7 +276,7 @@ def CallOp : ArcOp<"call", [
276276

277277
/// Set the callee for this operation.
278278
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
279-
(*this)->setAttr(getArcAttrName(), callee.get<mlir::SymbolRefAttr>());
279+
(*this)->setAttr(getArcAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
280280
}
281281
}];
282282
}
@@ -365,7 +365,7 @@ def MemoryWritePortOp : ArcOp<"memory_write_port", [
365365

366366
/// Set the callee for this operation.
367367
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
368-
(*this)->setAttr(getArcAttrName(), callee.get<mlir::SymbolRefAttr>());
368+
(*this)->setAttr(getArcAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
369369
}
370370
}];
371371
}

include/circt/Dialect/Handshake/HandshakeOps.td

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def ESIInstanceOp : Op<Handshake_Dialect, "esi_instance", [
180180

181181
/// Set the callee for this operation.
182182
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
183-
(*this)->setAttr(getModuleAttrName(), callee.get<mlir::SymbolRefAttr>());
183+
(*this)->setAttr(getModuleAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
184184
}
185185

186186
MutableOperandRange getArgOperandsMutable() {
@@ -251,7 +251,7 @@ def InstanceOp : Handshake_Op<"instance", [
251251

252252
/// Set the callee for this operation.
253253
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
254-
(*this)->setAttr(getModuleAttrName(), callee.get<mlir::SymbolRefAttr>());
254+
(*this)->setAttr(getModuleAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
255255
}
256256

257257
/// Get the control operand of this instance op

include/circt/Dialect/Kanagawa/KanagawaOps.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def CallOp : KanagawaOp<"call", [
459459

460460
/// Set the callee for this operation.
461461
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
462-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
462+
(*this)->setAttr(getCalleeAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
463463
}
464464

465465
/// Return the callee of this operation.

include/circt/Dialect/SV/SVStatements.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ class SVFuncCallBase<string mnemonic, list<Trait> traits = []>: SVOp<mnemonic,
10641064

10651065
/// Set the callee for this operation.
10661066
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
1067-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
1067+
(*this)->setAttr(getCalleeAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
10681068
}
10691069
}];
10701070
}

include/circt/Dialect/Sim/SimOps.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def DPICallOp : SimOp<"func.dpi.call",
143143

144144
/// Set the callee for this operation.
145145
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
146-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
146+
(*this)->setAttr(getCalleeAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
147147
}
148148
}];
149149

include/circt/Dialect/SystemC/SystemCStatements.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def CallOp : SystemCOp<"cpp.call", [
361361

362362
/// Set the callee for this operation.
363363
void setCalleeFromCallable(mlir::CallInterfaceCallable callee) {
364-
(*this)->setAttr(getCalleeAttrName(), callee.get<mlir::SymbolRefAttr>());
364+
(*this)->setAttr(getCalleeAttrName(), llvm::cast<mlir::SymbolRefAttr>(callee));
365365
}
366366

367367
}];

lib/Conversion/ConvertToArcs/ConvertToArcs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ LogicalResult Converter::absorbRegs(HWModuleOp module) {
357357
rewriter.setInsertionPoint(callOp);
358358
arc = rewriter.replaceOpWithNewOp<StateOp>(
359359
callOp.getOperation(),
360-
callOp.getCallableForCallee().get<SymbolRefAttr>(),
360+
llvm::cast<SymbolRefAttr>(callOp.getCallableForCallee()),
361361
callOp->getResultTypes(), clock, Value{}, 1, callOp.getArgOperands());
362362
}
363363

lib/Conversion/ExportVerilog/ExportVerilogInternals.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ class StringOrOpToEmit {
309309

310310
/// This method transforms the entry from an operation to a string value.
311311
void setString(StringRef value) {
312-
assert(pointerData.is<Operation *>() && "shouldn't already be a string");
312+
assert(llvm::isa<Operation *>(pointerData) &&
313+
"shouldn't already be a string");
313314
length = value.size();
314315
void *data = malloc(length);
315316
memcpy(data, value.data(), length);

lib/Dialect/Arc/Transforms/ArcCanonicalizer.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,8 @@ LogicalResult canonicalizePassthoughCall(mlir::CallOpInterface callOp,
282282
SymbolHandler &symbolCache,
283283
PatternRewriter &rewriter) {
284284
auto defOp = cast<DefineOp>(symbolCache.getDefinition(
285-
callOp.getCallableForCallee().get<SymbolRefAttr>().getLeafReference()));
285+
llvm::cast<SymbolRefAttr>(callOp.getCallableForCallee())
286+
.getLeafReference()));
286287
if (defOp.isPassthrough()) {
287288
symbolCache.removeUser(defOp, callOp);
288289
rewriter.replaceOp(callOp, callOp.getArgOperands());

lib/Dialect/Arc/Transforms/InlineArcs.cpp

+13-13
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,10 @@ void InlineArcsAnalysis::analyze(ArrayRef<Region *> regionsWithCalls,
188188
++numOpsInArc[arcName];
189189
if (isa<mlir::CallOpInterface>(op))
190190
// TODO: make safe
191-
callsInArcBody[arcName].push_back(cast<mlir::CallOpInterface>(op)
192-
.getCallableForCallee()
193-
.get<mlir::SymbolRefAttr>()
194-
.getLeafReference());
191+
callsInArcBody[arcName].push_back(
192+
cast<mlir::SymbolRefAttr>(
193+
cast<mlir::CallOpInterface>(op).getCallableForCallee())
194+
.getLeafReference());
195195
});
196196
if (numOpsInArc[arcName] <= options.maxNonTrivialOpsInBody)
197197
++statistics.numTrivialArcs;
@@ -207,11 +207,11 @@ void InlineArcsAnalysis::analyze(ArrayRef<Region *> regionsWithCalls,
207207

208208
for (auto *regionWithCalls : regionsWithCalls) {
209209
regionWithCalls->walk([&](mlir::CallOpInterface op) {
210-
if (!op.getCallableForCallee().is<SymbolRefAttr>())
210+
if (!isa<SymbolRefAttr>(op.getCallableForCallee()))
211211
return;
212212

213213
StringAttr arcName =
214-
op.getCallableForCallee().get<SymbolRefAttr>().getLeafReference();
214+
cast<SymbolRefAttr>(op.getCallableForCallee()).getLeafReference();
215215
if (!usersPerArc.contains(arcName))
216216
return;
217217

@@ -228,7 +228,7 @@ void InlineArcsAnalysis::analyze(ArrayRef<Region *> regionsWithCalls,
228228

229229
bool InlineArcsAnalysis::shouldInline(mlir::CallOpInterface callOp) const {
230230
// Arcs are always referenced via symbol.
231-
if (!callOp.getCallableForCallee().is<SymbolRefAttr>())
231+
if (!isa<SymbolRefAttr>(callOp.getCallableForCallee()))
232232
return false;
233233

234234
if (!callOp->getParentOfType<DefineOp>() && options.intoArcsOnly)
@@ -237,8 +237,8 @@ bool InlineArcsAnalysis::shouldInline(mlir::CallOpInterface callOp) const {
237237
// The `numOpsInArc` map contains an entry for all arcs considered. If the
238238
// callee symbol is not present, it is either not an arc or an arc that we
239239
// don't consider and thus don't want to inline.
240-
StringAttr arcName =
241-
callOp.getCallableForCallee().get<SymbolRefAttr>().getLeafReference();
240+
StringAttr arcName = llvm::cast<SymbolRefAttr>(callOp.getCallableForCallee())
241+
.getLeafReference();
242242
if (!numOpsInArc.contains(arcName))
243243
return false;
244244

@@ -259,7 +259,7 @@ bool InlineArcsAnalysis::shouldInline(mlir::CallOpInterface callOp) const {
259259

260260
DefineOp InlineArcsAnalysis::getArc(mlir::CallOpInterface callOp) const {
261261
StringAttr arcName =
262-
callOp.getCallableForCallee().get<SymbolRefAttr>().getLeafReference();
262+
cast<SymbolRefAttr>(callOp.getCallableForCallee()).getLeafReference();
263263
return arcMap.at(arcName);
264264
}
265265

@@ -280,9 +280,9 @@ size_t InlineArcsAnalysis::getNumArcUses(StringAttr arcName) const {
280280

281281
void InlineArcsAnalysis::notifyInlinedCallInto(mlir::CallOpInterface callOp,
282282
Region *region) {
283-
StringAttr calledArcName = callOp.getCallableForCallee()
284-
.get<mlir::SymbolRefAttr>()
285-
.getLeafReference();
283+
StringAttr calledArcName =
284+
cast<mlir::SymbolRefAttr>(callOp.getCallableForCallee())
285+
.getLeafReference();
286286
--usersPerArc[calledArcName];
287287
++statistics.numInlinedArcs;
288288

lib/Dialect/Arc/Transforms/LowerLUT.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ LogicalResult LutCalculator::computeTableEntries(LutOp lut) {
203203
for (int j = (1U << bw) - 1; j >= 0; j--) {
204204
Attribute foldAttr;
205205
if (!(foldAttr = dyn_cast<Attribute>(results[j][i])))
206-
foldAttr = vals[results[j][i].get<Value>()][j];
206+
foldAttr = vals[llvm::cast<Value>(results[j][i])][j];
207207
ref[j] = foldAttr;
208208
}
209209
}

lib/Dialect/FIRRTL/Transforms/LowerClasses.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ static void populateTypeConverter(TypeConverter &converter) {
21072107

21082108
// Convert FIRRTL double type to OM.
21092109
converter.addConversion(
2110-
[](DoubleType type) { return FloatType::getF64(type.getContext()); });
2110+
[](DoubleType type) { return Float64Type::get(type.getContext()); });
21112111

21122112
// Add a target materialization such that the conversion does not fail when a
21132113
// type conversion could not be reconciled automatically by the framework.

lib/Dialect/HW/Transforms/FlattenModules.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ struct PrefixingInliner : public InlinerInterface {
8585
op->setAttr("names", ArrayAttr::get(namesAttr.getContext(), names));
8686
}
8787
}
88+
89+
bool allowSingleBlockOptimization(
90+
iterator_range<Region::iterator> inlinedBlocks) const final {
91+
return true;
92+
}
8893
};
8994
} // namespace
9095

lib/Support/JSON.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Attribute circt::convertJSONToAttribute(MLIRContext *context,
101101

102102
// Float
103103
if (auto a = value.getAsNumber())
104-
return FloatAttr::get(mlir::FloatType::getF64(context), *a);
104+
return FloatAttr::get(mlir::Float64Type::get(context), *a);
105105

106106
// Boolean
107107
if (auto a = value.getAsBoolean())

llvm

Submodule llvm updated 2634 files

unittests/Support/JSONTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ TEST(JSONTest, RoundTripTypes) {
3232

3333
NamedAttrList mapping;
3434

35-
auto floatAttr = FloatAttr::get(FloatType::getF64(&context), 123.4);
35+
auto floatAttr = FloatAttr::get(Float64Type::get(&context), 123.4);
3636
mapping.append("float", floatAttr);
3737

3838
auto intAttr = IntegerAttr::get(i64ty, 567);

0 commit comments

Comments
 (0)