-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
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:
llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
Lines 10203 to 10217 in fa45bf4
| // Only consider a function fully internal as long as it has local linkage | |
| // and is not used in any other way than acting as the called function at | |
| // call sites. | |
| bool SystemZTargetLowering::isFullyInternal(const Function *Fn) const { | |
| if (!Fn->hasLocalLinkage()) | |
| return false; | |
| for (const User *U : Fn->users()) { | |
| if (auto *CB = dyn_cast<CallBase>(U)) { | |
| if (CB->getCalledFunction() != Fn) | |
| return false; | |
| } else | |
| return false; | |
| } | |
| return true; | |
| } |
And its (indirect) usage here:
llvm-project/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
Lines 2206 to 2207 in fa45bf4
| // Integer args <=32 bits should have an extension attribute. | |
| verifyNarrowIntegerArgs_Call(Outs, &MF.getFunction(), Callee); |
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.
Metadata
Metadata
Assignees
Type
Projects
Status