<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/130541>130541</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[SystemZ] Significant compile time regression in LLVM 20 due to `isFullyInternal()`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:SystemZ,
performance
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alexrp
</td>
</tr>
</table>
<pre>
With LLVM 20, we're seeing significantly increased compile times for the Zig standard library test executable for `s390x-linux`: 0m33s with LLVM 19 vs 3m28s with LLVM 20. It appears to be caused by #100757 (FYI @JonPsson1 @uweigand), specifically this function:
https://github.com/llvm/llvm-project/blob/fa45bf430081ed5a37c50719dfd3a8ca32271126/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp#L10203-L10217
And its usage here:
https://github.com/llvm/llvm-project/blob/fa45bf430081ed5a37c50719dfd3a8ca32271126/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp#L2206-L2207
In Zig we have a helper function `std.builtin.returnError()` that the compiler emits calls to when an error value is returned from a function. Since we use a compilation model that can roughly be described as a unity build, the standard library test module has around ~68,000 calls to this function. LLVM is now walking the full use list of this function at every call site, which is less than ideal.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzUVM1u6zYTfRp6M4hAUZJlLbTIl3wGUqRAgRQtencjciSxlyIF_tjRps9eUEmcG6CbLgsYpkl4zpwzc2YwBD1Zop41_2PN4wFTnJ3v0dCrXw-DU1v_u44zPD__9jMIzsQDXImJ1hMEIm0nyPF61BJtNBtoKz1hIAXSLas2BFEvFGB0HuJM8E1PECJahV6B0YNHv0GkEIFeSaaIg6H9z-zIQ9Xx1zujbXplR86qe-BLVQW43giVHVwCVIs4_fgqeAFPEXBdCX2A6GAgkJgyq2EDJqqS87ZpgYnT-Y8nYDX_ydlfQnC2zJd0JT2hVUx0WW9YSe4CjdkgzjrAmKyM2llW3T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