aboutsummaryrefslogtreecommitdiff
path: root/mlir/lib/Target/LLVMIR/ModuleImport.cpp
diff options
context:
space:
mode:
authorMatthias Springer <me@m-sp.org>2025-04-09 21:35:32 +0200
committerGitHub <noreply@github.com>2025-04-09 21:35:32 +0200
commita0d449016b9fda248df78a9e0a8634fa03d33eb2 (patch)
treef17179cae09c61bceeab27e172c0ed3c006e49a1 /mlir/lib/Target/LLVMIR/ModuleImport.cpp
parente0950ebb9ce3ce02bd9a439f55fb2cbf81fa3eaf (diff)
downloadllvm-a0d449016b9fda248df78a9e0a8634fa03d33eb2.zip
llvm-a0d449016b9fda248df78a9e0a8634fa03d33eb2.tar.gz
llvm-a0d449016b9fda248df78a9e0a8634fa03d33eb2.tar.bz2
[mlir][LLVM] Delete `getVectorElementType` (#134981)
The LLVM dialect no longer has its own vector types. It uses `mlir::VectorType` everywhere. Remove `LLVM::getVectorElementType` and use `cast<VectorType>(ty).getElementType()` instead. This commit addresses a [comment](https://github.com/llvm/llvm-project/pull/133286#discussion_r2022192500) on the PR that deleted the LLVM vector types. Also improve vector type constraints by specifying the `mlir::VectorType` C++ class, so that explicit casts to `VectorType` can be avoided in some places.
Diffstat (limited to 'mlir/lib/Target/LLVMIR/ModuleImport.cpp')
-rw-r--r--mlir/lib/Target/LLVMIR/ModuleImport.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/lib/Target/LLVMIR/ModuleImport.cpp b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
index 2859abdb..187f1bd 100644
--- a/mlir/lib/Target/LLVMIR/ModuleImport.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleImport.cpp
@@ -826,7 +826,7 @@ static Type getVectorTypeForAttr(Type type, ArrayRef<int64_t> arrayShape = {}) {
}
// An LLVM dialect vector can only contain scalars.
- Type elementType = LLVM::getVectorElementType(type);
+ Type elementType = cast<VectorType>(type).getElementType();
if (!elementType.isIntOrFloat())
return {};