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

Peter Klausler via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 1 09:51:19 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;
----------------
klausler wrote:

No.  It's just a test of the base address, and it works for all descriptors, including allocatables, pointers, dummy arguments, and temporaries.  The name could be better.

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


More information about the llvm-commits mailing list