llvm-project
a94a3cd3 - Always check the function attribute to determine checksum mismatch for available_externally functions (#87279)

Commit
1 year ago
Always check the function attribute to determine checksum mismatch for available_externally functions (#87279) This is to fix an assertion error. Apparently, `pseudo_probe_desc` could still be available for import functions, and its checksum mismatch state can be different from import function's `profile-checksum-mismatch` attr. This happens when unstable IR or ODR violation issue occurs, the definitions of the same function across different translation units could be different and result in different checksums. During link time deduplication, the internal function definition (the checksum in desc is computed based on) is substituted by the `available_externally` definition, which cause the inconsistency. Hence, we fix it to by always checking the state for the new `available_externally` definition, which is saved in the function attribute.
Author
Parents
  • llvm
    • include/llvm/Transforms/Utils
      • File
        SampleProfileLoaderBaseImpl.h
    • test/Transforms/SampleProfile
      • pseudo-probe-callee-profile-mismatch.ll