Skip to content

Commit c8b2700

Browse files
rwy7mikeurbach
authored andcommitted
Bump LLVM (#6207)
There were three breaking changes in LLVM: 1: In the LLVM dialect, NullOp was replaced with a more general ZeroOp. See: llvm/llvm-project#67183. 2: AffineForOp's getInitOperands was renamed to getInits. See: llvm/llvm-project#66925. 3: In the SCF dialect, the WhileOp now implements LoopLikeOpInterface, which now supports multiple loop regions. The getLoopBody member-function was removed in favour of LoopLike's getLoopRegions. The While Op only has a single region, so we can replace calls to getLoopBody with getRegion. See: llvm/llvm-project#66754
1 parent b2f954f commit c8b2700

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

lib/Conversion/AffineToLoopSchedule/AffineToLoopSchedule.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,7 @@ LogicalResult AffineToLoopSchedule::createLoopSchedulePipeline(
423423

424424
SmallVector<Value> iterArgs;
425425
iterArgs.push_back(lowerBound);
426-
iterArgs.append(innerLoop.getIterOperands().begin(),
427-
innerLoop.getIterOperands().end());
426+
iterArgs.append(innerLoop.getInits().begin(), innerLoop.getInits().end());
428427

429428
// If possible, attach a constant trip count attribute. This could be
430429
// generalized to support non-constant trip counts by supporting an AffineMap.

lib/Conversion/LLHDToLLVM/LLHDToLLVM.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,7 +1087,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
10871087
auto oneC = initBuilder.create<LLVM::ConstantOp>(
10881088
op->getLoc(), i32Ty, rewriter.getI32IntegerAttr(1));
10891089
auto regNull =
1090-
initBuilder.create<LLVM::NullOp>(op->getLoc(), regStatePtrTy);
1090+
initBuilder.create<LLVM::ZeroOp>(op->getLoc(), regStatePtrTy);
10911091
auto regGep = initBuilder.create<LLVM::GEPOp>(
10921092
op->getLoc(), regStatePtrTy, regNull, ArrayRef<Value>({oneC}));
10931093
auto regSize =
@@ -1157,7 +1157,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
11571157
op.getLoc(), i32Ty, rewriter.getI32IntegerAttr(1));
11581158
auto twoC = initBuilder.create<LLVM::ConstantOp>(
11591159
op.getLoc(), i64Ty, rewriter.getI32IntegerAttr(2));
1160-
auto nullPtr = initBuilder.create<LLVM::NullOp>(
1160+
auto nullPtr = initBuilder.create<LLVM::ZeroOp>(
11611161
op.getLoc(), LLVM::LLVMPointerType::get(underlyingTy));
11621162
auto sizeGep = initBuilder.create<LLVM::GEPOp>(
11631163
op.getLoc(), LLVM::LLVMPointerType::get(underlyingTy), nullPtr,
@@ -1210,7 +1210,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
12101210
rewriter.getI32IntegerAttr(arrayTy.getNumElements()));
12111211

12121212
// Get element size.
1213-
auto null = initBuilder.create<LLVM::NullOp>(
1213+
auto null = initBuilder.create<LLVM::ZeroOp>(
12141214
op.getLoc(), LLVM::LLVMPointerType::get(arrayTy));
12151215
auto gepFirst = initBuilder.create<LLVM::GEPOp>(
12161216
op.getLoc(), LLVM::LLVMPointerType::get(arrayTy.getElementType()),
@@ -1227,7 +1227,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
12271227
auto zeroC = initBuilder.create<LLVM::ConstantOp>(
12281228
op.getLoc(), i32Ty, rewriter.getI32IntegerAttr(0));
12291229

1230-
auto null = initBuilder.create<LLVM::NullOp>(
1230+
auto null = initBuilder.create<LLVM::ZeroOp>(
12311231
op.getLoc(), LLVM::LLVMPointerType::get(structTy));
12321232
for (size_t i = 0, e = structTy.getBody().size(); i < e; ++i) {
12331233
auto oneC = initBuilder.create<LLVM::ConstantOp>(
@@ -1243,7 +1243,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
12431243
op.getLoc(), i32Ty, gepElem);
12441244

12451245
// Get element size.
1246-
auto elemNull = initBuilder.create<LLVM::NullOp>(
1246+
auto elemNull = initBuilder.create<LLVM::ZeroOp>(
12471247
op.getLoc(), LLVM::LLVMPointerType::get(structTy.getBody()[i]));
12481248
auto gepElemSize = initBuilder.create<LLVM::GEPOp>(
12491249
op.getLoc(), LLVM::LLVMPointerType::get(structTy.getBody()[i]),
@@ -1283,7 +1283,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
12831283

12841284
// Malloc space for the process state.
12851285
auto procStateNullPtr =
1286-
initBuilder.create<LLVM::NullOp>(op->getLoc(), procStatePtrTy);
1286+
initBuilder.create<LLVM::ZeroOp>(op->getLoc(), procStatePtrTy);
12871287
auto procStateGep = initBuilder.create<LLVM::GEPOp>(
12881288
op->getLoc(), procStatePtrTy, procStateNullPtr,
12891289
ArrayRef<Value>({oneC}));
@@ -1307,7 +1307,7 @@ struct InstOpConversion : public ConvertToLLVMPattern {
13071307

13081308
// Malloc space for the senses table.
13091309
auto sensesNullPtr =
1310-
initBuilder.create<LLVM::NullOp>(op->getLoc(), sensesPtrTy);
1310+
initBuilder.create<LLVM::ZeroOp>(op->getLoc(), sensesPtrTy);
13111311
auto sensesGep = initBuilder.create<LLVM::GEPOp>(
13121312
op->getLoc(), sensesPtrTy, sensesNullPtr, ArrayRef<Value>({oneC}));
13131313
auto sensesSize =
@@ -1512,7 +1512,7 @@ struct DrvOpConversion : public ConvertToLLVMPattern {
15121512
op->getLoc(), i32Ty, rewriter.getI32IntegerAttr(1));
15131513
auto eightC = rewriter.create<LLVM::ConstantOp>(
15141514
op->getLoc(), i64Ty, rewriter.getI64IntegerAttr(8));
1515-
auto nullPtr = rewriter.create<LLVM::NullOp>(op->getLoc(), llvmPtrTy);
1515+
auto nullPtr = rewriter.create<LLVM::ZeroOp>(op->getLoc(), llvmPtrTy);
15161516
auto gepOne = rewriter.create<LLVM::GEPOp>(
15171517
op->getLoc(), llvmPtrTy, nullPtr, ArrayRef<Value>(oneC));
15181518
auto toInt =

lib/Conversion/SCFToCalyx/SCFToCalyx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ class ScfForOp : public calyx::RepeatOpInterface<scf::ForOp> {
7373
explicit ScfForOp(scf::ForOp op) : calyx::RepeatOpInterface<scf::ForOp>(op) {}
7474

7575
Block::BlockArgListType getBodyArgs() override {
76-
return getOperation().getLoopBody().getArguments();
76+
return getOperation().getRegion().getArguments();
7777
}
7878

7979
Block *getBodyBlock() override {
80-
return &getOperation().getLoopBody().getBlocks().front();
80+
return &getOperation().getRegion().getBlocks().front();
8181
}
8282

8383
std::optional<int64_t> getBound() override {

llvm

Submodule llvm updated 7429 files

test/Conversion/LLHDToLLVM/convert_signals.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ llhd.entity @convert_prb (%sI1 : !llhd.sig<i1>, %sArr : !llhd.sig<!hw.array<3xi5
7878
// CHECK: llvm.call @driveSignal(%[[VAL_0]], %[[VAL_4]], %[[VAL_17]], %[[VAL_14]], %[[VAL_18]], %[[VAL_19]], %[[VAL_20]]) : (!llvm.ptr, !llvm.ptr<struct<(ptr, i64, i64, i64)>>, !llvm.ptr, i64, i64, i64, i64) -> ()
7979
// CHECK: %[[VAL_21:.*]] = llvm.mlir.constant(1 : i32) : i32
8080
// CHECK: %[[VAL_22:.*]] = llvm.mlir.constant(8 : i64) : i64
81-
// CHECK: %[[VAL_23:.*]] = llvm.mlir.null : !llvm.ptr<array<3 x i5>>
81+
// CHECK: %[[VAL_23:.*]] = llvm.mlir.zero : !llvm.ptr<array<3 x i5>>
8282
// CHECK: %[[VAL_24:.*]] = llvm.getelementptr %[[VAL_23]]{{\[}}%[[VAL_21]]] : (!llvm.ptr<array<3 x i5>>, i32) -> !llvm.ptr<array<3 x i5>>
8383
// CHECK: %[[VAL_25:.*]] = llvm.ptrtoint %[[VAL_24]] : !llvm.ptr<array<3 x i5>> to i64
8484
// CHECK: %[[VAL_26:.*]] = llvm.mul %[[VAL_25]], %[[VAL_22]] : i64

0 commit comments

Comments
 (0)