Skip to content

Commit

Permalink
Revert "[Clang] Add option to handle behaviour of vector bool/vector …
Browse files Browse the repository at this point in the history
…pixel."

This reverts commit c3fe847.

Tests fail in non-asserts builds because they assume named IR, by the
looks of it (testing for the "entry" label, for instance). I don't know
enough about the update_cc_test_checks.py stuff to know how to manually
fix these tests, so reverting for now.
  • Loading branch information
dwblaikie committed Jun 29, 2021
1 parent c94cf97 commit e1b8fde
Show file tree
Hide file tree
Showing 10 changed files with 5 additions and 597 deletions.
6 changes: 0 additions & 6 deletions clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -7441,12 +7441,6 @@ def warn_deprecated_volatile_structured_binding : Warning<
"volatile qualifier in structured binding declaration is deprecated">,
InGroup<DeprecatedVolatile>;

def warn_deprecated_altivec_src_compat : Warning<
"Current handling of vector bool and vector pixel types in this context are "
"deprecated. The default behaviour will soon change to that implied by the "
"'-altivec-compat=xl' option">,
InGroup<DiagGroup<"deprecated-altivec-src-compat">>;

def err_catch_incomplete_ptr : Error<
"cannot catch pointer to incomplete type %0">;
def err_catch_incomplete_ref : Error<
Expand Down
2 changes: 0 additions & 2 deletions clang/include/clang/Basic/LangOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ LANGOPT(WritableStrings , 1, 0, "writable string support")
LANGOPT(ConstStrings , 1, 0, "const-qualified string support")
ENUM_LANGOPT(LaxVectorConversions, LaxVectorConversionKind, 2,
LaxVectorConversionKind::All, "lax vector conversions")
ENUM_LANGOPT(AltivecSrcCompat, AltivecSrcCompatKind, 2,
AltivecSrcCompatKind::Default, "Altivec source compatibility")
LANGOPT(ConvergentFunctions, 1, 1, "Assume convergent functions")
LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers")
LANGOPT(ZVector , 1, 0, "System z vector extensions")
Expand Down
12 changes: 0 additions & 12 deletions clang/include/clang/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,6 @@ class LangOptions : public LangOptionsBase {
All,
};

enum class AltivecSrcCompatKind {
// All vector compares produce scalars except vector pixel and vector bool.
// The types vector pixel and vector bool return vector results.
Mixed,
// All vector compares produce vector results as in GCC.
GCC,
// All vector compares produce scalars as in XL.
XL,
// Default clang behaviour.
Default = Mixed,
};

enum class SignReturnAddressScopeKind {
/// No signing for any function.
None,
Expand Down
12 changes: 0 additions & 12 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -3823,18 +3823,6 @@ def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
HelpText<"Show commands to run and use verbose output">,
MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
Flags<[CC1Option]>, Group<f_Group>,
HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
"targets). This includes results of vector comparison (scalar for "
"'xl', vector for 'gcc') as well as behavior when initializing with "
"a scalar (splatting for 'xl', element zero only for 'gcc'). For "
"'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
"pixel' and as 'xl' for other types. Current default is 'mixed'.">,
Values<"mixed,gcc,xl">,
NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
NormalizedValues<["Mixed", "GCC", "XL"]>,
MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
HelpText<"Verify the binary representation of debug output">;
def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;
Expand Down
1 change: 0 additions & 1 deletion clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5816,7 +5816,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
CmdArgs.push_back("-fapple-kext");

Args.AddLastArg(CmdArgs, options::OPT_altivec_src_compat);
Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions_EQ);
Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);
Expand Down
29 changes: 5 additions & 24 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12224,30 +12224,11 @@ QualType Sema::CheckVectorCompareOperands(ExprResult &LHS, ExprResult &RHS,

QualType LHSType = LHS.get()->getType();

// Determine the return type of a vector compare. By default clang will return
// a scalar for all vector compares except vector bool and vector pixel.
// With the gcc compiler we will always return a vector type and with the xl
// compiler we will always return a scalar type. This switch allows choosing
// which behavior is prefered.
if (getLangOpts().AltiVec) {
switch (getLangOpts().getAltivecSrcCompat()) {
case LangOptions::AltivecSrcCompatKind::Mixed:
// If AltiVec, the comparison results in a numeric type, i.e.
// bool for C++, int for C
if (vType->castAs<VectorType>()->getVectorKind() ==
VectorType::AltiVecVector)
return Context.getLogicalOperationType();
else
Diag(Loc, diag::warn_deprecated_altivec_src_compat);
break;
case LangOptions::AltivecSrcCompatKind::GCC:
// For GCC we always return the vector type.
break;
case LangOptions::AltivecSrcCompatKind::XL:
return Context.getLogicalOperationType();
break;
}
}
// If AltiVec, the comparison results in a numeric type, i.e.
// bool for C++, int for C
if (getLangOpts().AltiVec &&
vType->castAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector)
return Context.getLogicalOperationType();

// For non-floating point types, check for self-comparisons of the form
// x == x, x != x, x < x, etc. These always evaluate to a constant, and
Expand Down
104 changes: 0 additions & 104 deletions clang/test/CodeGen/vector-compat-pixel-bool-ternary.c

This file was deleted.

94 changes: 0 additions & 94 deletions clang/test/CodeGen/vector-compat-pixel-bool.c

This file was deleted.

0 comments on commit e1b8fde

Please sign in to comment.