Author: Zarko Todorovski Date: 2021-06-23T07:40:38-04:00 New Revision: 76c931ae42cf1080199a238446306e8554ebb6de
URL: https://github.com/llvm/llvm-project/commit/76c931ae42cf1080199a238446306e8554ebb6de DIFF: https://github.com/llvm/llvm-project/commit/76c931ae42cf1080199a238446306e8554ebb6de.diff LOG: [AIX][PowerPC] Remove error when specifying mabi=vec-default on AIX The default Altivec ABI was implemented but the clang error for specifying its use still remains. Users could get around this but not specifying the type of Altivec ABI but we need to remove the error. Reviewed By: jsji Differential Revision: https://reviews.llvm.org/D102094 Added: clang/test/Driver/aix-vec_extabi.c Modified: clang/include/clang/Basic/DiagnosticDriverKinds.td clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/test/CodeGen/altivec.c clang/test/Preprocessor/aix-vec_extabi.c Removed: clang/test/Driver/aix-vec-extabi.c ################################################################################ diff --git a/clang/include/clang/Basic/DiagnosticDriverKinds.td b/clang/include/clang/Basic/DiagnosticDriverKinds.td index 6e4a60156fef7..c7da9713b1e4e 100644 --- a/clang/include/clang/Basic/DiagnosticDriverKinds.td +++ b/clang/include/clang/Basic/DiagnosticDriverKinds.td @@ -542,9 +542,6 @@ def err_drv_cannot_mix_options : Error<"cannot specify '%1' along with '%0'">; def err_drv_invalid_object_mode : Error<"OBJECT_MODE setting %0 is not recognized and is not a valid setting.">; -def err_aix_default_altivec_abi : Error< - "The default Altivec ABI on AIX is not yet supported, use '-mabi=vec-extabi' for the extended Altivec ABI">; - def err_aix_unsupported_tls_model : Error<"TLS model '%0' is not yet supported on AIX">; def err_invalid_cxx_abi : Error<"Invalid C++ ABI name '%0'">; diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp index eafe5de8eedb8..b358813a1a017 100644 --- a/clang/lib/Driver/ToolChains/Clang.cpp +++ b/clang/lib/Driver/ToolChains/Clang.cpp @@ -4823,7 +4823,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, if (A->getOption().getID() == options::OPT_mabi_EQ_vec_extabi) CmdArgs.push_back("-mabi=vec-extabi"); else - D.Diag(diag::err_aix_default_altivec_abi); + CmdArgs.push_back("-mabi=vec-default"); } if (Arg *A = Args.getLastArg(options::OPT_Wframe_larger_than_EQ)) { diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 5bbb954c7d4d7..c1b7b027b3b4d 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1859,13 +1859,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, << A->getSpelling() << T.str(); const Option &O = A->getOption(); - if (O.matches(OPT_mabi_EQ_vec_default)) - Diags.Report(diag::err_aix_default_altivec_abi) - << A->getSpelling() << T.str(); - else { - assert(O.matches(OPT_mabi_EQ_vec_extabi)); - Opts.EnableAIXExtendedAltivecABI = 1; - } + Opts.EnableAIXExtendedAltivecABI = O.matches(OPT_mabi_EQ_vec_extabi); } bool NeedLocTracking = false; diff --git a/clang/test/CodeGen/altivec.c b/clang/test/CodeGen/altivec.c index 86b570f15d080..af239b54711c1 100644 --- a/clang/test/CodeGen/altivec.c +++ b/clang/test/CodeGen/altivec.c @@ -4,12 +4,12 @@ // RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-LE // RUN: %clang_cc1 -target-feature +altivec -mabi=vec-extabi -target-cpu pwr8 -triple powerpc-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE // RUN: %clang_cc1 -target-feature +altivec -mabi=vec-extabi -target-cpu pwr8 -triple powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE -// RUN: not %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR -// RUN: not %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc64-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR -// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 -target powerpc-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE -// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 -target powerpc64-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE -// RUN: not %clang -S -emit-llvm -maltivec -mabi=vec-default -mcpu=pwr8 -triple powerpc-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR -// RUN: not %clang -S -emit-llvm -maltivec -mabi=vec-default -mcpu=pwr8 -triple powerpc64-unknown-aix -emit-llvm %s 2>&1 | FileCheck %s --check-prefix=AIX-ERROR +// RUN: %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE +// RUN: %clang_cc1 -target-feature +altivec -mabi=vec-default -target-cpu pwr8 -triple powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE +// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 --target=powerpc-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE +// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-extabi -mcpu=pwr8 --target=powerpc64-unknown-aix %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE +// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-default -mcpu=pwr8 --target=powerpc-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE +// RUN: %clang -S -emit-llvm -maltivec -mabi=vec-default -mcpu=pwr8 --target=powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-BE // Check initialization vector int test0 = (vector int)(1); // CHECK: @test0 ={{.*}} global <4 x i32> <i32 1, i32 1, i32 1, i32 1> @@ -52,5 +52,3 @@ void test3() { vector float vf; vf++; // CHECK: fadd <4 x float> {{.*}} <float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}, float 1.000000e+{{0+}}> } - -// AIX-ERROR: error: The default Altivec ABI on AIX is not yet supported, use '-mabi=vec-extabi' for the extended Altivec ABI diff --git a/clang/test/Driver/aix-vec-extabi.c b/clang/test/Driver/aix-vec-extabi.c deleted file mode 100644 index ccc3b0732e4ba..0000000000000 --- a/clang/test/Driver/aix-vec-extabi.c +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: %clang -### -target powerpc-unknown-aix -S -maltivec -mabi=vec-extabi %s 2>&1 | \ -// RUN: FileCheck %s - -// CHECK: "-cc1" -// CHECK-SAME: "-mabi=vec-extabi" - -// RUN: %clang -### -target powerpc-unknown-aix -S -maltivec -mabi=vec-default %s 2>&1 | \ -// RUN: FileCheck %s --check-prefix=ERROR - -// ERROR: The default Altivec ABI on AIX is not yet supported, use '-mabi=vec-extabi' for the extended Altivec ABI diff --git a/clang/test/Driver/aix-vec_extabi.c b/clang/test/Driver/aix-vec_extabi.c new file mode 100644 index 0000000000000..93de4a25e3e76 --- /dev/null +++ b/clang/test/Driver/aix-vec_extabi.c @@ -0,0 +1,16 @@ +// RUN: %clang -### -target powerpc-unknown-aix -S %s 2>&1 | \ +// RUN: FileCheck %s --implicit-check-not=vec-extabi +// RUN: %clang -### -target powerpc-unknown-aix -S -maltivec %s 2>&1 | \ +// RUN: FileCheck %s --implicit-check-not=vec-extabi +// RUN: %clang -### -target powerpc-unknown-aix -S -maltivec -mabi=vec-default %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=DFLTABI --implicit-check-not=vec-extabi +// RUN: %clang -### -target powerpc-unknown-aix -S -mabi=vec-extabi %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=EXTABI +// RUN: %clang -### -target powerpc-unknown-aix -S -maltivec -mabi=vec-extabi %s 2>&1 | \ +// RUN: FileCheck %s --check-prefix=EXTABI +/ +// EXTABI: "-cc1" +// EXTABI-SAME: "-mabi=vec-extabi" + +// DFLTABI: "-cc1" +// DFLTABI-SAME: "-mabi=vec-default" diff --git a/clang/test/Preprocessor/aix-vec_extabi.c b/clang/test/Preprocessor/aix-vec_extabi.c index b87b992d8d45d..c83c8b64487ee 100644 --- a/clang/test/Preprocessor/aix-vec_extabi.c +++ b/clang/test/Preprocessor/aix-vec_extabi.c @@ -2,11 +2,11 @@ // RUN: | FileCheck %s -check-prefix=EXTABI // RUN: %clang -target powerpc64-ibm-aix-xcoff -mcpu=pwr8 -E -dM -maltivec -mabi=vec-extabi %s -o - 2>&1 \ // RUN: | FileCheck %s -check-prefix=EXTABI -// RUN: not %clang -target powerpc-ibm-aix-xcoff -mcpu=pwr8 -E -dM -maltivec -mabi=vec-default %s 2>&1 \ +// RUN: %clang -target powerpc-ibm-aix-xcoff -mcpu=pwr8 -E -dM -maltivec -mabi=vec-default %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=DFLTABI -// RUN: not %clang -target powerpc64-ibm-aix-xcoff -mcpu=pwr8 -E -dM -maltivec -mabi=vec-default %s 2>&1 \ +// RUN: %clang -target powerpc64-ibm-aix-xcoff -mcpu=pwr8 -E -dM -maltivec -mabi=vec-default %s 2>&1 \ // RUN: | FileCheck %s -check-prefix=DFLTABI -// EXTABI: #define __EXTABI__ -// DFLTABI: The default Altivec ABI on AIX is not yet supported, use '-mabi=vec-extabi' for the extended Altivec ABI +// EXTABI: #define __EXTABI__ +// DFLTABI-NOT: #define __EXTABI__ _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits