Re-apply https://reviews.llvm.org/D87921, was reverted to triage a PPC bot failure.
authorSriraman Tallam <tmsriram@google.com>
Wed, 23 Sep 2020 16:26:41 +0000 (09:26 -0700)
committerSriraman Tallam <tmsriram@google.com>
Wed, 23 Sep 2020 17:28:40 +0000 (10:28 -0700)
commit7d0bbe40901cf60558c619c3174d71d7c53ca144
tree062a7f6ff80e8f5bb1387b0d99a5a59b8c49f894
parentd882ca7f1f1dee7d812d6b1ae060b5f671ab9ebc
Re-apply https://reviews.llvm.org/D87921, was reverted to triage a PPC bot failure.

D87921 was reverted in commit b89059a31347dd09b55a96b99b3dbe38d7749908
as it was causing an unknown llvm PPC bot failure.  Reapplying the patch
after confirming that this is not responsible. Build bot failure:
https://reviews.llvm.org/D87921#2286644  which caused the revert.

The wrong placement of add pass with optimizations led to
-funique-internal-linkage-names being disabled.

Fixed the placement of the MPM.addpass for UniqueInternalLinkageNames to make it
work correctly with -O2 and new pass manager. Updated the tests to explicitly
check O0 and O1.

Differential Revision: https://reviews.llvm.org/D87921
clang/lib/CodeGen/BackendUtil.cpp
clang/test/CodeGen/unique-internal-linkage-names.cpp