[clang-tools-extra] [compiler-rt] [clang] [llvm] [PGO][GlobalValue][LTO]In GlobalValues::getGlobalIdentifier, use semicolon as delimiter for local-linkage varibles. (PR #74008)

Mingming Liu via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 21:29:18 PST 2023


minglotus-6 wrote:

> Resolved comments except the pending discussion about whether to use `.proftext` or`.profraw`.
> 
> Added `REQUIRES: zlib` for LLVM IR test since the profile reader should be built with zlib support.
> 
> I'll probably spend sometime to get this test running on my laptop (haven't tried to build llvm on mac before), while waiting for more feedbacks. I'm thinking of submitting it on Thursday or Friday. @ellishg I think the added compiler-rt test (on macosx) should be a test case for issue 74565.

The test failed on mac, but initially on trying to find `dso_local` of line `PGOName: define dso_local void @_Z7callee1v() {{.*}} !prof ![[#]] !PGOFuncName ![[#]] `.
-  Debugging with `lldb` points to [this comment](https://github.com/llvm/llvm-project/blob/4f1ddf7523c0bbb4075b1682dbe2278080642eee/clang/lib/CodeGen/CodeGenModule.cpp#L1528), saying only COFF and ELF assumes `dso_local`. 

After making the `dso_local` optional in the [latest commit](https://github.com/llvm/llvm-project/pull/74008/commits/f6a718d80d7a70d60ef8affc282f5111125e8282), the test started to fail due to the difference of `<mangled-name>` and `<linkage-name>`. 
1. Test failed, when external func `callee1` in expected output doesn't have `!PGOFuncName` metadata but the test output has it. Note `!PGOFuncName` is annotated [only if](https://github.com/llvm/llvm-project/blob/90c23981768713736208d76578ca119a20f6ac60/llvm/lib/ProfileData/InstrProf.cpp#L1262-1265) `PGOName != Func.getName()`
2. Fixing the first error allows me to see the missed import errors.

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


More information about the cfe-commits mailing list