[flang-commits] [flang] [flang] Use alias analysis in lowering record assignments (PR #176483)
via flang-commits
flang-commits at lists.llvm.org
Thu Jan 29 02:23:53 PST 2026
================
@@ -1566,8 +1567,14 @@ void fir::factory::genRecordAssignment(fir::FirOpBuilder &builder,
mlir::isa<fir::BaseBoxType>(fir::getBase(rhs).getType());
auto recTy = mlir::dyn_cast<fir::RecordType>(baseTy);
assert(recTy && "must be a record type");
+
+ // Use alias analysis to guard the fast path.
+ fir::AliasAnalysis aa;
+ bool disjoint = aa.alias(fir::getBase(lhs), fir::getBase(rhs)) ==
----------------
jeanPerier wrote:
> This would actually allow to go back to the lowering as in the most recent version of the test https://github.com/llvm/llvm-project/blob/c54b288461646e0c9d0a0d3bc0cf9ff13eda234e/flang/test/Lower/derived-type-finalization.f90
Perfect, the goal for this patch is to not require modifying changing the IR for any tests that does not have SEQUENCE type.
https://github.com/llvm/llvm-project/pull/176483
More information about the flang-commits
mailing list