You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang][debug] Avoid redundant debug data generation for derived types.
Since llvm#122770, we have seen
that compile time have become extremely slow for cyclic derived types.
In 122770, we made the criteria to cache a type very strict. As a result,
some types which are safe to cache were also being re-generated every
type they were required. This increased the compile time and also the
size of the debug info.
Please see the description of PR# 122770. We decided that when
processing t1, the type generated for t2 and t3 were not safe to
cached. But our algorithm also denied caching to t1 which as top level
type was safe.
type t1
type(t2), pointer :: p1
end type
type t2
type(t3), pointer :: p2
end type
type t3
type(t1), pointer :: p3
end type
I have tinkered the check a bit so that top level type is always cached.
To detect a top level type, we use a depth counter that get incremented
before call to convertRecordType and decremented after it returns.
After this change, the following file from Fujitsu get compiled under
a minute.
https://github.com/fujitsu/compiler-test-suite/blob/main/Fortran/0394/0394_0031.f90
The smaller testcase present in issue 124049 takes around half second. I
also added check to make sure that duplicate entries of the
DICompositeType are not present in the IR.
Fixesllvm#124049 and llvm#123960.
0 commit comments