[clang] fd448bb - [clang][LTO] Passing vec-extabi to the Backend on AIX

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 06:14:04 PDT 2022


Author: Qiongsi Wu
Date: 2022-10-28T09:13:17-04:00
New Revision: fd448bbedce91bcc6aad9072af58a4fcb7f7bf70

URL: https://github.com/llvm/llvm-project/commit/fd448bbedce91bcc6aad9072af58a4fcb7f7bf70
DIFF: https://github.com/llvm/llvm-project/commit/fd448bbedce91bcc6aad9072af58a4fcb7f7bf70.diff

LOG: [clang][LTO] Passing vec-extabi to the Backend on AIX

This patch passes on the `vec-extabi` mabi option on AIX.

Reviewed By: w2yehia

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

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/CommonArgs.cpp
    clang/test/Driver/lto-aix.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index 3feb1a2a63af3..1fcd160b76fab 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -599,6 +599,10 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
                                         options::OPT_gno_strict_dwarf, true))
       CmdArgs.push_back(
           Args.MakeArgString(Twine(PluginOptPrefix) + "-strict-dwarf=true"));
+
+    if (Args.getLastArg(options::OPT_mabi_EQ_vec_extabi))
+      CmdArgs.push_back(
+          Args.MakeArgString(Twine(PluginOptPrefix) + "-vec-extabi"));
   }
 
   bool UseSeparateSections =

diff  --git a/clang/test/Driver/lto-aix.c b/clang/test/Driver/lto-aix.c
index 88e7eaa4d5df0..e12fa1c3afaee 100644
--- a/clang/test/Driver/lto-aix.c
+++ b/clang/test/Driver/lto-aix.c
@@ -27,6 +27,16 @@
 // O2: "-bplugin_opt:-O2"
 // O3: "-bplugin_opt:-O3"
 //
+// vec-extabi option
+// RUN: %clang --target=powerpc-ibm-aix --sysroot %S/Inputs/aix_ppc_tree %s \
+// RUN:   -fuse-ld=ld -flto -mabi=vec-extabi -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=VECEXTABI %s
+// RUN: %clang --target=powerpc-ibm-aix --sysroot %S/Inputs/aix_ppc_tree %s \
+// RUN:   -fuse-ld=ld -flto -### 2>&1 | FileCheck --check-prefix=NOVECEXTABI %s
+//
+// VECEXTABI: "-bplugin_opt:-vec-extabi"
+// NOVECEXTABI-NOT: "-bplugin_opt:-vec-extabi"
+//
 // Test debugging options
 // RUN: %clang --target=powerpc-ibm-aix -### %s -flto -fuse-ld=ld -gdbx 2>&1 \
 // RUN:   | FileCheck -check-prefix=DBX %s


        


More information about the cfe-commits mailing list