[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Nemanja Ivanovic via Phabricator via cfe-commits
nemanjai added a comment.

It turns out that the culprit for the PPC bot failures is actually 
https://reviews.llvm.org/rG144e57fc9535
But this just took a while to manifest.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

When you recommit, consider adding the header to the description. The original 
message started with "The wrong placement of add pass with optimizations led to 
-funique-internal-linkage-names being disabled." The header was missing.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Nemanja Ivanovic via Phabricator via cfe-commits
nemanjai added a comment.

In D87921#2288686 , @morehouse wrote:

> The revert did not fix the PPC bots.  I suspect there is some kind of 
> resource issue from the logs:
>
>   msgget:: No space left on device
>   sysmsg.c.tmp: 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:15:
>  int main(): Assertion `msgq != -1' failed.
>
> http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt
> http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux

I am sorry, please feel free to recommit this. I just looked at the machine. 
Somehow we ended up with 32004 System V message queues created by the buildbots 
on the machine. Something didn't clean up properly. This patch has nothing to 
do with it, it just happened to hit the limit when this patch landed. Really 
sorry for the noise here. I'll see if I can get the machine fixed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added a comment.

The revert did not fix the PPC bots.  I suspect there is some kind of resource 
issue from the logs:

  msgget:: No space left on device
  sysmsg.c.tmp: 
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:15:
 int main(): Assertion `msgq != -1' failed.

http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

In D87921#2288395 , @Conanap wrote:

> It looks like this commit is causing a few failures on nearly all PPC bots 
> and a sanitizer bot; would it be possible to revert this commit for now until 
> the issue is resolved?

It would be helpful if you provide a link. (My confidence level with this patch 
is still high and I think we really need good reasons to revert it. Though it 
has been reverted now.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Sriraman Tallam via cfe-commits
On Tue, Sep 22, 2020 at 11:28 AM Albion Fung via Phabricator
 wrote:
>
> Conanap added a comment.
>
> It looks like this commit is causing a few failures on nearly all PPC bots 
> and a sanitizer bot; would it be possible to revert this commit for now until 
> the issue is resolved?

Ya sure, I can revert this. I do not have access to a PPC machine and
I could use some help to get it back in at an appropriate time.

Thanks
Sri

>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D87921/new/
>
> https://reviews.llvm.org/D87921
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Albion Fung via Phabricator via cfe-commits
Conanap added a comment.

It looks like this commit is causing a few failures on nearly all PPC bots and 
a sanitizer bot; would it be possible to revert this commit for now until the 
issue is resolved?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Ahsan Saghir via Phabricator via cfe-commits
saghir added a comment.

In D87921#2288096 , @morehouse wrote:

> Thanks for looking.  Indeed, it looks like an issue with the disk being full 
> on the bot.

Hi, I checked the disk is not full on the bot. I am not sure what is going on 
here but its definitely not a disk space issue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added a comment.

Thanks for looking.  Indeed, it looks like an issue with the disk being full on 
the bot.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Sriraman Tallam via cfe-commits
On Tue, Sep 22, 2020 at 8:34 AM Fāng-ruì Sòng  wrote:
>
> FWIW I tested check-msan in a -DCMAKE_BUILD_TYPE=Release build on a
> powerpc64le machine. All tests passed. I cannot connect the failure to
> the clang patch.

Thanks for doing this! Much appreciated!

>
> On Mon, Sep 21, 2020 at 10:02 PM Sriraman Tallam  wrote:
> >
> > On Mon, Sep 21, 2020 at 5:58 PM Matt Morehouse via Phabricator
> >  wrote:
> > >
> > > morehouse added a comment.
> > >
> > > This change appears to trigger an assertion failure in sysmsg.c on the 
> > > PPC bot:  
> > > http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/26845/steps/ninja%20check%
> > >
> > >    TEST 'SanitizerCommon-msan-powerpc64le-Linux :: 
> > > Linux/sysmsg.c' FAILED 
> > >   Script:
> > >   --
> > >   : 'RUN: at line 1';  
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/./bin/clang
> > >   -gline-tables-only -fsanitize=memory  -m64 -fno-function-sections  -ldl 
> > > -O1 
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
> > >  -o 
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> > >  &&  
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> > >   --
> > >   Exit Code: 134
> > >
> > >   Command Output (stderr):
> > >   --
> > >   sysmsg.c.tmp: 
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:14:
> > >  int main(): Assertion `msgq != -1' failed.
> > >   
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.script:
> > >  line 1: 2982426 Aborted (core dumped) 
> > > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> > >
> > >   --
> > >
> > > It's not immediately obvious to me what is going wrong.  If you could 
> > > take a look, I'd appreciate it.  Otherwise I will look closer tomorrow.
> >
> > I am having trouble getting access to a PPC machine,  this is going to
> > take me longer. Should I revert the patch?
> >
> > Thanks
> > Sri
> >
> > >
> > >
> > > Repository:
> > >   rG LLVM Github Monorepo
> > >
> > > CHANGES SINCE LAST ACTION
> > >   https://reviews.llvm.org/D87921/new/
> > >
> > > https://reviews.llvm.org/D87921
> > >
>
>
>
> --
> 宋方睿
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-22 Thread Fāng-ruì Sòng via cfe-commits
FWIW I tested check-msan in a -DCMAKE_BUILD_TYPE=Release build on a
powerpc64le machine. All tests passed. I cannot connect the failure to
the clang patch.

On Mon, Sep 21, 2020 at 10:02 PM Sriraman Tallam  wrote:
>
> On Mon, Sep 21, 2020 at 5:58 PM Matt Morehouse via Phabricator
>  wrote:
> >
> > morehouse added a comment.
> >
> > This change appears to trigger an assertion failure in sysmsg.c on the PPC 
> > bot:  
> > http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/26845/steps/ninja%20check%
> >
> >    TEST 'SanitizerCommon-msan-powerpc64le-Linux :: 
> > Linux/sysmsg.c' FAILED 
> >   Script:
> >   --
> >   : 'RUN: at line 1';  
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/./bin/clang 
> >  -gline-tables-only -fsanitize=memory  -m64 -fno-function-sections  -ldl 
> > -O1 
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
> >  -o 
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> >  &&  
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> >   --
> >   Exit Code: 134
> >
> >   Command Output (stderr):
> >   --
> >   sysmsg.c.tmp: 
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:14:
> >  int main(): Assertion `msgq != -1' failed.
> >   
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.script:
> >  line 1: 2982426 Aborted (core dumped) 
> > /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
> >
> >   --
> >
> > It's not immediately obvious to me what is going wrong.  If you could take 
> > a look, I'd appreciate it.  Otherwise I will look closer tomorrow.
>
> I am having trouble getting access to a PPC machine,  this is going to
> take me longer. Should I revert the patch?
>
> Thanks
> Sri
>
> >
> >
> > Repository:
> >   rG LLVM Github Monorepo
> >
> > CHANGES SINCE LAST ACTION
> >   https://reviews.llvm.org/D87921/new/
> >
> > https://reviews.llvm.org/D87921
> >



-- 
宋方睿
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-21 Thread Sriraman Tallam via cfe-commits
On Mon, Sep 21, 2020 at 5:58 PM Matt Morehouse via Phabricator
 wrote:
>
> morehouse added a comment.
>
> This change appears to trigger an assertion failure in sysmsg.c on the PPC 
> bot:  
> http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/26845/steps/ninja%20check%
>
>    TEST 'SanitizerCommon-msan-powerpc64le-Linux :: 
> Linux/sysmsg.c' FAILED 
>   Script:
>   --
>   : 'RUN: at line 1';  
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/./bin/clang  
> -gline-tables-only -fsanitize=memory  -m64 -fno-function-sections  -ldl -O1 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
>  -o 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>  &&  
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>   --
>   Exit Code: 134
>
>   Command Output (stderr):
>   --
>   sysmsg.c.tmp: 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:14:
>  int main(): Assertion `msgq != -1' failed.
>   
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.script:
>  line 1: 2982426 Aborted (core dumped) 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>
>   --
>
> It's not immediately obvious to me what is going wrong.  If you could take a 
> look, I'd appreciate it.  Otherwise I will look closer tomorrow.

I am having trouble getting access to a PPC machine,  this is going to
take me longer. Should I revert the patch?

Thanks
Sri

>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D87921/new/
>
> https://reviews.llvm.org/D87921
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-21 Thread Sriraman Tallam via cfe-commits
On Mon, Sep 21, 2020 at 5:58 PM Matt Morehouse via Phabricator
 wrote:
>
> morehouse added a comment.
>
> This change appears to trigger an assertion failure in sysmsg.c on the PPC 
> bot:  
> http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/26845/steps/ninja%20check%
>
>    TEST 'SanitizerCommon-msan-powerpc64le-Linux :: 
> Linux/sysmsg.c' FAILED 
>   Script:
>   --
>   : 'RUN: at line 1';  
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/./bin/clang  
> -gline-tables-only -fsanitize=memory  -m64 -fno-function-sections  -ldl -O1 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
>  -o 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>  &&  
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>   --
>   Exit Code: 134
>
>   Command Output (stderr):
>   --
>   sysmsg.c.tmp: 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:14:
>  int main(): Assertion `msgq != -1' failed.
>   
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.script:
>  line 1: 2982426 Aborted (core dumped) 
> /home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
>
>   --
>
> It's not immediately obvious to me what is going wrong.  If you could take a 
> look, I'd appreciate it.  Otherwise I will look closer tomorrow.

Surprised that this change is responsible.  I will take a look too. Thanks.

>
>
> Repository:
>   rG LLVM Github Monorepo
>
> CHANGES SINCE LAST ACTION
>   https://reviews.llvm.org/D87921/new/
>
> https://reviews.llvm.org/D87921
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-21 Thread Matt Morehouse via Phabricator via cfe-commits
morehouse added a comment.

This change appears to trigger an assertion failure in sysmsg.c on the PPC bot: 
 
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/26845/steps/ninja%20check%

   TEST 'SanitizerCommon-msan-powerpc64le-Linux :: 
Linux/sysmsg.c' FAILED 
  Script:
  --
  : 'RUN: at line 1';  
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/./bin/clang  
-gline-tables-only -fsanitize=memory  -m64 -fno-function-sections  -ldl -O1 
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c
 -o 
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
 &&  
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
  --
  Exit Code: 134
  
  Command Output (stderr):
  --
  sysmsg.c.tmp: 
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/llvm/compiler-rt/test/sanitizer_common/TestCases/Linux/sysmsg.c:14:
 int main(): Assertion `msgq != -1' failed.
  
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.script:
 line 1: 2982426 Aborted (core dumped) 
/home/buildbots/ppc64le-clang-lnt-test/clang-ppc64le-lnt/stage1/projects/compiler-rt/test/sanitizer_common/msan-powerpc64le-Linux/Linux/Output/sysmsg.c.tmp
  
  --

It's not immediately obvious to me what is going wrong.  If you could take a 
look, I'd appreciate it.  Otherwise I will look closer tomorrow.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D87921: Fix -funique-internal-linkage-names to work with -O2 and new pass manager

2020-09-21 Thread Sriraman Tallam via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6950db36d33d: The wrong placement of add pass with 
optimizations led to -funique-internal… (authored by tmsriram).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Changed prior to commit:
  https://reviews.llvm.org/D87921?vs=292852=293208#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87921/new/

https://reviews.llvm.org/D87921

Files:
  clang/lib/CodeGen/BackendUtil.cpp
  clang/test/CodeGen/unique-internal-linkage-names.cpp


Index: clang/test/CodeGen/unique-internal-linkage-names.cpp
===
--- clang/test/CodeGen/unique-internal-linkage-names.cpp
+++ clang/test/CodeGen/unique-internal-linkage-names.cpp
@@ -1,8 +1,10 @@
 // This test checks if internal linkage symbols get unique names with
 // -funique-internal-linkage-names option.
 // RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -o - < %s | FileCheck 
%s --check-prefix=PLAIN
-// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm 
-funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
-// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm 
-fexperimental-new-pass-manager -funique-internal-linkage-names -o - < %s | 
FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64 -x c++ -O0 -S -emit-llvm 
-funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64 -x c++ -O1 -S -emit-llvm 
-funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUEO1
+// RUN: %clang_cc1 -triple x86_64 -x c++ -O0 -S -emit-llvm 
-fexperimental-new-pass-manager -funique-internal-linkage-names -o - < %s | 
FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64 -x c++ -O1 -S -emit-llvm 
-fexperimental-new-pass-manager -funique-internal-linkage-names -o - < %s | 
FileCheck %s --check-prefix=UNIQUEO1
 
 static int glob;
 static int foo() {
@@ -59,3 +61,7 @@
 // UNIQUE: define weak_odr i32 ()* @_ZL4mverv.resolver()
 // UNIQUE: define internal i32 @_ZL4mverv.{{[0-9a-f]+}}()
 // UNIQUE: define internal i32 @_ZL4mverv.sse4.2.{{[0-9a-f]+}}
+// UNIQUEO1: define internal i32 @_ZL3foov.{{[0-9a-f]+}}()
+// UNIQUEO1: define weak_odr i32 ()* @_ZL4mverv.resolver()
+// UNIQUEO1: define internal i32 @_ZL4mverv.{{[0-9a-f]+}}()
+// UNIQUEO1: define internal i32 @_ZL4mverv.sse4.2.{{[0-9a-f]+}}
Index: clang/lib/CodeGen/BackendUtil.cpp
===
--- clang/lib/CodeGen/BackendUtil.cpp
+++ clang/lib/CodeGen/BackendUtil.cpp
@@ -1262,12 +1262,6 @@
   if (LangOpts.Sanitize.has(SanitizerKind::LocalBounds))
 MPM.addPass(createModuleToFunctionPassAdaptor(BoundsCheckingPass()));
 
-  // Add UniqueInternalLinkageNames Pass which renames internal linkage
-  // symbols with unique names.
-  if (CodeGenOpts.UniqueInternalLinkageNames) {
-MPM.addPass(UniqueInternalLinkageNamesPass());
-  }
-
   // Lastly, add semantically necessary passes for LTO.
   if (IsLTO || IsThinLTO) {
 MPM.addPass(CanonicalizeAliasesPass());
@@ -1363,12 +1357,6 @@
   MPM.addPass(InstrProfiling(*Options, false));
 });
 
-  // Add UniqueInternalLinkageNames Pass which renames internal linkage
-  // symbols with unique names.
-  if (CodeGenOpts.UniqueInternalLinkageNames) {
-MPM.addPass(UniqueInternalLinkageNamesPass());
-  }
-
   if (IsThinLTO) {
 MPM = PB.buildThinLTOPreLinkDefaultPipeline(
 Level, CodeGenOpts.DebugPassManager);
@@ -1385,6 +1373,11 @@
   }
 }
 
+// Add UniqueInternalLinkageNames Pass which renames internal linkage
+// symbols with unique names.
+if (CodeGenOpts.UniqueInternalLinkageNames)
+  MPM.addPass(UniqueInternalLinkageNamesPass());
+
 if (CodeGenOpts.MemProf) {
   MPM.addPass(createModuleToFunctionPassAdaptor(MemProfilerPass()));
   MPM.addPass(ModuleMemProfilerPass());


Index: clang/test/CodeGen/unique-internal-linkage-names.cpp
===
--- clang/test/CodeGen/unique-internal-linkage-names.cpp
+++ clang/test/CodeGen/unique-internal-linkage-names.cpp
@@ -1,8 +1,10 @@
 // This test checks if internal linkage symbols get unique names with
 // -funique-internal-linkage-names option.
 // RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -o - < %s | FileCheck %s --check-prefix=PLAIN
-// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
-// RUN: %clang_cc1 -triple x86_64 -x c++ -S -emit-llvm -fexperimental-new-pass-manager -funique-internal-linkage-names -o - < %s | FileCheck %s --check-prefix=UNIQUE
+// RUN: %clang_cc1 -triple x86_64 -x c++ -O0 -S -emit-llvm -funique-internal-linkage-names -o - < %s | FileCheck %s