Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang] Lower general forall statement
This patch lowers general forall statements. The forall are lowered to nested loops. This patch is part of the upstreaming effort from fir-dev branch. Depends on D121385 Reviewed By: PeteSteinfeld, schweitz Differential Revision: https://reviews.llvm.org/D121386 Co-authored-by: V Donaldson <vdonaldson@nvidia.com> Co-authored-by: Jean Perier <jperier@nvidia.com> Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
- Loading branch information
1 parent
f39a971
commit 88ae0d6
Showing
12 changed files
with
1,929 additions
and
25 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//===-- Inquiry.h - generate inquiry runtime API calls ----------*- 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_RUNTIME_INQUIRY_H | ||
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_INQUIRY_H | ||
|
||
namespace mlir { | ||
class Value; | ||
class Location; | ||
} // namespace mlir | ||
|
||
namespace fir { | ||
class FirOpBuilder; | ||
} | ||
|
||
namespace fir::runtime { | ||
|
||
/// Generate call to general `LboundDim` runtime routine. Calls to LBOUND | ||
/// without a DIM argument get transformed into descriptor inquiries so they're | ||
/// not handled in the runtime. | ||
mlir::Value genLboundDim(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value array, mlir::Value dim); | ||
|
||
/// Generate call to general `Ubound` runtime routine. Calls to UBOUND | ||
/// with a DIM argument get transformed into an expression equivalent to | ||
/// SIZE() + LBOUND() - 1, so they don't have an intrinsic in the runtime. | ||
void genUbound(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value resultBox, mlir::Value array, mlir::Value kind); | ||
|
||
/// Generate call to `Size` runtime routine. This routine is a specialized | ||
/// version when the DIM argument is not specified by the user. | ||
mlir::Value genSize(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value array); | ||
|
||
/// Generate call to general `SizeDim` runtime routine. This version is for | ||
/// when the user specifies a DIM argument. | ||
mlir::Value genSizeDim(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value array, mlir::Value dim); | ||
|
||
} // namespace fir::runtime | ||
#endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_INQUIRY_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
Oops, something went wrong.