Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoBump] Merge with 5ec73b7d (Aug 21) (8) #361

Open
wants to merge 128 commits into
base: bump_to_e47b5075
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
b432afc
[CycleAnalysis] Methods to verify cycles and their nesting. (#102300)
ssahasra Aug 20, 2024
ba84cfb
[BasicAA] Use nuw attribute of GEPs (#98608)
hazzlim Aug 20, 2024
aa875cf
[Flang][OpenMP] Prevent re-composition of composite constructs (#102613)
skatrak Aug 20, 2024
34a88bb
[MLIR][DLTI] Introduce DLTIQueryInterface and impl for DLTI attrs (#1…
rolfmorel Aug 20, 2024
b986438
[clang][modules] Built-in modules are not correctly enabled for Mac C…
ian-twilightcoder Aug 20, 2024
42067f2
[LLVM-Reduce] - Distinct Metadata Reduction (#104624)
rbintel Aug 20, 2024
4aacc60
Revert "[CycleAnalysis] Methods to verify cycles and their nesting. (…
ssahasra Aug 20, 2024
c99347a
[clang][bytecode] Fix discarding CompoundLiteralExprs (#104909)
tbaederr Aug 20, 2024
b3fa45b
[SimplifyCFG] Add support for hoisting commutative instructions (#104…
nikic Aug 20, 2024
3b49d27
[X86] Add clang codegen test coverage for #104848
RKSimon Aug 20, 2024
6dcce42
[X86] Use correct fp immediate types in _mm_set_ss/sd
RKSimon Aug 20, 2024
21de049
[gn build] Port 42067f26cd08
llvmgnsyncbot Aug 20, 2024
f321456
[ScheduleDAG] Dirty height/depth in addPred/removePred even for laten…
bjope Aug 20, 2024
3f25f23
[X86][AVX10] Fix unexpected error and warning when using intrinsic (#…
phoebewang Aug 20, 2024
39e3085
[clang][NFC] Split invalid-cpu-note tests (#104601)
lenary Aug 20, 2024
7cfc9a3
[llvm-c] Add getters for LLVMContextRef for various types (#99087)
abgeana Aug 20, 2024
eb7d535
[LLVM] Add a C API for creating instructions with custom syncscopes. …
maleadt Aug 20, 2024
2511cdb
[InstCombine] Adjust fixpoint error message (NFC)
nikic Aug 20, 2024
34e15ad
[AArch64] Remove TargetParser CPU/Arch feature tests (#104587)
tmatheson-arm Aug 20, 2024
5f3c0b2
[AArch64][NEON] Extend faminmax patterns with fminnm/fmaxnm (#104766)
SpencerAbson Aug 20, 2024
cfc76b6
[llvm][offload] Move AMDGPU offload utilities to LLVM (#102487)
fabianmcg Aug 20, 2024
576b7a7
[SPARC] Remove assertions in printOperand for inline asm operands (#1…
koachan Aug 20, 2024
fc04490
[lldb][Windows] Fixed the API test breakpoint_with_realpath_and_sourc…
slydiman Aug 20, 2024
ee572ed
[AArch64] Optimize when storing symmetry constants (#93717)
ParkHanbum Aug 20, 2024
e6da78a
Reapply "[CycleAnalysis] Methods to verify cycles and their nesting. …
ssahasra Aug 20, 2024
fe946bf
[AArch64] Extend sxtw peephole to uxtw. (#104516)
davemgreen Aug 20, 2024
fd83b86
[InstCombine] Thwart complexity-based canonicalization in test (NFC)
nikic Aug 20, 2024
27e5f50
[Driver] Make ffp-model=fast honor non-finite-values, introduce ffp-m…
Aug 20, 2024
254da5a
[CostModel][X86] Add missing costkinds for scalar CTLZ/CTTZ instructions
RKSimon Aug 20, 2024
9bb5556
Reland [CGData] llvm-cgdata #89884 (#101461)
kyulee-com Aug 20, 2024
74f5ee4
[DXIL][Analysis] Add validator version to info collected by Module Me…
bharadwajy Aug 20, 2024
8f4f3df
Reenable anon structs (#104922)
daniel-grumberg Aug 20, 2024
723a9b8
[llvm-cgdata] Fix -Wcovered-switch-default (NFC)
DamonFool Aug 20, 2024
b5f7b69
[AArch64] fix buildbot by removing dead code
tmatheson-arm Aug 20, 2024
1c3955f
[clang][OpenMP] Fix typo in comment, NFC
kparzysz Aug 20, 2024
55d744e
[AMDGPU] Move AMDGPUMemoryUtils out of Utils. NFC. (#104930)
jayfoad Aug 20, 2024
d5e9691
[NVPTX] Add elect.sync Intrinsic (#104780)
durga4github Aug 20, 2024
5f77734
[NFC] Remove explicit bitcode enumeration from BitCodeFormat.rst (#10…
cjappl Aug 20, 2024
5032fa8
[MLIR][EmitC] Allow ptrdiff_t as result in sub op (#104921)
marbre Aug 20, 2024
c670cb4
[DXIL][Analysis] Delete unnecessary test (#105025)
bharadwajy Aug 20, 2024
90a8e5a
InferAddressSpaces: Factor replacement loop into function [NFC] (#104…
arsenm Aug 20, 2024
f9e2a86
[clang][ASTMatcher] Fix execution order of hasOperands submatchers (#…
nicovank Aug 20, 2024
8f44fee
[docs] Fix typo in llvm.experimental.vector.compress code-block snippet
RKSimon Aug 20, 2024
c106e8d
[Support] Remove unneeded __has_include fallback
MaskRay Aug 20, 2024
7c06786
[CMake] Remove HAVE_LINK_H
MaskRay Aug 20, 2024
61f8ab3
[mlir] [irdl] Improve IRDL documentation (#104928)
alexarice Aug 20, 2024
2641ed7
[OpenMP][FIX] Check for requirements early (#104836)
jdoerfert Aug 20, 2024
dfc3494
Fix a warning for -Wcovered-switch-default (#105054)
kyulee-com Aug 20, 2024
9b25ad8
[CodeGenPrepare][X86] Add tests for fixing `urem` transform; NFC
goldsteinn Aug 19, 2024
e4c67ba
Recommit "[CodeGenPrepare] Folding `urem` with loop invariant value"
goldsteinn Jun 25, 2024
aaba552
[RISCV] Add coverage for VP div[u]/rem[u] with non-power-of-2 vectors
preames Aug 20, 2024
0e24686
[Clang] CWG722: nullptr to ellipses (#104704)
MitalAshok Aug 20, 2024
8ac9247
[bazel] Port bf68e9047f62c22ca87f9a4a7c59a46b3de06abb (#104907)
Groverkss Aug 20, 2024
abd3a2d
[bazel] Add missing deps in {Arith,DLTI}DialectTdFiles (#105091)
wecing Aug 20, 2024
5144817
[RISCV] Add isel optimization for (and (sra y, c2), c1) to recover re…
topperc Aug 20, 2024
6a38e19
[HLSL] Implement support for HLSL intrinsic - saturate (#104619)
bharadwajy Aug 20, 2024
e6751bf
[NFC][TableGen] Elminate use of isalpha/isdigit from TGLexer (#104837)
jurahul Aug 20, 2024
e0326b6
[OpenMP] Map `omp_default_mem_alloc` to global memory (#104790)
jhuber6 Aug 20, 2024
e0441d5
[libc++][chono] Use hidden friends for leap_second comparison. (#104713)
mordante Aug 20, 2024
93eda08
[mlir][spirv] Support `gpu` in `convert-to-spirv` pass (#105010)
angelz913 Aug 20, 2024
7aa22f0
[mlir][gpu] Add 'cluster_size' attribute to gpu.subgroup_reduce (#104…
andfau-amd Aug 20, 2024
770cd24
[lldb][ClangExpressionParser] Don't leak memory when multiplexing Ext…
Michael137 Aug 20, 2024
ddaa828
Revert "[compiler-rt][fuzzer] implements SetThreadName for fuchsia." …
devnexen Aug 20, 2024
8056d92
[lldb][ClangExpressionParser] Implement ExternalSemaSource::ReadUndef…
Michael137 Aug 20, 2024
3565332
[lldb] Fix windows debug build after 9d07f43 (#104896)
medismailben Aug 20, 2024
c8a678b
[ctx_prof] Add analysis utility to fetch ID of a callsite (#104491)
mtrofin Aug 20, 2024
e56ad22
[DirectX] Encapsulate DXILOpLowering's state into a class. NFC
bogner Aug 20, 2024
655d62c
[mlir][tablegen] Fix tablegen bug with `Complex` class (#104974)
alexarice Aug 20, 2024
3031840
Fix post-104491 (#105191)
mtrofin Aug 20, 2024
c442025
[mlir][sparse] support sparsification to coiterate operations. (#102546)
Aug 20, 2024
b941ba1
llvm.lround: Update verifier to validate support of vector types. (#9…
sgundapa Aug 20, 2024
31e55d4
[lldb] Disable the API test TestCppBitfields on Windows (#105037)
slydiman Aug 20, 2024
f73050e
[libc++] Fix several double-moves in the code base (#104616)
ldionne Aug 20, 2024
fd4f952
[AArch64][MachO] Add ptrauth ABI version to arm64e cpusubtype. (#104650)
ahmedbougacha Aug 20, 2024
552d26e
[mlir][gpu] Add extra value types for gpu::ShuffleOp (#104605)
FMarno Aug 20, 2024
349d76d
[llvm-lit][test] Updated built-in cat command tests (#104473)
connieyzhu Aug 20, 2024
6558e04
[lldb][test] Change unsupported cat -e to cat -v to work with lit int…
connieyzhu Aug 20, 2024
ce132a5
clang/AMDGPU: Emit atomicrmw from {global|flat}_atomic_fadd_v2f16 bui…
arsenm Aug 20, 2024
10cc4a5
[flang] More support for anonymous parent components in struct constr…
klausler Aug 20, 2024
90d753a
[flang] Fix inheritance of IMPLICIT typing rules (#102692)
klausler Aug 20, 2024
f059017
[flang] Silence an inappropriate warning (#104685)
klausler Aug 20, 2024
143be4e
[flang] Silence spurious error (#104821)
klausler Aug 20, 2024
1e1cf25
[flang] Fix IEEE_NEAREST_AFTER folding edge cases (#104846)
klausler Aug 20, 2024
8266d47
[Attributor] Improve AAUnderlyingObjects (#104835)
jdoerfert Aug 20, 2024
c932a0e
[Driver,DXIL] Fix build
MaskRay Aug 20, 2024
0a22655
clang/AMDGPU: Emit atomicrmw from flat_atomic_{f32|f64} builtins (#96…
arsenm Aug 20, 2024
5822cc2
clang/AMDGPU: Emit atomicrmw for global/flat fadd v2bf16 builtins (#9…
arsenm Aug 20, 2024
93e0f31
clang/AMDGPU: Emit atomicrmw for flat/global atomic min/max f64 built…
arsenm Aug 20, 2024
6e8c970
[SandboxIR] Implement CatchSwitchInst (#104652)
vporpo Aug 20, 2024
afeef4d
AMDGPU/NewPM: Fill out passes in addCodeGenPrepare (#102867)
arsenm Aug 20, 2024
33e18b2
AMDGPU/NewPM: Start filling out addIRPasses (#102884)
arsenm Aug 20, 2024
26ae316
[clang] Support -Wa, options -mmsa and -mno-msa (#99615)
yingopq Aug 20, 2024
66ab4b8
[flang] Re-enable date_and_time intrinsic test (NFC) (#104967)
kkwli Aug 20, 2024
d03dcf6
[NFC] Fixed two typos: "__builin_" --> "__builtin_" (#98782)
ZERICO2005 Aug 20, 2024
660de53
[NFC] Fix a typo in InternalsManual: ActOnCXX -> ActOnXXX (#105207)
mpark Aug 20, 2024
1233df7
[flang] Disable failing test (#105327)
klausler Aug 20, 2024
2599d69
[RISCV][GISel] Remove s32 support on RV64 for DIV, and REM. (#102519)
topperc Aug 20, 2024
295fe0b
[Clang] Re-land Overflow Pattern Exclusions (#104889)
JustinStitt Aug 20, 2024
e96146c
[OpenMP] Temporarily disable test to keep bots green
jhuber6 Aug 20, 2024
dd90c72
AMDGPU: Temporarily stop adding AtomicExpand to new PM passes
arsenm Aug 20, 2024
0c48986
[flang] Disable part of failing test (temporary) (#105350)
klausler Aug 20, 2024
8f30506
[BOLT] Reduce CFI warning verbosity (#105336)
maksfb Aug 20, 2024
91b423d
[DAG][RISCV] Use vp.<binop> when widening illegal types for binops wh…
preames Aug 20, 2024
2353f48
[libc] Include startup code when installing all (#105203)
michaelrj-google Aug 20, 2024
aeeb74f
[cmake] Set up llvm-ml as ASM_MASM tool in WinMsvc.cmake (#104903)
mstorsjo Aug 20, 2024
a3c66c8
[libc] move newheadergen back to safe_load (#105374)
michaelrj-google Aug 20, 2024
389f339
[TableGen] Rework `EmitIntrinsicToBuiltinMap` (#104681)
jurahul Aug 20, 2024
5e6a198
[RISCV][GISel] Remove s32 support for G_ABS on RV64.
topperc Aug 20, 2024
019e1a3
[bazel] Add missing dependencies for c8a678b1e4863df2845b130584953404…
d0k Aug 20, 2024
c9a4c51
[flang] Fix test on ppc64le & aarch64 (#105439)
klausler Aug 20, 2024
1a2a18f
[DXIL][Analysis] Update test to match comment. NFC (#105409)
bogner Aug 20, 2024
26b79f8
[FunctionAttrs] Add tests for deducing attr `cold` on functions; NFC
goldsteinn Jul 31, 2024
b7eac8c
[FunctionAttrs] deduce attr `cold` on functions if all CG paths call …
goldsteinn Jul 31, 2024
8d712b4
[lldb][test] XFAIL TestAnonNamespaceParamFunc.cpp on Windows
Michael137 Aug 20, 2024
1e9d002
[RISCV][GISel] Split LoadStoreActions in LoadActions and StoreActions.
topperc Aug 20, 2024
f01f80c
[lldb] Extend frame recognizers to hide frames from backtraces (#104523)
adrian-prantl Aug 20, 2024
4a4b233
[mlir][linalg] Improve getPreservedProducerResults estimation in Elem…
DanielLevi6 Aug 20, 2024
a16f0dc
[RISCV][GISel] Allow >2*XLen integers in isSupportedReturnType.
topperc Aug 20, 2024
81ee385
[DirectX] Register a few DXIL passes with the new PM
bogner Aug 20, 2024
a8ef679
Revert "[RISCV][GISel] Allow >2*XLen integers in isSupportedReturnType."
topperc Aug 20, 2024
3145cff
[RISCV] Add coverage for int reductions of <3 x i8> vectors
preames Aug 20, 2024
e1c36bd
Fix KCFI types for generated functions with integer normalization (#1…
samitolvanen Aug 20, 2024
39ec1f7
[AArch64] Basic SVE PCS support for handling scalable vectors on Darwin.
aemerson May 17, 2024
381a803
[RISCV][GISel] Merge RISCVCallLowering::lowerReturnVal into RISCVCall…
topperc Aug 21, 2024
d8b6df2
[mlir] Fix -Wunused-result in ElementwiseOpFusion.cpp (NFC)
DamonFool Aug 21, 2024
2b84fe6
RISC-V: Add fminimumnum and fmaximumnum support (#104411)
wzssyqa Aug 21, 2024
5ec73b7
Reland "[gn build] Port d3fb41dddc11 (llvm-cgdata)"
nico Aug 21, 2024
64e887e
[AutoBump] Merge with 5ec73b7d (Aug 21)
mgehre-amd Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion bolt/lib/Core/BinaryFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ void BinaryFunction::annotateCFIState() {
}
}

if (!StateStack.empty()) {
if (opts::Verbosity >= 1 && !StateStack.empty()) {
BC.errs() << "BOLT-WARNING: non-empty CFI stack at the end of " << *this
<< '\n';
}
Expand Down
2 changes: 1 addition & 1 deletion clang/docs/InternalsManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3200,7 +3200,7 @@ are similar.
always involve two functions: an ``ActOnXXX`` function that will be called
directly from the parser, and a ``BuildXXX`` function that performs the
actual semantic analysis and will (eventually!) build the AST node. It's
fairly common for the ``ActOnCXX`` function to do very little (often just
fairly common for the ``ActOnXXX`` function to do very little (often just
some minor translation from the parser's representation to ``Sema``'s
representation of the same thing), but the separation is still important:
C++ template instantiation, for example, should always call the ``BuildXXX``
Expand Down
4 changes: 2 additions & 2 deletions clang/docs/LanguageExtensions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3987,7 +3987,7 @@ ellipsis (``...``) in the function signature. Alternatively, in C23 mode or
later, it may be the integer literal ``0`` if there is no parameter preceding
the ellipsis. This function initializes the given ``__builtin_va_list`` object.
It is undefined behavior to call this function on an already initialized
``__builin_va_list`` object.
``__builtin_va_list`` object.

* ``void __builtin_va_end(__builtin_va_list list)``

Expand Down Expand Up @@ -4321,7 +4321,7 @@ an appropriate value during the emission.

Note that there is no builtin matching the `llvm.coro.save` intrinsic. LLVM
automatically will insert one if the first argument to `llvm.coro.suspend` is
token `none`. If a user calls `__builin_suspend`, clang will insert `token none`
token `none`. If a user calls `__builtin_suspend`, clang will insert `token none`
as the first argument to the intrinsic.

Source location builtins
Expand Down
44 changes: 44 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ Resolutions to C++ Defect Reports
of the target type, even if the type of the bit-field is larger.
(`CWG2627: Bit-fields and narrowing conversions <https://cplusplus.github.io/CWG/issues/2627.html>`_)

- ``nullptr`` is now promoted to ``void*`` when passed to a C-style variadic function.
(`CWG722: Can nullptr be passed to an ellipsis? <https://cplusplus.github.io/CWG/issues/722.html>`_)

C Language Changes
------------------

Expand Down Expand Up @@ -176,6 +179,14 @@ Modified Compiler Flags

- The compiler flag `-fbracket-depth` default value is increased from 256 to 2048.

- The ``-ffp-model`` option has been updated to enable a more limited set of
optimizations when the ``fast`` argument is used and to accept a new argument,
``aggressive``. The behavior of ``-ffp-model=aggressive`` is equivalent
to the previous behavior of ``-ffp-model=fast``. The updated
``-ffp-model=fast`` behavior no longer assumes finite math only and uses
the ``promoted`` algorithm for complex division when possible rather than the
less basic (limited range) algorithm.

Removed Compiler Flags
-------------------------

Expand Down Expand Up @@ -380,6 +391,9 @@ AST Matchers
- Fixed an issue with the `hasName` and `hasAnyName` matcher when matching
inline namespaces with an enclosing namespace of the same name.

- Fixed an ordering issue with the `hasOperands` matcher occuring when setting a
binding in the first matcher and using it in the second matcher.

clang-format
------------

Expand Down Expand Up @@ -424,6 +438,36 @@ Moved checkers
Sanitizers
----------

- Added the ``-fsanitize-undefined-ignore-overflow-pattern`` flag which can be
used to disable specific overflow-dependent code patterns. The supported
patterns are: ``add-overflow-test``, ``negated-unsigned-const``, and
``post-decr-while``. The sanitizer instrumentation can be toggled off for all
available patterns by specifying ``all``. Conversely, you can disable all
exclusions with ``none``.

.. code-block:: c++

/// specified with ``-fsanitize-undefined-ignore-overflow-pattern=add-overflow-test``
int common_overflow_check_pattern(unsigned base, unsigned offset) {
if (base + offset < base) { /* ... */ } // The pattern of `a + b < a`, and other re-orderings, won't be instrumented
}

/// specified with ``-fsanitize-undefined-ignore-overflow-pattern=negated-unsigned-const``
void negation_overflow() {
unsigned long foo = -1UL; // No longer causes a negation overflow warning
unsigned long bar = -2UL; // and so on...
}

/// specified with ``-fsanitize-undefined-ignore-overflow-pattern=post-decr-while``
void while_post_decrement() {
unsigned char count = 16;
while (count--) { /* ... */} // No longer causes unsigned-integer-overflow sanitizer to trip
}

Many existing projects have a large amount of these code patterns present.
This new flag should allow those projects to enable integer sanitizers with
less noise.

Python Binding Changes
----------------------
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
Expand Down
42 changes: 42 additions & 0 deletions clang/docs/UndefinedBehaviorSanitizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,48 @@ To silence reports from unsigned integer overflow, you can set
``-fsanitize-recover=unsigned-integer-overflow``, is particularly useful for
providing fuzzing signal without blowing up logs.

Disabling instrumentation for common overflow patterns
------------------------------------------------------

There are certain overflow-dependent or overflow-prone code patterns which
produce a lot of noise for integer overflow/truncation sanitizers. Negated
unsigned constants, post-decrements in a while loop condition and simple
overflow checks are accepted and pervasive code patterns. However, the signal
received from sanitizers instrumenting these code patterns may be too noisy for
some projects. To disable instrumentation for these common patterns one should
use ``-fsanitize-undefined-ignore-overflow-pattern=``.

Currently, this option supports three overflow-dependent code idioms:

``negated-unsigned-const``

.. code-block:: c++

/// -fsanitize-undefined-ignore-overflow-pattern=negated-unsigned-const
unsigned long foo = -1UL; // No longer causes a negation overflow warning
unsigned long bar = -2UL; // and so on...

``post-decr-while``

.. code-block:: c++

/// -fsanitize-undefined-ignore-overflow-pattern=post-decr-while
unsigned char count = 16;
while (count--) { /* ... */ } // No longer causes unsigned-integer-overflow sanitizer to trip

``add-overflow-test``

.. code-block:: c++

/// -fsanitize-undefined-ignore-overflow-pattern=add-overflow-test
if (base + offset < base) { /* ... */ } // The pattern of `a + b < a`, and other re-orderings,
// won't be instrumented (same for signed types)

You can enable all exclusions with
``-fsanitize-undefined-ignore-overflow-pattern=all`` or disable all exclusions
with ``-fsanitize-undefined-ignore-overflow-pattern=none``. Specifying ``none``
has precedence over other values.

Issue Suppression
=================

Expand Down
45 changes: 25 additions & 20 deletions clang/docs/UsersManual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1452,28 +1452,30 @@ describes the various floating point semantic modes and the corresponding option
"fhonor-infinities", "{on, off}"
"fsigned-zeros", "{on, off}"
"freciprocal-math", "{on, off}"
"allow_approximate_fns", "{on, off}"
"fallow-approximate-fns", "{on, off}"
"fassociative-math", "{on, off}"
"fcomplex-arithmetic", "{basic, improved, full, promoted}"

This table describes the option settings that correspond to the three
floating point semantic models: precise (the default), strict, and fast.


.. csv-table:: Floating Point Models
:header: "Mode", "Precise", "Strict", "Fast"
:widths: 25, 15, 15, 15

"except_behavior", "ignore", "strict", "ignore"
"fenv_access", "off", "on", "off"
"rounding_mode", "tonearest", "dynamic", "tonearest"
"contract", "on", "off", "fast"
"support_math_errno", "on", "on", "off"
"no_honor_nans", "off", "off", "on"
"no_honor_infinities", "off", "off", "on"
"no_signed_zeros", "off", "off", "on"
"allow_reciprocal", "off", "off", "on"
"allow_approximate_fns", "off", "off", "on"
"allow_reassociation", "off", "off", "on"
:header: "Mode", "Precise", "Strict", "Fast", "Aggressive"
:widths: 25, 25, 25, 25, 25

"except_behavior", "ignore", "strict", "ignore", "ignore"
"fenv_access", "off", "on", "off", "off"
"rounding_mode", "tonearest", "dynamic", "tonearest", "tonearest"
"contract", "on", "off", "fast", "fast"
"support_math_errno", "on", "on", "off", "off"
"no_honor_nans", "off", "off", "off", "on"
"no_honor_infinities", "off", "off", "off", "on"
"no_signed_zeros", "off", "off", "on", "on"
"allow_reciprocal", "off", "off", "on", "on"
"allow_approximate_fns", "off", "off", "on", "on"
"allow_reassociation", "off", "off", "on", "on"
"complex_arithmetic", "full", "full", "promoted", "basic"

The ``-ffp-model`` option does not modify the ``fdenormal-fp-math``
setting, but it does have an impact on whether ``crtfastmath.o`` is
Expand All @@ -1492,9 +1494,9 @@ for more details.
* Floating-point math obeys regular algebraic rules for real numbers (e.g.
``+`` and ``*`` are associative, ``x/y == x * (1/y)``, and
``(a + b) * c == a * c + b * c``),
* Operands to floating-point operations are not equal to ``NaN`` and
``Inf``, and
* ``+0`` and ``-0`` are interchangeable.
* No ``NaN`` or infinite values will be operands or results of
floating-point operations,
* ``+0`` and ``-0`` may be treated as interchangeable.

``-ffast-math`` also defines the ``__FAST_MATH__`` preprocessor
macro. Some math libraries recognize this macro and change their behavior.
Expand Down Expand Up @@ -1753,7 +1755,7 @@ for more details.
Specify floating point behavior. ``-ffp-model`` is an umbrella
option that encompasses functionality provided by other, single
purpose, floating point options. Valid values are: ``precise``, ``strict``,
and ``fast``.
``fast``, and ``aggressive``.
Details:

* ``precise`` Disables optimizations that are not value-safe on
Expand All @@ -1766,7 +1768,10 @@ for more details.
``STDC FENV_ACCESS``: by default ``FENV_ACCESS`` is disabled. This option
setting behaves as though ``#pragma STDC FENV_ACCESS ON`` appeared at the
top of the source file.
* ``fast`` Behaves identically to specifying both ``-ffast-math`` and
* ``fast`` Behaves identically to specifying ``-funsafe-math-optimizations``,
``-fno-math-errno`` and ``-fcomplex-arithmetic=promoted``
``ffp-contract=fast``
* ``aggressive`` Behaves identically to specifying both ``-ffast-math`` and
``ffp-contract=fast``

Note: If your command line specifies multiple instances
Expand Down
10 changes: 10 additions & 0 deletions clang/include/clang/AST/Expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -3888,6 +3888,7 @@ class BinaryOperator : public Expr {
/// Construct an empty binary operator.
explicit BinaryOperator(EmptyShell Empty) : Expr(BinaryOperatorClass, Empty) {
BinaryOperatorBits.Opc = BO_Comma;
BinaryOperatorBits.ExcludedOverflowPattern = false;
}

public:
Expand Down Expand Up @@ -4043,6 +4044,15 @@ class BinaryOperator : public Expr {
void setHasStoredFPFeatures(bool B) { BinaryOperatorBits.HasFPFeatures = B; }
bool hasStoredFPFeatures() const { return BinaryOperatorBits.HasFPFeatures; }

/// Set and get the bit that informs arithmetic overflow sanitizers whether
/// or not they should exclude certain BinaryOperators from instrumentation
void setExcludedOverflowPattern(bool B) {
BinaryOperatorBits.ExcludedOverflowPattern = B;
}
bool hasExcludedOverflowPattern() const {
return BinaryOperatorBits.ExcludedOverflowPattern;
}

/// Get FPFeatures from trailing storage
FPOptionsOverride getStoredFPFeatures() const {
assert(hasStoredFPFeatures());
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/AST/OpenMPClause.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class OMPOneStmtClause : public Base {
};

/// Class that handles pre-initialization statement for some clauses, like
/// 'shedule', 'firstprivate' etc.
/// 'schedule', 'firstprivate' etc.
class OMPClauseWithPreInit {
friend class OMPClauseReader;

Expand Down
5 changes: 5 additions & 0 deletions clang/include/clang/AST/Stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ class alignas(void *) Stmt {
LLVM_PREFERRED_TYPE(bool)
unsigned HasFPFeatures : 1;

/// Whether or not this BinaryOperator should be excluded from integer
/// overflow sanitization.
LLVM_PREFERRED_TYPE(bool)
unsigned ExcludedOverflowPattern : 1;

SourceLocation OpLoc;
};

Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/ASTMatchers/ASTMatchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6027,7 +6027,7 @@ AST_POLYMORPHIC_MATCHER_P2(
internal::Matcher<Expr>, Matcher1, internal::Matcher<Expr>, Matcher2) {
return internal::VariadicDynCastAllOfMatcher<Stmt, NodeType>()(
anyOf(allOf(hasLHS(Matcher1), hasRHS(Matcher2)),
allOf(hasLHS(Matcher2), hasRHS(Matcher1))))
allOf(hasRHS(Matcher1), hasLHS(Matcher2))))
.matches(Node, Finder, Builder);
}

Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Basic/Builtins.td
Original file line number Diff line number Diff line change
Expand Up @@ -4745,6 +4745,12 @@ def HLSLRSqrt : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}

def HLSLSaturate : LangBuiltin<"HLSL_LANG"> {
let Spellings = ["__builtin_hlsl_elementwise_saturate"];
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}

// Builtins for XRay.
def XRayCustomEvent : Builtin {
let Spellings = ["__xray_customevent"];
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Basic/CodeGenOptions.def
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ CODEGENOPT(MergeAllConstants , 1, 1) ///< Merge identical constants.
CODEGENOPT(MergeFunctions , 1, 0) ///< Set when -fmerge-functions is enabled.
CODEGENOPT(NoCommon , 1, 0) ///< Set when -fno-common or C++ is enabled.
CODEGENOPT(NoExecStack , 1, 0) ///< Set when -Wa,--noexecstack is enabled.
CODEGENOPT(MipsMsa , 1, 0) ///< Set when -Wa,-mmsa is enabled.
CODEGENOPT(FatalWarnings , 1, 0) ///< Set when -Wa,--fatal-warnings is
///< enabled.
CODEGENOPT(NoWarn , 1, 0) ///< Set when -Wa,--no-warn is enabled.
Expand Down
28 changes: 28 additions & 0 deletions clang/include/clang/Basic/LangOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,21 @@ class LangOptionsBase {
PerThread,
};

/// Exclude certain code patterns from being instrumented by arithmetic
/// overflow sanitizers
enum OverflowPatternExclusionKind {
/// Don't exclude any overflow patterns from sanitizers
None = 1 << 0,
/// Exclude all overflow patterns (below)
All = 1 << 1,
/// if (a + b < a)
AddOverflowTest = 1 << 2,
/// -1UL
NegUnsignedConst = 1 << 3,
/// while (count--)
PostDecrInWhile = 1 << 4,
};

enum class DefaultVisiblityExportMapping {
None,
/// map only explicit default visibilities to exported
Expand Down Expand Up @@ -555,6 +570,11 @@ class LangOptions : public LangOptionsBase {
/// The default stream kind used for HIP kernel launching.
GPUDefaultStreamKind GPUDefaultStream;

/// Which overflow patterns should be excluded from sanitizer instrumentation
unsigned OverflowPatternExclusionMask = 0;

std::vector<std::string> OverflowPatternExclusionValues;

/// The seed used by the randomize structure layout feature.
std::string RandstructSeed;

Expand Down Expand Up @@ -630,6 +650,14 @@ class LangOptions : public LangOptionsBase {
return MSCompatibilityVersion >= MajorVersion * 100000U;
}

bool isOverflowPatternExcluded(OverflowPatternExclusionKind Kind) const {
if (OverflowPatternExclusionMask & OverflowPatternExclusionKind::None)
return false;
if (OverflowPatternExclusionMask & OverflowPatternExclusionKind::All)
return true;
return OverflowPatternExclusionMask & Kind;
}

/// Reset all of the options that are not considered when building a
/// module.
void resetNonModularOptions();
Expand Down
9 changes: 8 additions & 1 deletion clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2565,6 +2565,11 @@ defm sanitize_stats : BoolOption<"f", "sanitize-stats",
"Disable">,
BothFlags<[], [ClangOption], " sanitizer statistics gathering.">>,
Group<f_clang_Group>;
def fsanitize_undefined_ignore_overflow_pattern_EQ : CommaJoined<["-"], "fsanitize-undefined-ignore-overflow-pattern=">,
HelpText<"Specify the overflow patterns to exclude from artihmetic sanitizer instrumentation">,
Visibility<[ClangOption, CC1Option]>,
Values<"none,all,add-overflow-test,negated-unsigned-const,post-decr-while">,
MarshallingInfoStringVector<LangOpts<"OverflowPatternExclusionValues">>;
def fsanitize_thread_memory_access : Flag<["-"], "fsanitize-thread-memory-access">,
Group<f_clang_Group>,
HelpText<"Enable memory access instrumentation in ThreadSanitizer (default)">;
Expand Down Expand Up @@ -5383,7 +5388,9 @@ def mmadd4 : Flag<["-"], "mmadd4">, Group<m_mips_Features_Group>,
def mno_madd4 : Flag<["-"], "mno-madd4">, Group<m_mips_Features_Group>,
HelpText<"Disable the generation of 4-operand madd.s, madd.d and related instructions.">;
def mmsa : Flag<["-"], "mmsa">, Group<m_mips_Features_Group>,
HelpText<"Enable MSA ASE (MIPS only)">;
Visibility<[ClangOption, CC1Option, CC1AsOption]>,
HelpText<"Enable MSA ASE (MIPS only)">,
MarshallingInfoFlag<CodeGenOpts<"MipsMsa">>;
def mno_msa : Flag<["-"], "mno-msa">, Group<m_mips_Features_Group>,
HelpText<"Disable MSA ASE (MIPS only)">;
def mmt : Flag<["-"], "mmt">, Group<m_mips_Features_Group>,
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/Driver/SanitizerArgs.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class SanitizerArgs {
std::vector<std::string> BinaryMetadataIgnorelistFiles;
int CoverageFeatures = 0;
int BinaryMetadataFeatures = 0;
int OverflowPatternExclusions = 0;
int MsanTrackOrigins = 0;
bool MsanUseAfterDtor = true;
bool MsanParamRetval = true;
Expand Down
Loading