Skip to content

Conversation

SusanTan
Copy link
Contributor

currently this variable

%7 = fir.declare %6 storage(%4[0]) {uniq_name = "_QFEpi"} : (!fir.ref<f32>, !fir.ref<!fir.array<4xi8>>) -> !fir.ref<f32>
[2:19]

is categorized as a scalar type when it really should be an aggregate type, because it is part of !fir.ref<!fir.array<4xi8>>

This MR adds a classification to capture the storage operand in fir.declare.

@SusanTan SusanTan marked this pull request as draft October 14, 2025 19:23
@SusanTan SusanTan marked this pull request as ready for review October 14, 2025 19:26
@clementval
Copy link
Contributor

Test?

@SusanTan
Copy link
Contributor Author

Test?

@clementval yes, adding rn

@clementval
Copy link
Contributor

Test?

@clementval yes, adding rn

Thanks!

Copy link
Contributor

@clementval clementval left a comment

Choose a reason for hiding this comment

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

LGTM. Wait for @razvanlupusoru if he has any comment on this.

// to the declared memref.
if (auto storage = op.getStorage())
return storage;
return op.getMemref();
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not desirable because in FIR, having access to the fir.declare as the "base reference" allows us to get all of the Fortran properties. I would suggest returning varPtr instead.

Copy link

github-actions bot commented Oct 14, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

Copy link
Contributor

@razvanlupusoru razvanlupusoru 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.

@SusanTan SusanTan merged commit f0b701d into llvm:main Oct 15, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants