[llvm] [flang][runtime] fix intrinsics case of extends_type_of (PR #161466)

Andre Kuhlenschmidt via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 09:47:40 PDT 2025


================
@@ -118,29 +118,43 @@ bool RTDEF(SameTypeAs)(const Descriptor &a, const Descriptor &b) {
 }
 
 bool RTDEF(ExtendsTypeOf)(const Descriptor &a, const Descriptor &mold) {
+  // The wording of the standard indicates the order in which each case
+  // is checked. If performance becomes an issue, there are less maintainable
+  // versions of this code that would probably execute faster.
+  // F'23 16.9.86 p 5
+  // If MOLD is unlimited polymorphic and is either a disassociated pointer or
+  // unallocated allocatable variable, the result is true;
----------------
akuhlens wrote:

Is there an invariant that `!mold.IsAllocated()` implies `mold.IsPointer() || mold.IsAllocatable()`?

https://github.com/llvm/llvm-project/pull/161466


More information about the llvm-commits mailing list