diff --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp --- a/flang/lib/Optimizer/Dialect/FIRType.cpp +++ b/flang/lib/Optimizer/Dialect/FIRType.cpp @@ -531,6 +531,9 @@ } else if (auto ptrTy = mlir::dyn_cast_or_null(ty)) { name << "ptr_"; ty = ptrTy.getEleTy(); + } else if (auto ptrTy = mlir::dyn_cast_or_null(ty)) { + name << "llvmptr_"; + ty = ptrTy.getEleTy(); } else if (auto heapTy = mlir::dyn_cast_or_null(ty)) { name << "heap_"; ty = heapTy.getEleTy(); diff --git a/flang/unittests/Optimizer/FIRTypesTest.cpp b/flang/unittests/Optimizer/FIRTypesTest.cpp --- a/flang/unittests/Optimizer/FIRTypesTest.cpp +++ b/flang/unittests/Optimizer/FIRTypesTest.cpp @@ -309,4 +309,8 @@ fir::SequenceType::getUnknownExtent()}, ty); EXPECT_EQ("?x?xi64", fir::getTypeAsString(dynArrTy, *kindMap)); + EXPECT_EQ("llvmptr_i32", + fir::getTypeAsString( + fir::LLVMPointerType::get(mlir::IntegerType::get(&context, 32)), + *kindMap)); }