[all-commits] [llvm/llvm-project] aeaf31: [flang] avoid useless rebox of polymorphic scalars...
jeanPerier via All-commits
all-commits at lists.llvm.org
Wed Jun 25 00:41:54 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: aeaf319b8c2207eb747079529f28d44d54bf1fd5
https://github.com/llvm/llvm-project/commit/aeaf319b8c2207eb747079529f28d44d54bf1fd5
Author: jeanPerier <jperier at nvidia.com>
Date: 2025-06-25 (Wed, 25 Jun 2025)
Changed paths:
M flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp
M flang/test/HLFIR/declare-codegen.fir
Log Message:
-----------
[flang] avoid useless rebox of polymorphic scalars (#145507)
Do not create new descriptor for polymorphic scalars when lowering
hlfir.declare.
hlfir.declare of box/class is lowered to a fir.rebox to ensure that
local lower bounds and descriptor attributes (Pointer/Allocatable/None)
are properly set-up in the descriptor associated to the symbol.
For polymorphic scalar, this created a useless temporary descriptor.
This was breaking invalid code #145256 that violates OPTIONAL usage
rules. I am not fixing it primarily to support this invalid code, but
rather because it is dumb to create a useless fir.rebox.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list