This is an archive of the discontinued LLVM Phabricator instance.

[flang][LoopVersioning] support reboxed operands
ClosedPublic

Authored by tblah on Aug 21 2023, 4:20 AM.

Details

Summary

Since https://reviews.llvm.org/D158119, many boxes lowered via HLFIR are
reboxed with better lower bounds information after they are declared.

For the loop versioning pass to support FIR lowered via HLFIR, it needs
to dereference fir.rebox operations to figure out that the variable was
a function argument.

I decided to modify the existing dereferencing of fir.declare so that
the declared/reboxed value is used in the versioned loop instead of the
function argument. This makes it easier for the improved lower bounds
information to be accessed. In doing this, I changed ArgInfo to store
ArgInfo::arg by value instead of by pointer because mlir::Value has
value-type semantics.

Diff Detail

Event Timeline

tblah created this revision.Aug 21 2023, 4:20 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 21 2023, 4:20 AM
tblah requested review of this revision.Aug 21 2023, 4:20 AM
vzakhari accepted this revision.Aug 21 2023, 12:01 PM

LGTM. Thank you!

This revision is now accepted and ready to land.Aug 21 2023, 12:01 PM
This revision was automatically updated to reflect the committed changes.