[Mlir-commits] [mlir] 2164678 - [mlir] Fix a few more TypeSize::Fixed->TypeSize::getFixed following #72979.
Sander de Smalen
llvmlistbot at llvm.org
Wed Nov 22 01:08:01 PST 2023
Author: Sander de Smalen
Date: 2023-11-22T09:06:28Z
New Revision: 21646789497346a1a8dabb4b369e12db482b4daa
URL: https://github.com/llvm/llvm-project/commit/21646789497346a1a8dabb4b369e12db482b4daa
DIFF: https://github.com/llvm/llvm-project/commit/21646789497346a1a8dabb4b369e12db482b4daa.diff
LOG: [mlir] Fix a few more TypeSize::Fixed->TypeSize::getFixed following #72979.
Added:
Modified:
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
mlir/lib/Interfaces/DataLayoutInterfaces.cpp
mlir/test/lib/Dialect/Test/TestTypes.cpp
mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
index 3af980b308e3b83..443e245887ea8e5 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
@@ -181,7 +181,8 @@ LLVMArrayType::verify(function_ref<InFlightDiagnostic()> emitError,
llvm::TypeSize
LLVMArrayType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const {
- return llvm::TypeSize::Fixed(kBitsInByte * getTypeSize(dataLayout, params));
+ return llvm::TypeSize::getFixed(kBitsInByte *
+ getTypeSize(dataLayout, params));
}
llvm::TypeSize LLVMArrayType::getTypeSize(const DataLayout &dataLayout,
@@ -305,7 +306,7 @@ LLVMPointerType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const {
if (std::optional<uint64_t> size =
getPointerDataLayoutEntry(params, *this, PtrDLEntryPos::Size))
- return llvm::TypeSize::Fixed(*size);
+ return llvm::TypeSize::getFixed(*size);
// For other memory spaces, use the size of the pointer to the default memory
// space.
@@ -492,7 +493,7 @@ LLVMStructType::verify(function_ref<InFlightDiagnostic()> emitError,
llvm::TypeSize
LLVMStructType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const {
- auto structSize = llvm::TypeSize::Fixed(0);
+ auto structSize = llvm::TypeSize::getFixed(0);
uint64_t structAlignment = 1;
for (Type element : getBody()) {
uint64_t elementAlignment =
diff --git a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
index dda011e95de3ae1..1178417fd2a6ca8 100644
--- a/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
+++ b/mlir/lib/Interfaces/DataLayoutInterfaces.cpp
@@ -52,7 +52,7 @@ llvm::TypeSize
mlir::detail::getDefaultTypeSizeInBits(Type type, const DataLayout &dataLayout,
DataLayoutEntryListRef params) {
if (isa<IntegerType, FloatType>(type))
- return llvm::TypeSize::Fixed(type.getIntOrFloatBitWidth());
+ return llvm::TypeSize::getFixed(type.getIntOrFloatBitWidth());
if (auto ctype = dyn_cast<ComplexType>(type)) {
Type et = ctype.getElementType();
diff --git a/mlir/test/lib/Dialect/Test/TestTypes.cpp b/mlir/test/lib/Dialect/Test/TestTypes.cpp
index cb7ef7f17499999..2f4c9b689069b89 100644
--- a/mlir/test/lib/Dialect/Test/TestTypes.cpp
+++ b/mlir/test/lib/Dialect/Test/TestTypes.cpp
@@ -262,7 +262,7 @@ void TestTypeWithLayoutType::print(AsmPrinter &printer) const {
llvm::TypeSize
TestTypeWithLayoutType::getTypeSizeInBits(const DataLayout &dataLayout,
DataLayoutEntryListRef params) const {
- return llvm::TypeSize::Fixed(extractKind(params, "size"));
+ return llvm::TypeSize::getFixed(extractKind(params, "size"));
}
uint64_t
diff --git a/mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp b/mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
index a27b95ca4614b01..21b9e7b5ac2c26e 100644
--- a/mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
+++ b/mlir/unittests/Interfaces/DataLayoutInterfacesTest.cpp
@@ -92,7 +92,7 @@ struct SingleQueryType
llvm::report_fatal_error("repeated call");
executed = true;
- return llvm::TypeSize::Fixed(1);
+ return llvm::TypeSize::getFixed(1);
}
uint64_t getABIAlignment(const DataLayout &layout,
@@ -161,10 +161,10 @@ struct OpWithLayout : public Op<OpWithLayout, DataLayoutOpInterface::Trait> {
if (auto iType = dyn_cast<IntegerType>(type)) {
for (DataLayoutEntryInterface entry : params)
if (llvm::dyn_cast_if_present<Type>(entry.getKey()) == type)
- return llvm::TypeSize::Fixed(
+ return llvm::TypeSize::getFixed(
8 *
cast<IntegerAttr>(entry.getValue()).getValue().getZExtValue());
- return llvm::TypeSize::Fixed(8 * iType.getIntOrFloatBitWidth());
+ return llvm::TypeSize::getFixed(8 * iType.getIntOrFloatBitWidth());
}
// Use the default process for everything else.
More information about the Mlir-commits
mailing list