Skip to content

Commit 00c7995

Browse files
committed
Merge from 'main' to 'sycl-web' (#1)
CONFLICT (content): Merge conflict in clang/include/clang/Sema/Sema.h CONFLICT (content): Merge conflict in clang/include/clang/Basic/Builtins.def
2 parents 384858c + c27e5a2 commit 00c7995

File tree

19 files changed

+28
-318
lines changed

19 files changed

+28
-318
lines changed

clang/docs/UsersManual.rst

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,26 +1478,6 @@ Note that floating-point operations performed as part of constant initialization
14781478
* ``maytrap`` The compiler avoids transformations that may raise exceptions that would not have been raised by the original code. Constant folding performed by the compiler is exempt from this option.
14791479
* ``strict`` The compiler ensures that all transformations strictly preserve the floating point exception semantics of the original code.
14801480

1481-
.. option:: -f[no-]protect-parens:
1482-
1483-
This option pertains to floating-point types, complex types with
1484-
floating-point components, and vectors of these types. Some arithmetic
1485-
expression transformations that are mathematically correct and permissible
1486-
according to the C and C++ language standards may be incorrect when dealing
1487-
with floating-point types, such as reassociation and distribution. Further,
1488-
the optimizer may ignore parentheses when computing arithmetic expressions
1489-
in circumstances where the parenthesized and unparenthesized expression
1490-
express the same mathematical value. For example (a+b)+c is the same
1491-
mathematical value as a+(b+c), but the optimizer is free to evaluate the
1492-
additions in any order regardless of the parentheses. When enabled, this
1493-
option forces the optimizer to honor the order of operations with respect
1494-
to parentheses in all circumstances.
1495-
1496-
Note that floating-point contraction (option `-ffp-contract=`) is disabled
1497-
when `-fprotect-parens` is enabled. Also note that in safe floating-point
1498-
modes, such as `-ffp-model=precise` or `-ffp-model=strict`, this option
1499-
has no effect because the optimizer is prohibited from making unsafe
1500-
transformations.
15011481

15021482
.. _fp-constant-eval:
15031483

clang/include/clang/Basic/Builtins.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1661,9 +1661,6 @@ BUILTIN(__builtin_ms_va_copy, "vc*&c*&", "n")
16611661
BUILTIN(__builtin_intel_fpga_reg, "v.", "nt")
16621662
BUILTIN(__builtin_intel_fpga_mem, "v.", "nt")
16631663

1664-
// Arithmetic Fence: to prevent FP reordering and reassociation optimizations
1665-
LANGBUILTIN(__arithmetic_fence, "v.", "t", ALL_LANGUAGES)
1666-
16671664
#undef BUILTIN
16681665
#undef LIBBUILTIN
16691666
#undef LANGBUILTIN

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8580,9 +8580,6 @@ def err_typecheck_expect_scalar_operand : Error<
85808580
"operand of type %0 where arithmetic or pointer type is required">;
85818581
def err_typecheck_cond_incompatible_operands : Error<
85828582
"incompatible operand types%diff{ ($ and $)|}0,1">;
8583-
def err_typecheck_expect_flt_or_vector : Error<
8584-
"invalid operand of type %0 where floating, complex or "
8585-
"a vector of such types is required">;
85868583
def err_cast_selector_expr : Error<
85878584
"cannot type cast @selector expression">;
85888585
def ext_typecheck_cond_incompatible_pointers : ExtWarn<

clang/include/clang/Basic/LangOptions.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,6 @@ COMPATIBLE_LANGOPT(Deprecated , 1, 0, "__DEPRECATED predefined macro")
199199
COMPATIBLE_LANGOPT(FastMath , 1, 0, "fast FP math optimizations, and __FAST_MATH__ predefined macro")
200200
COMPATIBLE_LANGOPT(FiniteMathOnly , 1, 0, "__FINITE_MATH_ONLY__ predefined macro")
201201
COMPATIBLE_LANGOPT(UnsafeFPMath , 1, 0, "Unsafe Floating Point Math")
202-
COMPATIBLE_LANGOPT(ProtectParens , 1, 0, "optimizer honors parentheses "
203-
"when floating-point expressions are evaluated")
204202
BENIGN_LANGOPT(AllowFPReassoc , 1, 0, "Permit Floating Point reassociation")
205203
BENIGN_LANGOPT(NoHonorNaNs , 1, 0, "Permit Floating Point optimization without regard to NaN")
206204
BENIGN_LANGOPT(NoHonorInfs , 1, 0, "Permit Floating Point optimization without regard to infinities")

clang/include/clang/Basic/TargetInfo.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,9 +1424,6 @@ class TargetInfo : public virtual TransferrableTargetInfo,
14241424
/// Whether the option -fextend-arguments={32,64} is supported on the target.
14251425
virtual bool supportsExtendIntArgs() const { return false; }
14261426

1427-
/// Controls if __arithmetic_fence is supported in the targeted backend.
1428-
virtual bool checkArithmeticFenceSupported() const { return false; }
1429-
14301427
/// Gets the default calling convention for the given target and
14311428
/// declaration context.
14321429
virtual CallingConv getDefaultCallingConv() const {

clang/include/clang/Driver/Options.td

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,13 +1782,6 @@ defm strict_float_cast_overflow : BoolFOption<"strict-float-cast-overflow",
17821782
" of the target's native float-to-int conversion instructions">,
17831783
PosFlag<SetTrue, [], "Assume that overflowing float-to-int casts are undefined (default)">>;
17841784

1785-
defm protect_parens : BoolFOption<"protect-parens",
1786-
LangOpts<"ProtectParens">, DefaultFalse,
1787-
PosFlag<SetTrue, [CoreOption, CC1Option],
1788-
"Determines whether the optimizer honors parentheses when "
1789-
"floating-point expressions are evaluated">,
1790-
NegFlag<SetFalse>>;
1791-
17921785
def ffor_scope : Flag<["-"], "ffor-scope">, Group<f_Group>;
17931786
def fno_for_scope : Flag<["-"], "fno-for-scope">, Group<f_Group>;
17941787

@@ -4504,7 +4497,7 @@ defm integer_4_integer_8 : BooleanFFlag<"integer-4-integer-8">, Group<gfortran_G
45044497
defm max_identifier_length : BooleanFFlag<"max-identifier-length">, Group<gfortran_Group>;
45054498
defm module_private : BooleanFFlag<"module-private">, Group<gfortran_Group>;
45064499
defm pack_derived : BooleanFFlag<"pack-derived">, Group<gfortran_Group>;
4507-
//defm protect_parens : BooleanFFlag<"protect-parens">, Group<gfortran_Group>;
4500+
defm protect_parens : BooleanFFlag<"protect-parens">, Group<gfortran_Group>;
45084501
defm range_check : BooleanFFlag<"range-check">, Group<gfortran_Group>;
45094502
defm real_4_real_10 : BooleanFFlag<"real-4-real-10">, Group<gfortran_Group>;
45104503
defm real_4_real_16 : BooleanFFlag<"real-4-real-16">, Group<gfortran_Group>;

clang/include/clang/Sema/Sema.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "clang/AST/TypeLoc.h"
3737
#include "clang/AST/TypeOrdering.h"
3838
#include "clang/Basic/BitmaskEnum.h"
39-
#include "clang/Basic/Builtins.h"
4039
#include "clang/Basic/DiagnosticSema.h"
4140
#include "clang/Basic/ExpressionTraits.h"
4241
#include "clang/Basic/Module.h"
@@ -5668,8 +5667,6 @@ class Sema final {
56685667
Expr *ExecConfig = nullptr,
56695668
bool IsExecConfig = false,
56705669
bool AllowRecovery = false);
5671-
Expr *BuildBuiltinCallExpr(SourceLocation Loc, Builtin::ID Id,
5672-
MultiExprArg CallArgs);
56735670
enum class AtomicArgumentOrder { API, AST };
56745671
ExprResult
56755672
BuildAtomicExpr(SourceRange CallRange, SourceRange ExprRange,
@@ -12927,7 +12924,6 @@ class Sema final {
1292712924
private:
1292812925
bool SemaBuiltinPrefetch(CallExpr *TheCall);
1292912926
bool SemaBuiltinAllocaWithAlign(CallExpr *TheCall);
12930-
bool SemaBuiltinArithmeticFence(CallExpr *TheCall);
1293112927
bool SemaBuiltinAssume(CallExpr *TheCall);
1293212928
bool SemaBuiltinAssumeAligned(CallExpr *TheCall);
1293312929
bool SemaBuiltinLongjmp(CallExpr *TheCall);

clang/lib/AST/ExprConstant.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13724,9 +13724,6 @@ bool FloatExprEvaluator::VisitCallExpr(const CallExpr *E) {
1372413724
Result.changeSign();
1372513725
return true;
1372613726

13727-
case Builtin::BI__arithmetic_fence:
13728-
return EvaluateFloat(E->getArg(0), Result, Info);
13729-
1373013727
// FIXME: Builtin::BI__builtin_powi
1373113728
// FIXME: Builtin::BI__builtin_powif
1373213729
// FIXME: Builtin::BI__builtin_powil

clang/lib/Basic/TargetInfo.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -430,11 +430,6 @@ void TargetInfo::adjust(LangOptions &Opts) {
430430
// its corresponding signed type.
431431
PaddingOnUnsignedFixedPoint |= Opts.PaddingOnUnsignedFixedPoint;
432432
CheckFixedPointBits();
433-
434-
if (Opts.ProtectParens && !checkArithmeticFenceSupported()) {
435-
Diags.Report(diag::err_opt_not_valid_on_target) << "-fprotect-parens";
436-
Opts.ProtectParens = false;
437-
}
438433
}
439434

440435
bool TargetInfo::initFeatureMap(

clang/lib/Basic/Targets/X86.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
362362
}
363363
}
364364

365-
bool checkArithmeticFenceSupported() const override { return true; }
366-
367365
CallingConv getDefaultCallingConv() const override {
368366
return CC_C;
369367
}

0 commit comments

Comments
 (0)