[PATCH] D105118: [remangleIntrinsicFunction] Detect and resolve name clash

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 29 07:17:26 PDT 2021


jeroen.dobbelaere created this revision.
jeroen.dobbelaere added reviewers: asbirlea, efriedma, nikic, apilipenko.
Herald added subscribers: dexonsmith, hiraditya.
jeroen.dobbelaere requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It is possible that the remangled name for an intrinsic already exists with a different (and wrong) prototype within the module.
As the bitcode reader keeps both versions of all remangled intrinsics around for a longer time, this can result in a
crash, as can be seen in https://bugs.llvm.org/show_bug.cgi?id=50923

This patch makes 'remangleIntrinsicFunction' aware of this situation. When it is detected, it moves the version with the wrong prototype to a different name. That version will be removed anyway once the module is completely loaded.

With thanks to @asbirlea for reporting this issue when trying out an lto build with the full restrict patches, and @efriedma for suggesting a sane resolution mechanism.


https://reviews.llvm.org/D105118

Files:
  llvm/lib/IR/Function.cpp
  llvm/test/tools/llvm-link/Inputs/remangle1.ll
  llvm/test/tools/llvm-link/Inputs/remangle2.ll
  llvm/test/tools/llvm-link/remangle.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105118.355216.patch
Type: text/x-patch
Size: 4224 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210629/ccdef35d/attachment.bin>


More information about the llvm-commits mailing list