This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix UBOUND() constant folding for parentheses expr
ClosedPublic

Authored by FruitClover on Apr 18 2022, 7:50 AM.

Details

Summary

Similarly to LBOUND((x)) in https://reviews.llvm.org/D123838 - fix UBOUND((x))
folding for constant arrays to return shape instead of recurse scan.

Depends on D123520

Diff Detail

Event Timeline

FruitClover created this revision.Apr 18 2022, 7:50 AM
FruitClover created this object with visibility "FruitClover (Mike K)".
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 18 2022, 7:50 AM
FruitClover requested review of this revision.Apr 18 2022, 7:50 AM
FruitClover edited the summary of this revision. (Show Details)
FruitClover edited the summary of this revision. (Show Details)

update base

FruitClover edited the summary of this revision. (Show Details)Apr 18 2022, 8:11 AM
FruitClover changed the visibility from "FruitClover (Mike K)" to "Public (No Login Required)".Apr 18 2022, 8:17 AM
FruitClover added a subscriber: flang-commits.
jeanPerier accepted this revision.Apr 22 2022, 2:59 AM

I think I would have slightly favored a version that dealt with this in GetConstantArrayBoundHelper without defining a new expression visitor, but I am also OK with this solution. Thanks for the fix.

This revision is now accepted and ready to land.Apr 22 2022, 2:59 AM

I think I would have slightly favored a version that dealt with this in GetConstantArrayBoundHelper without defining a new expression visitor, but I am also OK with this solution. Thanks for the fix.

Sure, ok for me, will update with slightly shorter version, much appreciated for the comments.

Rebase, add bool switch to extract shape instead of additional helper

I think I would have slightly favored a version that dealt with this in GetConstantArrayBoundHelper without defining a new expression visitor, but I am also OK with this solution. Thanks for the fix.

Sorry for ping, but i've update code after your approve mark, could you take a look one more time?

jeanPerier accepted this revision.Apr 28 2022, 1:25 AM

LGTM, thanks for the update