Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fir::unwrapSeqOrBoxedSeqType #72171

Merged
merged 1 commit into from
Nov 14, 2023
Merged

Fix fir::unwrapSeqOrBoxedSeqType #72171

merged 1 commit into from
Nov 14, 2023

Conversation

Renaud-K
Copy link
Contributor

Fixing fir::unwrapSeqOrBoxedSeqType check for fir::BaseBoxType to add support for fir::BoxType and fir::ClassType

@Renaud-K Renaud-K added the flang Flang issues not falling into any other category label Nov 13, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Nov 13, 2023

@llvm/pr-subscribers-flang-fir-hlfir

Author: Renaud Kauffmann (Renaud-K)

Changes

Fixing fir::unwrapSeqOrBoxedSeqType check for fir::BaseBoxType to add support for fir::BoxType and fir::ClassType


Full diff: https://github.com/llvm/llvm-project/pull/72171.diff

1 Files Affected:

  • (modified) flang/lib/Optimizer/Dialect/FIRType.cpp (+1-1)
diff --git a/flang/lib/Optimizer/Dialect/FIRType.cpp b/flang/lib/Optimizer/Dialect/FIRType.cpp
index efaead599bee169..730317a9bc238b5 100644
--- a/flang/lib/Optimizer/Dialect/FIRType.cpp
+++ b/flang/lib/Optimizer/Dialect/FIRType.cpp
@@ -405,7 +405,7 @@ mlir::Type unwrapAllRefAndSeqType(mlir::Type ty) {
 mlir::Type unwrapSeqOrBoxedSeqType(mlir::Type ty) {
   if (auto seqTy = ty.dyn_cast<fir::SequenceType>())
     return seqTy.getEleTy();
-  if (auto boxTy = ty.dyn_cast<fir::BoxType>()) {
+  if (auto boxTy = ty.dyn_cast<fir::BaseBoxType>()) {
     auto eleTy = unwrapRefType(boxTy.getEleTy());
     if (auto seqTy = eleTy.dyn_cast<fir::SequenceType>())
       return seqTy.getEleTy();

Copy link
Contributor

@vzakhari vzakhari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I am not sure if it is possible to create a test that exposes the problem, so I am approving it as-is.

@Renaud-K Renaud-K merged commit 725115d into llvm:main Nov 14, 2023
5 checks passed
@jeanPerier
Copy link
Contributor

Thanks, it makes sense to me.

zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
Fixing fir::unwrapSeqOrBoxedSeqType check for fir::BaseBoxType to add
support for fir::BoxType and fir::ClassType
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:fir-hlfir flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants