This is an archive of the discontinued LLVM Phabricator instance.

[flang] Take result length into account in ApplyElementwise folding
ClosedPublic

Authored by jeanPerier on Aug 25 2021, 10:10 AM.

Details

Summary

ApplyElementwise on character operation was always creating a result
ArrayConstructor with the length of the left operand. This is not
correct for concatenation and SetLength operations.

Compute and thread the length to the spot creating the ArrayConstructor
so that the length is correct for those character operations.

Diff Detail

Event Timeline

jeanPerier created this revision.Aug 25 2021, 10:10 AM
jeanPerier requested review of this revision.Aug 25 2021, 10:10 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2021, 10:10 AM
klausler accepted this revision.Aug 25 2021, 10:14 AM

LGTM, thanks!

flang/lib/Evaluate/fold-implementation.h
1048

braces, please

This revision is now accepted and ready to land.Aug 25 2021, 10:14 AM

Use braces.

jeanPerier marked an inline comment as done.Aug 25 2021, 11:10 PM