[Mlir-commits] [mlir] bc7456f - [mlir] Fix rank bitwidth in UnrankedMemRefType conversion.
Alexander Belyaev
llvmlistbot at llvm.org
Wed Aug 5 09:35:55 PDT 2020
Author: Alexander Belyaev
Date: 2020-08-05T18:35:23+02:00
New Revision: bc7456fd8a11e3b477060af85b00c42ca728ad7f
URL: https://github.com/llvm/llvm-project/commit/bc7456fd8a11e3b477060af85b00c42ca728ad7f
DIFF: https://github.com/llvm/llvm-project/commit/bc7456fd8a11e3b477060af85b00c42ca728ad7f.diff
LOG: [mlir] Fix rank bitwidth in UnrankedMemRefType conversion.
Differential Revision: https://reviews.llvm.org/D85300
Added:
Modified:
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
Removed:
################################################################################
diff --git a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
index 2ada7c425600..ac19924e96e8 100644
--- a/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
+++ b/mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
@@ -400,7 +400,7 @@ static constexpr unsigned kRankInUnrankedMemRefDescriptor = 0;
static constexpr unsigned kPtrInUnrankedMemRefDescriptor = 1;
Type LLVMTypeConverter::convertUnrankedMemRefType(UnrankedMemRefType type) {
- auto rankTy = LLVM::LLVMType::getInt64Ty(llvmDialect);
+ auto rankTy = getIndexType();
auto ptrTy = LLVM::LLVMType::getInt8PtrTy(llvmDialect);
return LLVM::LLVMType::getStructTy(rankTy, ptrTy);
}
diff --git a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
index a247c35a0915..d5d966fe1115 100644
--- a/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
+++ b/mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
@@ -1326,7 +1326,7 @@ func @rank_of_unranked(%unranked: memref<*xi32>) {
// CHECK-NEXT: llvm.insertvalue
// CHECK-NEXT: llvm.insertvalue
// CHECK-NEXT: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i64, ptr<i8>)>
-// CHECK32: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i64, ptr<i8>)>
+// CHECK32: llvm.extractvalue %{{.*}}[0] : !llvm.struct<(i32, ptr<i8>)>
// CHECK-LABEL: func @rank_of_ranked
// CHECK32-LABEL: func @rank_of_ranked
More information about the Mlir-commits
mailing list