[flang-commits] [flang] ccca3c6 - [flang] enable assumed-rank lowering by default (#110893)

via flang-commits flang-commits at lists.llvm.org
Fri Oct 4 00:04:59 PDT 2024


Author: jeanPerier
Date: 2024-10-04T09:04:56+02:00
New Revision: ccca3c63715753d816b0f9b429455b826343bdb3

URL: https://github.com/llvm/llvm-project/commit/ccca3c63715753d816b0f9b429455b826343bdb3
DIFF: https://github.com/llvm/llvm-project/commit/ccca3c63715753d816b0f9b429455b826343bdb3.diff

LOG: [flang] enable assumed-rank lowering by default (#110893)

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.

Added: 
    

Modified: 
    flang/lib/Lower/ConvertVariable.cpp
    flang/test/Lower/HLFIR/assumed-rank-calls.f90
    flang/test/Lower/HLFIR/assumed-rank-entry.f90
    flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90
    flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90
    flang/test/Lower/HLFIR/assumed-rank-inquiries.f90
    flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90
    flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90
    flang/test/Lower/HLFIR/select-rank.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/ConvertVariable.cpp b/flang/lib/Lower/ConvertVariable.cpp
index f9635408d6e8c6..8b03d60e47ca64 100644
--- a/flang/lib/Lower/ConvertVariable.cpp
+++ b/flang/lib/Lower/ConvertVariable.cpp
@@ -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"
 

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-calls.f90 b/flang/test/Lower/HLFIR/assumed-rank-calls.f90
index afb2bbac998910..63b8d9fd81f335 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-calls.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-calls.f90
@@ -1,7 +1,7 @@
 ! Test passing of assumed-ranks that require creating a
 ! a new descriptor for the dummy argument (
diff erent 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(..)

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-entry.f90 b/flang/test/Lower/HLFIR/assumed-rank-entry.f90
index 9928f5459f71f1..9ac56c4282f875 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-entry.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-entry.f90
@@ -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(..)

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90 b/flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90
index 6c8f5ba48d1bf9..696b228bacee08 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-inquiries-2.f90
@@ -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)

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90 b/flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90
index fb44efcad3ce7e..af89cb833b337d 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-inquiries-3.f90
@@ -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(..)

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-inquiries.f90 b/flang/test/Lower/HLFIR/assumed-rank-inquiries.f90
index a1d150a21d1497..a94ae7da365932 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-inquiries.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-inquiries.f90
@@ -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(..)

diff  --git a/flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90 b/flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90
index f8d5e84696c5f6..690ceb64a03cf9 100644
--- a/flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90
+++ b/flang/test/Lower/HLFIR/assumed-rank-internal-proc.f90
@@ -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(..)

diff  --git a/flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90 b/flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90
index 3b60b0d04e9fa3..d2931eabb75c22 100644
--- a/flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90
+++ b/flang/test/Lower/HLFIR/convert-variable-assumed-rank.f90
@@ -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

diff  --git a/flang/test/Lower/HLFIR/select-rank.f90 b/flang/test/Lower/HLFIR/select-rank.f90
index d27a6d732ffc71..7135c248ea44db 100644
--- a/flang/test/Lower/HLFIR/select-rank.f90
+++ b/flang/test/Lower/HLFIR/select-rank.f90
@@ -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


        


More information about the flang-commits mailing list