Skip to content

Commit e1b8fde

Browse files
committed
Revert "[Clang] Add option to handle behaviour of vector bool/vector 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.
1 parent c94cf97 commit e1b8fde

File tree

10 files changed

+5
-597
lines changed

10 files changed

+5
-597
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7441,12 +7441,6 @@ def warn_deprecated_volatile_structured_binding : Warning<
74417441
"volatile qualifier in structured binding declaration is deprecated">,
74427442
InGroup<DeprecatedVolatile>;
74437443

7444-
def warn_deprecated_altivec_src_compat : Warning<
7445-
"Current handling of vector bool and vector pixel types in this context are "
7446-
"deprecated. The default behaviour will soon change to that implied by the "
7447-
"'-altivec-compat=xl' option">,
7448-
InGroup<DiagGroup<"deprecated-altivec-src-compat">>;
7449-
74507444
def err_catch_incomplete_ptr : Error<
74517445
"cannot catch pointer to incomplete type %0">;
74527446
def err_catch_incomplete_ref : Error<

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ LANGOPT(WritableStrings , 1, 0, "writable string support")
126126
LANGOPT(ConstStrings , 1, 0, "const-qualified string support")
127127
ENUM_LANGOPT(LaxVectorConversions, LaxVectorConversionKind, 2,
128128
LaxVectorConversionKind::All, "lax vector conversions")
129-
ENUM_LANGOPT(AltivecSrcCompat, AltivecSrcCompatKind, 2,
130-
AltivecSrcCompatKind::Default, "Altivec source compatibility")
131129
LANGOPT(ConvergentFunctions, 1, 1, "Assume convergent functions")
132130
LANGOPT(AltiVec , 1, 0, "AltiVec-style vector initializers")
133131
LANGOPT(ZVector , 1, 0, "System z vector extensions")

clang/include/clang/Basic/LangOptions.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -244,18 +244,6 @@ class LangOptions : public LangOptionsBase {
244244
All,
245245
};
246246

247-
enum class AltivecSrcCompatKind {
248-
// All vector compares produce scalars except vector pixel and vector bool.
249-
// The types vector pixel and vector bool return vector results.
250-
Mixed,
251-
// All vector compares produce vector results as in GCC.
252-
GCC,
253-
// All vector compares produce scalars as in XL.
254-
XL,
255-
// Default clang behaviour.
256-
Default = Mixed,
257-
};
258-
259247
enum class SignReturnAddressScopeKind {
260248
/// No signing for any function.
261249
None,

clang/include/clang/Driver/Options.td

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3823,18 +3823,6 @@ def u : JoinedOrSeparate<["-"], "u">, Group<u_Group>;
38233823
def v : Flag<["-"], "v">, Flags<[CC1Option, CoreOption]>,
38243824
HelpText<"Show commands to run and use verbose output">,
38253825
MarshallingInfoFlag<HeaderSearchOpts<"Verbose">>;
3826-
def altivec_src_compat : Joined<["-"], "faltivec-src-compat=">,
3827-
Flags<[CC1Option]>, Group<f_Group>,
3828-
HelpText<"Source-level compatibility for Altivec vectors (for PowerPC "
3829-
"targets). This includes results of vector comparison (scalar for "
3830-
"'xl', vector for 'gcc') as well as behavior when initializing with "
3831-
"a scalar (splatting for 'xl', element zero only for 'gcc'). For "
3832-
"'mixed', the compatibility is as 'gcc' for 'vector bool/vector "
3833-
"pixel' and as 'xl' for other types. Current default is 'mixed'.">,
3834-
Values<"mixed,gcc,xl">,
3835-
NormalizedValuesScope<"LangOptions::AltivecSrcCompatKind">,
3836-
NormalizedValues<["Mixed", "GCC", "XL"]>,
3837-
MarshallingInfoEnum<LangOpts<"AltivecSrcCompat">, "Mixed">;
38383826
def verify_debug_info : Flag<["--"], "verify-debug-info">, Flags<[NoXarchOption]>,
38393827
HelpText<"Verify the binary representation of debug output">;
38403828
def weak_l : Joined<["-"], "weak-l">, Flags<[LinkerInput]>;

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5816,7 +5816,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
58165816
(Args.hasArg(options::OPT_mkernel) && types::isCXX(InputType)))
58175817
CmdArgs.push_back("-fapple-kext");
58185818

5819-
Args.AddLastArg(CmdArgs, options::OPT_altivec_src_compat);
58205819
Args.AddLastArg(CmdArgs, options::OPT_flax_vector_conversions_EQ);
58215820
Args.AddLastArg(CmdArgs, options::OPT_fobjc_sender_dependent_dispatch);
58225821
Args.AddLastArg(CmdArgs, options::OPT_fdiagnostics_print_source_range_info);

clang/lib/Sema/SemaExpr.cpp

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12224,30 +12224,11 @@ QualType Sema::CheckVectorCompareOperands(ExprResult &LHS, ExprResult &RHS,
1222412224

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

12227-
// Determine the return type of a vector compare. By default clang will return
12228-
// a scalar for all vector compares except vector bool and vector pixel.
12229-
// With the gcc compiler we will always return a vector type and with the xl
12230-
// compiler we will always return a scalar type. This switch allows choosing
12231-
// which behavior is prefered.
12232-
if (getLangOpts().AltiVec) {
12233-
switch (getLangOpts().getAltivecSrcCompat()) {
12234-
case LangOptions::AltivecSrcCompatKind::Mixed:
12235-
// If AltiVec, the comparison results in a numeric type, i.e.
12236-
// bool for C++, int for C
12237-
if (vType->castAs<VectorType>()->getVectorKind() ==
12238-
VectorType::AltiVecVector)
12239-
return Context.getLogicalOperationType();
12240-
else
12241-
Diag(Loc, diag::warn_deprecated_altivec_src_compat);
12242-
break;
12243-
case LangOptions::AltivecSrcCompatKind::GCC:
12244-
// For GCC we always return the vector type.
12245-
break;
12246-
case LangOptions::AltivecSrcCompatKind::XL:
12247-
return Context.getLogicalOperationType();
12248-
break;
12249-
}
12250-
}
12227+
// If AltiVec, the comparison results in a numeric type, i.e.
12228+
// bool for C++, int for C
12229+
if (getLangOpts().AltiVec &&
12230+
vType->castAs<VectorType>()->getVectorKind() == VectorType::AltiVecVector)
12231+
return Context.getLogicalOperationType();
1225112232

1225212233
// For non-floating point types, check for self-comparisons of the form
1225312234
// x == x, x != x, x < x, etc. These always evaluate to a constant, and

clang/test/CodeGen/vector-compat-pixel-bool-ternary.c

Lines changed: 0 additions & 104 deletions
This file was deleted.

clang/test/CodeGen/vector-compat-pixel-bool.c

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)