r348595 - Revert "Multiversioning- Ensure all MV functions are emitted."

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 7 06:56:50 PST 2018


Author: erichkeane
Date: Fri Dec  7 06:56:50 2018
New Revision: 348595

URL: http://llvm.org/viewvc/llvm-project?rev=348595&view=rev
Log:
Revert "Multiversioning- Ensure all MV functions are emitted."

This reverts commit 65df29f9318ac13a633c0ce13b2b0bccf06e79ca.

AS suggested by @rsmith here: https://reviews.llvm.org/rL345839
I'm reverting this and solving the initial problem in a different way.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/CodeGen/attr-target-mv.c
    cfe/trunk/test/CodeGenCXX/attr-cpuspecific.cpp
    cfe/trunk/test/CodeGenCXX/attr-target-mv-member-funcs.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=348595&r1=348594&r2=348595&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Fri Dec  7 06:56:50 2018
@@ -9840,10 +9840,6 @@ bool ASTContext::DeclMustBeEmitted(const
     return true;
 
   if (const auto *FD = dyn_cast<FunctionDecl>(D)) {
-    // Multiversioned functions always have to be emitted, because they are used
-    // by the resolver.
-    if (FD->isMultiVersion())
-      return true;
     // Forward declarations aren't required.
     if (!FD->doesThisDeclarationHaveABody())
       return FD->doesDeclarationForceExternallyVisibleDefinition();

Modified: cfe/trunk/test/CodeGen/attr-target-mv.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/attr-target-mv.c?rev=348595&r1=348594&r2=348595&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/attr-target-mv.c (original)
+++ cfe/trunk/test/CodeGen/attr-target-mv.c Fri Dec  7 06:56:50 2018
@@ -86,16 +86,6 @@ void bar5() {
 // WINDOWS: call i32 @foo.sse4.2
 // WINDOWS: call i32 @foo
 
-// LINUX: define linkonce i32 @foo_inline.arch_ivybridge()
-// LINUX: ret i32 1
-// LINUX: define linkonce i32 @foo_inline()
-// LINUX: ret i32 2
-
-// WINDOWS: define linkonce_odr dso_local i32 @foo_inline.arch_ivybridge()
-// WINDOWS: ret i32 1
-// WINDOWS: define linkonce_odr dso_local i32 @foo_inline()
-// WINDOWS: ret i32 2
-
 // LINUX: define i32 @bar2()
 // LINUX: call i32 @foo_inline.ifunc()
 
@@ -130,22 +120,6 @@ void bar5() {
 // WINDOWS: call void @foo_decls.sse4.2
 // Windows: call void @foo_decls
 
-// LINUX: define linkonce void @foo_decls()
-// LINUX: define linkonce void @foo_decls.sse4.2()
-
-// WINDOWS: define linkonce_odr dso_local void @foo_decls()
-// WINDOWS: define linkonce_odr dso_local void @foo_decls.sse4.2()
-
-// LINUX: define linkonce void @foo_multi(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// LINUX: define linkonce void @foo_multi.avx_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// LINUX: define linkonce void @foo_multi.fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// LINUX: define linkonce void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-
-// WINDOWS: define linkonce_odr dso_local void @foo_multi(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// WINDOWS: define linkonce_odr dso_local void @foo_multi.avx_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// WINDOWS: define linkonce_odr dso_local void @foo_multi.fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-// WINDOWS: define linkonce_odr dso_local void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
-
 // LINUX: define void @bar4()
 // LINUX: call void @foo_multi.ifunc(i32 1, double 5.{{[0+e]*}})
 
@@ -233,3 +207,26 @@ void bar5() {
 
 // WINDOWS: declare dso_local i32 @foo_inline.arch_sandybridge()
 
+// LINUX: define linkonce i32 @foo_inline.arch_ivybridge()
+// LINUX: ret i32 1
+// LINUX: define linkonce i32 @foo_inline()
+// LINUX: ret i32 2
+
+// WINDOWS: define linkonce_odr dso_local i32 @foo_inline.arch_ivybridge()
+// WINDOWS: ret i32 1
+// WINDOWS: define linkonce_odr dso_local i32 @foo_inline()
+// WINDOWS: ret i32 2
+
+// LINUX: define linkonce void @foo_decls()
+// LINUX: define linkonce void @foo_decls.sse4.2()
+
+// WINDOWS: define linkonce_odr dso_local void @foo_decls()
+// WINDOWS: define linkonce_odr dso_local void @foo_decls.sse4.2()
+
+// LINUX: define linkonce void @foo_multi.avx_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
+// LINUX: define linkonce void @foo_multi.fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
+// LINUX: define linkonce void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
+
+// WINDOWS: define linkonce_odr dso_local void @foo_multi.avx_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
+// WINDOWS: define linkonce_odr dso_local void @foo_multi.fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})
+// WINDOWS: define linkonce_odr dso_local void @foo_multi.arch_ivybridge_fma4_sse4.2(i32 %{{[^,]+}}, double %{{[^\)]+}})

Modified: cfe/trunk/test/CodeGenCXX/attr-cpuspecific.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr-cpuspecific.cpp?rev=348595&r1=348594&r2=348595&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/attr-cpuspecific.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/attr-cpuspecific.cpp Fri Dec  7 06:56:50 2018
@@ -13,13 +13,11 @@ void foo() {
   s.Func();
 }
 
-
-// LINUX: define linkonce_odr void @_ZN1S4FuncEv.O
 // LINUX: define void (%struct.S*)* @_ZN1S4FuncEv.resolver
 // LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.S
 // LINUX: ret void (%struct.S*)* @_ZN1S4FuncEv.O
 
-// WINDOWS: define linkonce_odr dso_local void @"?Func at S@@QEAAXXZ.O"
 // WINDOWS: define dso_local void @"?Func at S@@QEAAXXZ"(%struct.S*)
 // WINDOWS: musttail call void @"?Func at S@@QEAAXXZ.S"(%struct.S* %0)
 // WINDOWS: musttail call void @"?Func at S@@QEAAXXZ.O"(%struct.S* %0)
+

Modified: cfe/trunk/test/CodeGenCXX/attr-target-mv-member-funcs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr-target-mv-member-funcs.cpp?rev=348595&r1=348594&r2=348595&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/attr-target-mv-member-funcs.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/attr-target-mv-member-funcs.cpp Fri Dec  7 06:56:50 2018
@@ -73,25 +73,6 @@ int templ_use() {
 // LINUX: @_ZN5templIiE3fooEi.ifunc = ifunc i32 (%struct.templ*, i32), i32 (%struct.templ*, i32)* ()* @_ZN5templIiE3fooEi.resolver
 // LINUX: @_ZN5templIdE3fooEi.ifunc = ifunc i32 (%struct.templ.0*, i32), i32 (%struct.templ.0*, i32)* ()* @_ZN5templIdE3fooEi.resolver
 
-
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32)
-// LINUX: ret i32 0
-
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z.sse4.2"(%struct.S* %this, i32)
-// WINDOWS: ret i32 0
-
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32)
-// LINUX: ret i32 1
-
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z.arch_ivybridge"(%struct.S* %this, i32)
-// WINDOWS: ret i32 1
-
-// LINUX: define linkonce_odr i32 @_ZN1S3fooEi(%struct.S* %this, i32)
-// LINUX: ret i32 2
-
-// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z"(%struct.S* %this, i32)
-// WINDOWS: ret i32 2
-
 // LINUX: define i32 @_Z3barv()
 // LINUX: %s = alloca %struct.S, align 1
 // LINUX: %s2 = alloca %struct.S, align 1
@@ -196,26 +177,44 @@ int templ_use() {
 // WINDOWS: call i32 @"?foo@?$templ at N@@QEAAHH at Z.sse4.2"
 // WINDOWS: call i32 @"?foo@?$templ at N@@QEAAHH at Z"
 
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.sse4.2(%struct.S* %this, i32)
+// LINUX: ret i32 0
+
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z.sse4.2"(%struct.S* %this, i32)
+// WINDOWS: ret i32 0
+
+// LINUX: declare i32 @_ZN1S3fooEi.arch_sandybridge(%struct.S*, i32)
+
+// WINDOWS: declare dso_local i32 @"?foo at S@@QEAAHH at Z.arch_sandybridge"(%struct.S*, i32)
+
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi.arch_ivybridge(%struct.S* %this, i32)
+// LINUX: ret i32 1
+
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z.arch_ivybridge"(%struct.S* %this, i32)
+// WINDOWS: ret i32 1
+
+// LINUX: define linkonce_odr i32 @_ZN1S3fooEi(%struct.S* %this, i32)
+// LINUX: ret i32 2
+
+// WINDOWS: define linkonce_odr dso_local i32 @"?foo at S@@QEAAHH at Z"(%struct.S* %this, i32)
+// WINDOWS: ret i32 2
+
 // LINUX: define linkonce_odr i32 @_ZN5templIiE3fooEi.sse4.2
+// LINUX: declare i32 @_ZN5templIiE3fooEi.arch_sandybridge
 // LINUX: define linkonce_odr i32 @_ZN5templIiE3fooEi.arch_ivybridge
 // LINUX: define linkonce_odr i32 @_ZN5templIiE3fooEi
 
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at H@@QEAAHH at Z.sse4.2"
+// WINDOWS: declare dso_local i32 @"?foo@?$templ at H@@QEAAHH at Z.arch_sandybridge"
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at H@@QEAAHH at Z.arch_ivybridge"
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at H@@QEAAHH at Z"
 
 // LINUX: define linkonce_odr i32 @_ZN5templIdE3fooEi.sse4.2
+// LINUX: declare i32 @_ZN5templIdE3fooEi.arch_sandybridge
 // LINUX: define linkonce_odr i32 @_ZN5templIdE3fooEi.arch_ivybridge
 // LINUX: define linkonce_odr i32 @_ZN5templIdE3fooEi
 
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at N@@QEAAHH at Z.sse4.2"
+// WINDOWS: declare dso_local i32 @"?foo@?$templ at N@@QEAAHH at Z.arch_sandybridge"
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at N@@QEAAHH at Z.arch_ivybridge"
 // WINDOWS: define linkonce_odr dso_local i32 @"?foo@?$templ at N@@QEAAHH at Z"
-
-// LINUX: declare i32 @_ZN1S3fooEi.arch_sandybridge(%struct.S*, i32)
-// LINUX: declare i32 @_ZN5templIiE3fooEi.arch_sandybridge
-// LINUX: declare i32 @_ZN5templIdE3fooEi.arch_sandybridge
-
-// WINDOWS: declare dso_local i32 @"?foo at S@@QEAAHH at Z.arch_sandybridge"(%struct.S*, i32)
-// WINDOWS: declare dso_local i32 @"?foo@?$templ at H@@QEAAHH at Z.arch_sandybridge"
-// WINDOWS: declare dso_local i32 @"?foo@?$templ at N@@QEAAHH at Z.arch_sandybridge"




More information about the cfe-commits mailing list