Skip to content

Commit

Permalink
[flang] enable assumed-rank lowering by default (llvm#110893)
Browse files Browse the repository at this point in the history
Aside from a minor TODO about polymorphic RANK(*) (https://github.com/llvm/llvm-project/blob/2b8e81ce919e8db857dc2ba20012e9020af07294/flang/lib/Lower/Bridge.cpp#L3459),
the implementation for assumed-rank is ready for everyone to use.
  • Loading branch information
jeanPerier authored and xgupta committed Oct 4, 2024
1 parent 9c736c9 commit 58f7ea1
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions flang/lib/Lower/ConvertVariable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@
#include "llvm/Support/Debug.h"
#include <optional>

static llvm::cl::opt<bool> allowAssumedRank(
"allow-assumed-rank",
llvm::cl::desc("Enable assumed rank lowering - experimental"),
llvm::cl::init(false));
static llvm::cl::opt<bool>
allowAssumedRank("allow-assumed-rank",
llvm::cl::desc("Enable assumed rank lowering"),
llvm::cl::init(true));

#define DEBUG_TYPE "flang-lower-variable"

Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-calls.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! Test passing of assumed-ranks that require creating a
! a new descriptor for the dummy argument (different lower bounds,
! attribute, or dynamic type)
! RUN: bbc -emit-hlfir -allow-assumed-rank -o - %s | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

subroutine test_alloc_to_nonalloc(x)
real, allocatable :: x(..)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-entry.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Test assumed-rank dummy argument that is not present in
! all ENTRY statements.
! RUN: bbc -emit-hlfir -allow-assumed-rank -o - %s | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

subroutine test_main_entry(x)
real :: x(..)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
! Test lowering of SIZE/SIZEOF inquiry intrinsics with assumed-ranks
! arguments.
! RUN: bbc -emit-hlfir -o - %s -allow-assumed-rank | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s


subroutine test_size_1(x)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test shape lowering for assumed-rank
! RUN: bbc -emit-hlfir -o - %s -allow-assumed-rank | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

subroutine test_shape(x)
real :: x(..)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-inquiries.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test lowering of inquiry intrinsics with assumed-ranks arguments.
! RUN: bbc -emit-hlfir -o - %s -allow-assumed-rank | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

subroutine test_allocated(x)
real, allocatable :: x(..)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test assumed-rank capture inside internal procedures.
! RUN: bbc -emit-hlfir -o - %s -allow-assumed-rank | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

subroutine test_assumed_rank(x)
real :: x(..)
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test lowering of assumed-rank variables
! RUN: bbc -emit-hlfir %s -allow-assumed-rank -o - | FileCheck %s
! RUN: bbc -emit-hlfir %s -o - | FileCheck %s

module assumed_rank_tests
interface
Expand Down
2 changes: 1 addition & 1 deletion flang/test/Lower/HLFIR/select-rank.f90
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
! Test lowering of select rank to HLFIR
! RUN: bbc -emit-hlfir -o - %s -allow-assumed-rank | FileCheck %s
! RUN: bbc -emit-hlfir -o - %s | FileCheck %s

module iface_helpers
interface
Expand Down

0 comments on commit 58f7ea1

Please sign in to comment.