[flang-commits] [flang] [flang] Set polymorphic entity lowering option on by default (PR #83308)

via flang-commits flang-commits at lists.llvm.org
Wed Feb 28 10:04:16 PST 2024


https://github.com/jeanPerier created https://github.com/llvm/llvm-project/pull/83308

Preliminary patch for https://github.com/llvm/llvm-project/pull/83285 to turn polymorphism on by default.

Will give a few days warning for people to remove the flag from their workflow using flang-new.

Also easier to revert if issues with the gfortran test suites.

>From 166a7943965813e57a7b09f825d370cb65ecc1db Mon Sep 17 00:00:00 2001
From: Jean Perier <jperier at nvidia.com>
Date: Wed, 28 Feb 2024 09:57:48 -0800
Subject: [PATCH] [flang] Set polymorphic entity lowering option on by default

Preliminary patch for https://github.com/llvm/llvm-project/pull/83285
to turn polymorphism on by default.

Will give a few days warning for people to remove the flag from their
workflow using flang-new.

Also easier to revert if issues with the gfortran test suites.
---
 flang/include/flang/Lower/LoweringOptions.def              | 4 ++--
 flang/test/Driver/flang-experimental-polymorphism-flag.f90 | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/flang/include/flang/Lower/LoweringOptions.def b/flang/include/flang/Lower/LoweringOptions.def
index 503acdac869c7a..9de69ac5c80f52 100644
--- a/flang/include/flang/Lower/LoweringOptions.def
+++ b/flang/include/flang/Lower/LoweringOptions.def
@@ -24,8 +24,8 @@ LOWERINGOPT(Name, Bits, Default)
 /// If true, lower transpose without a runtime call.
 ENUM_LOWERINGOPT(OptimizeTranspose, unsigned, 1, 1)
 
-/// If true, enable polymorphic type lowering feature. Off by default.
-ENUM_LOWERINGOPT(PolymorphicTypeImpl, unsigned, 1, 0)
+/// If true, enable polymorphic type lowering feature. On by default.
+ENUM_LOWERINGOPT(PolymorphicTypeImpl, unsigned, 1, 1)
 
 /// If true, lower to High level FIR before lowering to FIR. On by default.
 ENUM_LOWERINGOPT(LowerToHighLevelFIR, unsigned, 1, 1)
diff --git a/flang/test/Driver/flang-experimental-polymorphism-flag.f90 b/flang/test/Driver/flang-experimental-polymorphism-flag.f90
index 106e898149a18f..095c1cc929e67b 100644
--- a/flang/test/Driver/flang-experimental-polymorphism-flag.f90
+++ b/flang/test/Driver/flang-experimental-polymorphism-flag.f90
@@ -1,10 +1,10 @@
 ! Test -flang-experimental-hlfir flag
 ! RUN: %flang_fc1 -flang-experimental-polymorphism -emit-fir -o - %s | FileCheck %s
-! RUN: not %flang_fc1 -emit-fir -o - %s 2>&1 | FileCheck %s --check-prefix NO-POLYMORPHISM
+! RUN: %flang_fc1 -emit-fir -o - %s 2>&1 | FileCheck %s --check-prefix NO-POLYMORPHISM
 
 ! CHECK: func.func @_QPtest(%{{.*}}: !fir.class<none> {fir.bindc_name = "poly"})
 subroutine test(poly)
   class(*) :: poly
 end subroutine test
 
-! NO-POLYMORPHISM: not yet implemented: support for polymorphic types
+! NO-POLYMORPHISM: func.func @_QPtest



More information about the flang-commits mailing list