[Mlir-commits] [mlir] 02f9cf9 - [MLIR] Remove LLVM typed pointer support

Nikita Popov llvmlistbot at llvm.org
Wed Jan 25 05:16:48 PST 2023


Author: Nikita Popov
Date: 2023-01-25T14:16:39+01:00
New Revision: 02f9cf9266c35795aa44ded0c37f0c44d8c49069

URL: https://github.com/llvm/llvm-project/commit/02f9cf9266c35795aa44ded0c37f0c44d8c49069
DIFF: https://github.com/llvm/llvm-project/commit/02f9cf9266c35795aa44ded0c37f0c44d8c49069.diff

LOG: [MLIR] Remove LLVM typed pointer support

This breaks lowering to typed pointers, and forces import to always
use opaque pointers.

This has no effect on MLIR-level typed pointer support in the
LLVMIR dialect.

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
    mlir/lib/Target/LLVMIR/TypeToLLVM.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp b/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
index 6beb8eda4c90d..26e426b023272 100644
--- a/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
+++ b/mlir/lib/Target/LLVMIR/TypeFromLLVM.cpp
@@ -97,12 +97,7 @@ class TypeFromLLVMIRTranslatorImpl {
 
   /// Translates the given pointer type.
   Type translate(llvm::PointerType *type) {
-    if (type->isOpaque())
-      return LLVM::LLVMPointerType::get(&context, type->getAddressSpace());
-
-    return LLVM::LLVMPointerType::get(
-        translateType(type->getNonOpaquePointerElementType()),
-        type->getAddressSpace());
+    return LLVM::LLVMPointerType::get(&context, type->getAddressSpace());
   }
 
   /// Translates the given structure type.

diff  --git a/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp b/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp
index 39691d2255cb5..d3ecede279156 100644
--- a/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp
+++ b/mlir/lib/Target/LLVMIR/TypeToLLVM.cpp
@@ -106,10 +106,7 @@ class TypeToLLVMIRTranslatorImpl {
 
   /// Translates the given pointer type.
   llvm::Type *translate(LLVM::LLVMPointerType type) {
-    if (type.isOpaque())
-      return llvm::PointerType::get(context, type.getAddressSpace());
-    return llvm::PointerType::get(translateType(type.getElementType()),
-                                  type.getAddressSpace());
+    return llvm::PointerType::get(context, type.getAddressSpace());
   }
 
   /// Translates the given structure type, supports both identified and literal


        


More information about the Mlir-commits mailing list