[all-commits] [llvm/llvm-project] 30f7a6: [flang] Correctly prepare allocatable runtime call...
Asher Mancinelli via All-commits
all-commits at lists.llvm.org
Thu May 8 06:37:01 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 30f7a6cc42856d2028bfd00321ddb1428e0c46aa
https://github.com/llvm/llvm-project/commit/30f7a6cc42856d2028bfd00321ddb1428e0c46aa
Author: Asher Mancinelli <ashermancinelli at gmail.com>
Date: 2025-05-08 (Thu, 08 May 2025)
Changed paths:
M flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h
M flang/lib/Lower/Allocatable.cpp
M flang/lib/Lower/ConvertExprToHLFIR.cpp
M flang/lib/Optimizer/HLFIR/IR/HLFIROps.cpp
M flang/test/Lower/allocatable-polymorphic.f90
M flang/test/Lower/allocate-source-allocatables-2.f90
M flang/test/Lower/allocate-source-allocatables.f90
M flang/test/Lower/allocate-source-pointers.f90
A flang/test/Lower/volatile-allocatable.f90
Log Message:
-----------
[flang] Correctly prepare allocatable runtime call arguments (#138727)
When lowering allocatables, the generated calls to runtime functions
were not using the runtime::createArguments utility which handles the
required conversions. createArguments is where I added the implicit
volatile casts to handle converting volatile variables to the
appropriate type based on their volatility in the callee. Because the
calls to allocatable runtime functions were not using this function,
their arguments were not casted to have the appropriate volatility.
Add a test to demonstrate that volatile and allocatable
class/box/reference types are appropriately casted before calling into
the runtime library.
Instead of using a recursive variadic template to perform the
conversions in createArguments, map over the arguments directly so that
createArguments can be called with an ArrayRef of arguments. Some cases
in Allocatable.cpp already had a vector of values at the point where
createArguments needed to be called - the new overload allows calling
with a vector of args or the variadic version with each argument spelled
out at the callsite.
This change resulted in the allocatable runtime calls having their
arguments converted left-to-right, which changed some of the test
results. I used CHECK-DAG to ignore the order.
Add some missing handling of volatile class entities, which I previously
missed because I had not yet enabled volatile class entities in Lower.
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