llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.27k stars 12.1k forks source link

PGO-Enabled lld become no-op due to early exit #100516

Open Naville opened 4 months ago

Naville commented 4 months ago

Ref: https://github.com/llvm/llvm-project/blob/2e0c2154a8dc5d8ab2a8cf360aa0184fb58c0860/lld/tools/lld/lld.cpp#L90

Due to early exit. PGO in lld won't be called to writeout the collected PGO profile before exiting

Andarwinux commented 4 months ago

just export LLD_IN_TEST=1

Naville commented 4 months ago

just export LLD_IN_TEST=1

Yes, this is what we did in downstream as a temporary workaround. However this seems counterintuitive and misleading? (It's not clear to another innocent user like me how test is related to PGO)