Author: leonardchan
Date: Thu Jun 20 12:44:51 2019
New Revision: 363971

URL: http://llvm.org/viewvc/llvm-project?rev=363971&view=rev
Log:
[clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runs

This fixes CodeGen/available-externally-suppress.c when the new pass manager is
turned on by default. available_externally was not emitted during -O2 -flto
runs when it should still be retained for link time inlining purposes. This can
be fixed by checking that we aren't LTOPrelinking when adding the
EliminateAvailableExternallyPass.

Differential Revision: https://reviews.llvm.org/D63580

Modified:
    cfe/trunk/test/CodeGen/available-externally-suppress.c

Modified: cfe/trunk/test/CodeGen/available-externally-suppress.c
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/available-externally-suppress.c?rev=363971&r1=363970&r2=363971&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/available-externally-suppress.c (original)
+++ cfe/trunk/test/CodeGen/available-externally-suppress.c Thu Jun 20 12:44:51 
2019
@@ -1,6 +1,9 @@
-// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | 
FileCheck %s
-// RUN: %clang_cc1 -O2 -fno-inline -emit-llvm -o - -triple 
x86_64-apple-darwin10 %s | FileCheck %s
-// RUN: %clang_cc1 -flto -O2 -fno-inline -emit-llvm -o - -triple 
x86_64-apple-darwin10 %s | FileCheck %s -check-prefix=LTO
+// RUN: %clang_cc1 -fno-experimental-new-pass-manager -emit-llvm -o - -triple 
x86_64-apple-darwin10 %s | FileCheck %s
+// RUN: %clang_cc1 -fno-experimental-new-pass-manager -O2 -fno-inline 
-emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
+// RUN: %clang_cc1 -fno-experimental-new-pass-manager -flto -O2 -fno-inline 
-emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s 
-check-prefix=LTO
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -emit-llvm -o - -triple 
x86_64-apple-darwin10 %s | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -O2 -fno-inline -emit-llvm 
-o - -triple x86_64-apple-darwin10 %s | FileCheck %s
+// RUN: %clang_cc1 -fexperimental-new-pass-manager -flto -O2 -fno-inline 
-emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s 
-check-prefix=LTO
 
 // Ensure that we don't emit available_externally functions at -O0.
 // Also should not emit them at -O2, unless -flto is present in which case


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

Reply via email to