Skip to content

Commit 2164678

Browse files
committed
[mlir] Fix a few more TypeSize::Fixed->TypeSize::getFixed following #72979.
1 parent 81b7f11 commit 2164678

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ LLVMArrayType::verify(function_ref<InFlightDiagnostic()> emitError,
181181
llvm::TypeSize
182182
LLVMArrayType::getTypeSizeInBits(const DataLayout &dataLayout,
183183
DataLayoutEntryListRef params) const {
184-
return llvm::TypeSize::Fixed(kBitsInByte * getTypeSize(dataLayout, params));
184+
return llvm::TypeSize::getFixed(kBitsInByte *
185+
getTypeSize(dataLayout, params));
185186
}
186187

187188
llvm::TypeSize LLVMArrayType::getTypeSize(const DataLayout &dataLayout,
@@ -305,7 +306,7 @@ LLVMPointerType::getTypeSizeInBits(const DataLayout &dataLayout,
305306
DataLayoutEntryListRef params) const {
306307
if (std::optional<uint64_t> size =
307308
getPointerDataLayoutEntry(params, *this, PtrDLEntryPos::Size))
308-
return llvm::TypeSize::Fixed(*size);
309+
return llvm::TypeSize::getFixed(*size);
309310

310311
// For other memory spaces, use the size of the pointer to the default memory
311312
// space.
@@ -492,7 +493,7 @@ LLVMStructType::verify(function_ref<InFlightDiagnostic()> emitError,
492493
llvm::TypeSize
493494
LLVMStructType::getTypeSizeInBits(const DataLayout &dataLayout,
494495
DataLayoutEntryListRef params) const {
495-
auto structSize = llvm::TypeSize::Fixed(0);
496+
auto structSize = llvm::TypeSize::getFixed(0);
496497
uint64_t structAlignment = 1;
497498
for (Type element : getBody()) {
498499
uint64_t elementAlignment =

mlir/lib/Interfaces/DataLayoutInterfaces.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ llvm::TypeSize
5252
mlir::detail::getDefaultTypeSizeInBits(Type type, const DataLayout &dataLayout,
5353
DataLayoutEntryListRef params) {
5454
if (isa<IntegerType, FloatType>(type))
55-
return llvm::TypeSize::Fixed(type.getIntOrFloatBitWidth());
55+
return llvm::TypeSize::getFixed(type.getIntOrFloatBitWidth());
5656

5757
if (auto ctype = dyn_cast<ComplexType>(type)) {
5858
Type et = ctype.getElementType();

mlir/test/lib/Dialect/Test/TestTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void TestTypeWithLayoutType::print(AsmPrinter &printer) const {
262262
llvm::TypeSize
263263
TestTypeWithLayoutType::getTypeSizeInBits(const DataLayout &dataLayout,
264264
DataLayoutEntryListRef params) const {
265-
return llvm::TypeSize::Fixed(extractKind(params, "size"));
265+
return llvm::TypeSize::getFixed(extractKind(params, "size"));
266266
}
267267

268268
uint64_t

mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ struct SingleQueryType
9292
llvm::report_fatal_error("repeated call");
9393

9494
executed = true;
95-
return llvm::TypeSize::Fixed(1);
95+
return llvm::TypeSize::getFixed(1);
9696
}
9797

9898
uint64_t getABIAlignment(const DataLayout &layout,
@@ -161,10 +161,10 @@ struct OpWithLayout : public Op<OpWithLayout, DataLayoutOpInterface::Trait> {
161161
if (auto iType = dyn_cast<IntegerType>(type)) {
162162
for (DataLayoutEntryInterface entry : params)
163163
if (llvm::dyn_cast_if_present<Type>(entry.getKey()) == type)
164-
return llvm::TypeSize::Fixed(
164+
return llvm::TypeSize::getFixed(
165165
8 *
166166
cast<IntegerAttr>(entry.getValue()).getValue().getZExtValue());
167-
return llvm::TypeSize::Fixed(8 * iType.getIntOrFloatBitWidth());
167+
return llvm::TypeSize::getFixed(8 * iType.getIntOrFloatBitWidth());
168168
}
169169

170170
// Use the default process for everything else.

0 commit comments

Comments
 (0)