[PATCH] D155700: [ThinLTO][AIX] Enable thinLTO on AIX

wael yehia via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 10:37:39 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG645f6dcd69a5: [ThinLTO][AIX] Enable thinlto on AIX (authored by w2yehia).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155700

Files:
  clang/lib/Driver/Driver.cpp
  clang/lib/Driver/ToolChains/CommonArgs.cpp
  clang/test/CodeGen/thinlto-backend-option.ll
  clang/test/CodeGen/thinlto-emit-llvm.c
  clang/test/Driver/aix-unsupported-features.c
  clang/test/Driver/thinlto_backend.c
  clang/test/Integration/thinlto_profile_sample_accurate.c


Index: clang/test/Integration/thinlto_profile_sample_accurate.c
===================================================================
--- clang/test/Integration/thinlto_profile_sample_accurate.c
+++ clang/test/Integration/thinlto_profile_sample_accurate.c
@@ -1,5 +1,3 @@
-// XFAIL: target={{.*}}-aix{{.*}}
-
 // Test to ensure -emit-llvm profile-sample-accurate is honored in ThinLTO.
 // RUN: %clang -O2 %s -flto=thin -fprofile-sample-accurate -c -o %t.o
 // RUN: llvm-lto -thinlto -o %t %t.o
Index: clang/test/Driver/thinlto_backend.c
===================================================================
--- clang/test/Driver/thinlto_backend.c
+++ clang/test/Driver/thinlto_backend.c
@@ -1,5 +1,3 @@
-// XFAIL: target={{.*}}-aix{{.*}}
-
 // RUN: %clang -O2 %s -flto=thin -c -o %t.o
 // RUN: llvm-lto -thinlto -o %t %t.o
 
Index: clang/test/Driver/aix-unsupported-features.c
===================================================================
--- clang/test/Driver/aix-unsupported-features.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %clang -target powerpc-ibm-aix-xcoff -### -flto=thin 2>&1 %s | \
-// RUN:   FileCheck --check-prefix=CHECKTHINLTO %s
-// RUN: %clang -target powerpc64-ibm-aix-xcoff -### -flto=thin 2>&1 %s | \
-// RUN:   FileCheck --check-prefix=CHECKTHINLTO %s
-
-// CHECKTHINLTO: error: the clang compiler does not support 'thinLTO on AIX'
-
Index: clang/test/CodeGen/thinlto-emit-llvm.c
===================================================================
--- clang/test/CodeGen/thinlto-emit-llvm.c
+++ clang/test/CodeGen/thinlto-emit-llvm.c
@@ -1,5 +1,3 @@
-// XFAIL: target={{.*}}-aix{{.*}}
-
 // Test to ensure -emit-llvm and -emit-llvm-bc work when invoking the
 // ThinLTO backend path.
 // RUN: %clang -O2 %s -flto=thin -c -o %t.o
Index: clang/test/CodeGen/thinlto-backend-option.ll
===================================================================
--- clang/test/CodeGen/thinlto-backend-option.ll
+++ clang/test/CodeGen/thinlto-backend-option.ll
@@ -6,8 +6,6 @@
 ; scenario independent of any particular backend options that may exist now or
 ; in the future.
 
-; XFAIL: target={{.*}}-aix{{.*}}
-
 ; RUN: %clang -flto=thin -c -o %t.o %s
 ; RUN: llvm-lto -thinlto -o %t %t.o
 ; RUN: not %clang_cc1 -x ir %t.o -fthinlto-index=%t.thinlto.bc -mllvm -nonexistent -emit-obj -o /dev/null 2>&1 | FileCheck %s -check-prefix=UNKNOWN
Index: clang/lib/Driver/ToolChains/CommonArgs.cpp
===================================================================
--- clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -671,8 +671,11 @@
     CmdArgs.push_back(Args.MakeArgString(
         Twine(PluginOptPrefix) + "dwo_dir=" + Output.getFilename() + "_dwo"));
 
-  if (IsThinLTO)
+  if (IsThinLTO && !IsOSAIX)
     CmdArgs.push_back(Args.MakeArgString(Twine(PluginOptPrefix) + "thinlto"));
+  else if (IsThinLTO && IsOSAIX)
+    CmdArgs.push_back(Args.MakeArgString(Twine("-bdbg:thinlto")));
+
 
   StringRef Parallelism = getLTOParallelism(Args, D);
   if (!Parallelism.empty())
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -4830,8 +4830,6 @@
   }
 
   const llvm::Triple &RawTriple = C.getDefaultToolChain().getTriple();
-  if (RawTriple.isOSAIX() && LTOMode == LTOK_Thin)
-    Diag(diag::err_drv_clang_unsupported) << "thinLTO on AIX";
 
   // Collect the list of architectures.
   llvm::StringSet<> ArchNames;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155700.542103.patch
Type: text/x-patch
Size: 3483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230719/64876c12/attachment.bin>


More information about the cfe-commits mailing list