Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Update ArrayValueCopy to support array_amend and array_access
This patch update the array value copy pass to support fir-array_amend and fir.array_access. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: PeteSteinfeld, schweitz Differential Revision: https://reviews.llvm.org/D121300 Co-authored-by: Jean Perier <jperier@nvidia.com> Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
- Loading branch information
1 parent
db7bca2
commit beeb86b
Showing
7 changed files
with
800 additions
and
237 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//===-- Array.h -------------------------------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef FORTRAN_OPTIMIZER_BUILDER_ARRAY_H | ||
#define FORTRAN_OPTIMIZER_BUILDER_ARRAY_H | ||
|
||
#include "flang/Optimizer/Dialect/FIROps.h" | ||
|
||
namespace fir::factory { | ||
|
||
/// Return true if and only if the extents are those of an assumed-size array. | ||
/// An assumed-size array in Fortran is declared with `*` as the upper bound of | ||
/// the last dimension of the array. Lowering converts the asterisk to an | ||
/// undefined value. | ||
inline bool isAssumedSize(const llvm::SmallVectorImpl<mlir::Value> &extents) { | ||
return !extents.empty() && | ||
mlir::isa_and_nonnull<UndefOp>(extents.back().getDefiningOp()); | ||
} | ||
|
||
} // namespace fir::factory | ||
|
||
#endif // FORTRAN_OPTIMIZER_BUILDER_ARRAY_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.