This is an archive of the discontinued LLVM Phabricator instance.

[flang] convert stack arrays allocation to match old type
ClosedPublic

Authored by tblah on Jun 1 2023, 12:45 PM.

Details

Summary

The old fir.allocmem operation returned a !fir.heap<.> type. The new
fir.alloca operation returns a !fir.ref<.> type. This patch inserts a
fir.convert so that the old type is preserved. This prevents verifier
failures when types returned from fir.if statements don't match the
expected type.

Diff Detail

Event Timeline

tblah created this revision.Jun 1 2023, 12:45 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 1 2023, 12:45 PM
tblah requested review of this revision.Jun 1 2023, 12:45 PM

LGTM, except for the casts. Thank you!

flang/lib/Optimizer/Transforms/StackArrays.cpp
478

Please use new style for the casts (see https://reviews.llvm.org/D151556).

tblah updated this revision to Diff 527787.Jun 2 2023, 2:46 AM

Thanks for review!

Changes: use the free function variants of casts

vzakhari accepted this revision.Jun 2 2023, 8:58 AM

Thank you, Tom!

This revision is now accepted and ready to land.Jun 2 2023, 8:58 AM
This revision was automatically updated to reflect the committed changes.
tblah marked an inline comment as done.