https://github.com/lei137 created https://github.com/llvm/llvm-project/pull/187371
Adds early target feature checking for PowerPC builtins during semantic analysis, catching missing target features before code generation and providing better error messages to users. >From f778ed30b7c71f41a3a582789bf58eefa630f5e1 Mon Sep 17 00:00:00 2001 From: Lei Huang <[email protected]> Date: Wed, 18 Mar 2026 14:58:38 -0400 Subject: [PATCH 1/3] add target feature checking to sema --- clang/lib/Sema/SemaPPC.cpp | 14 ++++++++++++++ clang/test/Sema/builtins-bcd-format-conversion.c | 6 +++--- clang/test/Sema/builtins-bcd-transform.c | 6 +++--- clang/test/Sema/builtins-ppc.c | 10 ++++------ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/clang/lib/Sema/SemaPPC.cpp b/clang/lib/Sema/SemaPPC.cpp index 57c880c81ac9e..8d41130b11648 100644 --- a/clang/lib/Sema/SemaPPC.cpp +++ b/clang/lib/Sema/SemaPPC.cpp @@ -119,6 +119,20 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo &TI, return Diag(TheCall->getBeginLoc(), diag::err_64_bit_builtin_32_bit_tgt) << TheCall->getSourceRange(); + // Check if the builtin requires specific target features + StringRef FeatureList(Context.BuiltinInfo.getRequiredFeatures(BuiltinID)); + if (!FeatureList.empty()) { + const auto *FD = SemaRef.getCurFunctionDecl(/*AllowLambda=*/true); + llvm::StringMap<bool> CallerFeatureMap; + Context.getFunctionFeatureMap(CallerFeatureMap, FD); + if (!Builtin::evaluateRequiredTargetFeatures(FeatureList, + CallerFeatureMap)) { + Diag(TheCall->getBeginLoc(), diag::err_builtin_target_unsupported) + << TheCall->getSourceRange(); + return true; + } + } + // Common BCD type-validation helpers // Emit error diagnostics and return true on success // - IsTypeVecUChar: enforces vector unsigned char diff --git a/clang/test/Sema/builtins-bcd-format-conversion.c b/clang/test/Sema/builtins-bcd-format-conversion.c index 059340b0344e1..dc2f2b64d1a49 100644 --- a/clang/test/Sema/builtins-bcd-format-conversion.c +++ b/clang/test/Sema/builtins-bcd-format-conversion.c @@ -1,9 +1,9 @@ // Testfile to verify Sema diagnostics for BCD builtins bcdshift, bcdshiftround, bcdtruncate. // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc-unknown-unknown -fsyntax-only -verify %s #include <altivec.h> #define DECL_COMMON_VARS \ diff --git a/clang/test/Sema/builtins-bcd-transform.c b/clang/test/Sema/builtins-bcd-transform.c index 103a6be6452b5..bb81f7cf5cbc9 100644 --- a/clang/test/Sema/builtins-bcd-transform.c +++ b/clang/test/Sema/builtins-bcd-transform.c @@ -1,8 +1,8 @@ // Testfile to verify the semantics and the error handling for BCD builtins national2packed, packed2zoned and zoned2packed. // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc-unknown-unknown -fsyntax-only -verify %s #include <altivec.h> vector unsigned char test_national2packed(void) diff --git a/clang/test/Sema/builtins-ppc.c b/clang/test/Sema/builtins-ppc.c index 0f59b990331cb..2def81fd7b19e 100644 --- a/clang/test/Sema/builtins-ppc.c +++ b/clang/test/Sema/builtins-ppc.c @@ -3,12 +3,10 @@ // RUN: -triple powerpc64-unknown-unknown -DTEST_HTM -fsyntax-only \ // RUN: -verify %s -// RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto \ -// RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \ -// RUN: -verify %s -// RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto \ -// RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \ -// RUN: -target-feature +vsx -verify %s +// RUN: %clang_cc1 -target-cpu pwr8 -triple powerpc64le-unknown-unknown \ +// RUN: -DTEST_CRYPTO -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-cpu pwr8 -triple powerpc64le-unknown-unknown \ +// RUN: -DTEST_CRYPTO -fsyntax-only -verify %s // RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -DTEST_MAXMIN -fsyntax-only \ // RUN: -verify %s >From 1f1e42a1facbcea3990724ddf8adbb2a81b5470c Mon Sep 17 00:00:00 2001 From: Lei Huang <[email protected]> Date: Wed, 18 Mar 2026 15:19:10 -0400 Subject: [PATCH 2/3] update feature reqired --- clang/test/Sema/builtins-bcd-format-conversion.c | 6 +++--- clang/test/Sema/builtins-bcd-transform.c | 8 ++++---- clang/test/Sema/builtins-ppc.c | 10 ++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/clang/test/Sema/builtins-bcd-format-conversion.c b/clang/test/Sema/builtins-bcd-format-conversion.c index dc2f2b64d1a49..6136d7c8d99b5 100644 --- a/clang/test/Sema/builtins-bcd-format-conversion.c +++ b/clang/test/Sema/builtins-bcd-format-conversion.c @@ -1,9 +1,9 @@ // Testfile to verify Sema diagnostics for BCD builtins bcdshift, bcdshiftround, bcdtruncate. // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc64-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc-unknown-unknown -fsyntax-only -verify %s #include <altivec.h> #define DECL_COMMON_VARS \ diff --git a/clang/test/Sema/builtins-bcd-transform.c b/clang/test/Sema/builtins-bcd-transform.c index bb81f7cf5cbc9..a153fa792aebc 100644 --- a/clang/test/Sema/builtins-bcd-transform.c +++ b/clang/test/Sema/builtins-bcd-transform.c @@ -1,8 +1,8 @@ // Testfile to verify the semantics and the error handling for BCD builtins national2packed, packed2zoned and zoned2packed. // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-cpu pwr9 -triple powerpc-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc64-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc64le-unknown-unknown -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions -triple powerpc-unknown-unknown -fsyntax-only -verify %s #include <altivec.h> vector unsigned char test_national2packed(void) @@ -27,4 +27,4 @@ vector unsigned char test_zoned2packed(void) vector unsigned char res_a = __builtin_ppc_zoned2packed(a,2); // expected-error-re {{argument value {{.*}} is outside the valid range}} vector unsigned char res_b = __builtin_ppc_zoned2packed(a, -1); // expected-error-re {{argument value {{.*}} is outside the valid range}} return __builtin_ppc_zoned2packed(a,0); -} \ No newline at end of file +} diff --git a/clang/test/Sema/builtins-ppc.c b/clang/test/Sema/builtins-ppc.c index 2def81fd7b19e..b7331f249f2fb 100644 --- a/clang/test/Sema/builtins-ppc.c +++ b/clang/test/Sema/builtins-ppc.c @@ -3,10 +3,12 @@ // RUN: -triple powerpc64-unknown-unknown -DTEST_HTM -fsyntax-only \ // RUN: -verify %s -// RUN: %clang_cc1 -target-cpu pwr8 -triple powerpc64le-unknown-unknown \ -// RUN: -DTEST_CRYPTO -fsyntax-only -verify %s -// RUN: %clang_cc1 -target-cpu pwr8 -triple powerpc64le-unknown-unknown \ -// RUN: -DTEST_CRYPTO -fsyntax-only -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto -target-feature +power8-vector -target-feature +isa-v207-instructions \ +// RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \ +// RUN: -verify %s +// RUN: %clang_cc1 -target-feature +altivec -target-feature +crypto -target-feature +power8-vector -target-feature +isa-v207-instructions \ +// RUN: -triple powerpc64le-unknown-unknown -DTEST_CRYPTO -fsyntax-only \ +// RUN: -target-feature +vsx -verify %s // RUN: %clang_cc1 -triple powerpc64le-unknown-unknown -DTEST_MAXMIN -fsyntax-only \ // RUN: -verify %s >From 88efe9fae4014d7df1a11a8fc43e6e51f0847c0d Mon Sep 17 00:00:00 2001 From: Lei Huang <[email protected]> Date: Wed, 18 Mar 2026 15:58:49 -0400 Subject: [PATCH 3/3] get more specific feature messages --- clang/lib/Sema/SemaPPC.cpp | 10 ++++++++-- clang/test/CodeGen/PowerPC/altivec-ct.c | 4 ++-- clang/test/CodeGen/PowerPC/builtins-ppc-32bit-vec-ll.c | 2 +- clang/test/CodeGen/PowerPC/builtins-ppc-altivec.c | 8 ++++---- clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c | 4 ++-- clang/test/CodeGen/PowerPC/builtins-ppc-error.c | 6 +++--- clang/test/CodeGen/PowerPC/builtins-ppc-p9vector.c | 6 +++--- .../test/CodeGen/PowerPC/builtins-ppc-quadword-char.c | 6 +++--- .../CodeGen/PowerPC/builtins-ppc-quadword-noi128.c | 6 +++--- clang/test/CodeGen/PowerPC/builtins-ppc-quadword.c | 4 ++-- clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c | 4 ++-- clang/test/CodeGen/PowerPC/builtins-ppc-xl-xst.c | 6 +++--- clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat.c | 6 +++--- clang/test/CodeGen/PowerPC/ppc-vector-compare.cpp | 2 +- 14 files changed, 40 insertions(+), 34 deletions(-) diff --git a/clang/lib/Sema/SemaPPC.cpp b/clang/lib/Sema/SemaPPC.cpp index 8d41130b11648..66e6e675abfe0 100644 --- a/clang/lib/Sema/SemaPPC.cpp +++ b/clang/lib/Sema/SemaPPC.cpp @@ -16,6 +16,7 @@ #include "clang/AST/CharUnits.h" #include "clang/AST/Decl.h" #include "clang/AST/Type.h" +#include "clang/Basic/DiagnosticFrontend.h" #include "clang/Basic/DiagnosticSema.h" #include "clang/Basic/SourceLocation.h" #include "clang/Basic/TargetBuiltins.h" @@ -127,8 +128,13 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo &TI, Context.getFunctionFeatureMap(CallerFeatureMap, FD); if (!Builtin::evaluateRequiredTargetFeatures(FeatureList, CallerFeatureMap)) { - Diag(TheCall->getBeginLoc(), diag::err_builtin_target_unsupported) - << TheCall->getSourceRange(); + // Get the builtin name from the CallExpr's callee + const FunctionDecl *BuiltinDecl = TheCall->getDirectCallee(); + Diag(TheCall->getBeginLoc(), diag::err_builtin_needs_feature) + << (BuiltinDecl ? BuiltinDecl->getDeclName() + : DeclarationName(&Context.Idents.get( + Context.BuiltinInfo.getName(BuiltinID)))) + << FeatureList; return true; } } diff --git a/clang/test/CodeGen/PowerPC/altivec-ct.c b/clang/test/CodeGen/PowerPC/altivec-ct.c index 6be6cec409fa1..3f0d7ffd8b356 100644 --- a/clang/test/CodeGen/PowerPC/altivec-ct.c +++ b/clang/test/CodeGen/PowerPC/altivec-ct.c @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +vsx | FileCheck %s -check-prefix=CHECK -check-prefix=VSX -// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature -vsx | FileCheck %s +// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc64le-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx -target-feature +power8-vector | FileCheck %s -check-prefix=CHECK -check-prefix=VSX +// RUN: %clang_cc1 -flax-vector-conversions=none -triple powerpc-linux-gnu -S -O0 -o - %s -target-feature +altivec -target-feature +isa-v207-instructions -target-feature -vsx | FileCheck %s // REQUIRES: powerpc-registered-target diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-32bit-vec-ll.c b/clang/test/CodeGen/PowerPC/builtins-ppc-32bit-vec-ll.c index a865bc59bee25..949fc48d71e32 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-32bit-vec-ll.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-32bit-vec-ll.c @@ -1,6 +1,6 @@ // REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec \ -// RUN: -target-feature +power8-vector -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s +// RUN: -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc-unknown-unknown -emit-llvm %s -o - | FileCheck %s #include <altivec.h> vector signed long long vsll1, vsll2, vsll3; diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-altivec.c b/clang/test/CodeGen/PowerPC/builtins-ppc-altivec.c index 91d1ebd045c58..94c6b33f0fd58 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-altivec.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-altivec.c @@ -1,14 +1,14 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc-unknown-unknown -emit-llvm %s \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=none -faltivec-src-compat=mixed \ // RUN: -o - | FileCheck %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpcle-unknown-unknown -emit-llvm %s \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpcle-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=none -faltivec-src-compat=mixed \ // RUN: -o - | FileCheck %s -check-prefix=CHECK-LE -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64-unknown-unknown -emit-llvm %s \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc64-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=none -faltivec-src-compat=mixed \ // RUN: -o - | FileCheck %s -// RUN: %clang_cc1 -target-feature +altivec -triple powerpc64le-unknown-unknown -emit-llvm %s \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc64le-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=none -faltivec-src-compat=mixed \ // RUN: -o - | FileCheck %s -check-prefix=CHECK-LE // RUN: not %clang_cc1 -triple powerpc64le-unknown-unknown -emit-llvm %s \ diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c b/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c index b4a3a2e33683b..e26c0101bd4b8 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-crypto.c @@ -1,10 +1,10 @@ // REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -triple powerpc64le-unknown-unknown \ -// RUN: -target-feature +crypto -target-feature +power8-vector \ +// RUN: -target-feature +crypto -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -triple powerpc64-unknown-unknown \ -// RUN: -target-feature +crypto -target-feature +power8-vector \ +// RUN: -target-feature +crypto -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -emit-llvm %s -o - | FileCheck %s #include <altivec.h> #define B_INIT1 { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, \ diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-error.c b/clang/test/CodeGen/PowerPC/builtins-ppc-error.c index acee472df7dc3..32eaa194e89be 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-error.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-error.c @@ -1,16 +1,16 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-unknown -fsyntax-only \ // RUN: -flax-vector-conversions=integer \ // RUN: -Wall -Werror -verify %s -// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64le-unknown-unknown -fsyntax-only \ // RUN: -flax-vector-conversions=integer \ // RUN: -Wall -Werror -verify %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-unknown -fsyntax-only \ // RUN: -Wall -Werror -verify %s diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-p9vector.c b/clang/test/CodeGen/PowerPC/builtins-ppc-p9vector.c index 68d32ee14c8fa..d5925cc70c756 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-p9vector.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-p9vector.c @@ -1,15 +1,15 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=integer \ // RUN: -o - | FileCheck %s -check-prefix=CHECK-BE -// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s \ // RUN: -flax-vector-conversions=integer \ // RUN: -o - | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power9-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power9-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s \ // RUN: -o - | FileCheck %s -check-prefix=CHECK-BE diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-char.c b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-char.c index edc9c4cf4e447..16a8e4a7ed6c2 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-char.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-char.c @@ -1,11 +1,11 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-linux -emit-llvm %s -o - | FileCheck %s // -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64le-unknown-linux -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-aix -emit-llvm %s -o - | FileCheck %s #include <altivec.h> diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-noi128.c b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-noi128.c index d078caaef11dd..b9eeeb8d17099 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-noi128.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword-noi128.c @@ -1,12 +1,12 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s -o - | FileCheck \ // RUN: %s -check-prefix=CHECK-LE -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-aix-unknown -emit-llvm %s -o - | FileCheck \ // RUN: %s -check-prefix=CHECK-AIX -// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -O2 -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc-aix-unknown -emit-llvm %s -o - | FileCheck \ // RUN: %s -check-prefix=CHECK-AIX #include <altivec.h> diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword.c b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword.c index 01fa6c6ad17e0..c9573a99ec127 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-quadword.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-quadword.c @@ -1,8 +1,8 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power8-vector \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +power8-vector -target-feature +isa-v207-instructions \ // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s -o - \ // RUN: | FileCheck %s -check-prefix=CHECK-LE diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c b/clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c index 99524fa2f79d0..4ea74d2492cfc 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-vsx.c @@ -1,9 +1,9 @@ // REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature \ -// RUN: +altivec -target-feature +vsx -triple powerpc64-unknown-unknown -emit-llvm \ +// RUN: +altivec -target-feature +vsx -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc64-unknown-unknown -emit-llvm \ // RUN: -U__XL_COMPAT_ALTIVEC__ %s -o - | FileCheck %s // RUN: %clang_cc1 -flax-vector-conversions=none -target-feature \ -// RUN: +altivec -target-feature +vsx -triple powerpc64le-unknown-unknown \ +// RUN: +altivec -target-feature +vsx -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc64le-unknown-unknown \ // RUN: -emit-llvm -U__XL_COMPAT_ALTIVEC__ %s -o - | FileCheck %s -check-prefix=CHECK-LE #include <altivec.h> diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-xl-xst.c b/clang/test/CodeGen/PowerPC/builtins-ppc-xl-xst.c index 81a0345d3f3e8..0d107c6eda7a6 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-xl-xst.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-xl-xst.c @@ -1,9 +1,9 @@ // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +vsx \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx \ // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +vsx \ -// RUN: -target-feature +power8-vector -triple powerpc64le-unknown-unknown \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx \ +// RUN: -target-feature +power8-vector -target-feature +isa-v207-instructions -target-feature +isa-v207-instructions -triple powerpc64le-unknown-unknown \ // RUN: -emit-llvm %s -o - | FileCheck %s -check-prefixes=CHECK,CHECK-P8 #include <altivec.h> diff --git a/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat.c b/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat.c index 702714a4e786d..af120aba66b77 100644 --- a/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat.c +++ b/clang/test/CodeGen/PowerPC/builtins-ppc-xlcompat.c @@ -1,11 +1,11 @@ // REQUIRES: powerpc-registered-target -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +vsx \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx -target-feature +power8-vector \ // RUN: -triple powerpc64-unknown-linux-gnu -emit-llvm %s -o - \ // RUN: -D__XL_COMPAT_ALTIVEC__ -target-cpu pwr7 | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +vsx \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx -target-feature +power8-vector \ // RUN: -triple powerpc64le-unknown-linux-gnu -emit-llvm %s -o - \ // RUN: -D__XL_COMPAT_ALTIVEC__ -target-cpu pwr8 | FileCheck %s -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +vsx \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +altivec -target-feature +isa-v207-instructions -target-feature +vsx -target-feature +power8-vector \ // RUN: -triple powerpc64le-unknown-linux-gnu -emit-llvm %s -o - \ // RUN: -U__XL_COMPAT_ALTIVEC__ -target-cpu pwr8 | FileCheck \ // RUN: --check-prefix=NOCOMPAT %s diff --git a/clang/test/CodeGen/PowerPC/ppc-vector-compare.cpp b/clang/test/CodeGen/PowerPC/ppc-vector-compare.cpp index e65acf0439ea1..7eb33fc56d9fe 100644 --- a/clang/test/CodeGen/PowerPC/ppc-vector-compare.cpp +++ b/clang/test/CodeGen/PowerPC/ppc-vector-compare.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -triple powerpc64-unknown-unknown -emit-llvm %s \ +// RUN: %clang_cc1 -flax-vector-conversions=none -target-feature +vsx -target-feature +power8-vector -target-feature +isa-v207-instructions -triple powerpc64-unknown-unknown -emit-llvm %s \ // RUN: -o - | FileCheck %s #include <altivec.h> _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
