aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/WasmObjectFile.cpp
diff options
context:
space:
mode:
authorMingming Liu <mingmingl@google.com>2024-01-02 10:23:29 -0800
committerGitHub <noreply@github.com>2024-01-02 10:23:29 -0800
commiteba2b789d3b91ae1cefebe112fec6c667b86a904 (patch)
tree5aa253e1237e14c37cb78585d34d3f70902509e3 /llvm/lib/Object/WasmObjectFile.cpp
parente512df3ecca4b2328ac1efd7de6c6efefde249d7 (diff)
downloadllvm-eba2b789d3b91ae1cefebe112fec6c667b86a904.zip
llvm-eba2b789d3b91ae1cefebe112fec6c667b86a904.tar.gz
llvm-eba2b789d3b91ae1cefebe112fec6c667b86a904.tar.bz2
[RawProfReader]When constructing symbol table, read the MD5 of function name in the proper byte order (#76312)
Before this patch, when the field `NameRef` is generated in little-endian systems and read back in big-endian systems, the information gets dropped. - The bug gets caught by a buildbot https://lab.llvm.org/buildbot/#/builders/94/builds/17931. In the error message (pasted below), two indirect call targets are not imported. ``` ; IMPORTS-DAG: Import _Z7callee1v ^ <stdin>:1:1: note: scanning from here main.ll: Import _Z11global_funcv from lib.cc ^ <stdin>:1:10: note: possible intended match here main.ll: Import _Z11global_funcv from lib.cc ^ Input file: <stdin> Check file: /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/llvm/test/Transforms/PGOProfile/thinlto_indirect_call_promotion.ll -dump-input=help explains the following input dump. Input was: <<<<<< 1: main.ll: Import _Z11global_funcv from lib.cc dag:34'0 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found dag:34'1 ? possible intended match ``` [This commit](https://github.com/llvm/llvm-project/commit/b3999246b1a93bd8e6dc7acac36a7d57fac96542#diff-b196b796c5a396c7cdf93b347fe47e2b29b72d0b7dd0e2b88abb964d376ee50e) gates the fix by flag and provide test data by creating big-endian profiles (rather than reading the little-endian data on a big-endian system that might require a VM). - [This](https://github.com/llvm/llvm-project/commit/b3999246b1a93bd8e6dc7acac36a7d57fac96542#diff-643176077ddbe537bd0a05d2a8a53bdff6339420a30e8511710bf232afdda8b9) is a hexdump of little-endian profile data, and [this](https://github.com/llvm/llvm-project/commit/b3999246b1a93bd8e6dc7acac36a7d57fac96542#diff-1736a3ee25dde02bba55d670df78988fdb227e5a85b94b8707cf182cf70b28f0) is the big-endian version of it. - The [README.md](https://github.com/llvm/llvm-project/commit/b3999246b1a93bd8e6dc7acac36a7d57fac96542#diff-6717b6a385de3ae60ab3aec9638af2a43b55adaf6784b6f0393ebe1a6639438b) shows the result of `llvm-profdata show -ic-targets` before and after the fix when the profile is in big-endian.
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions