[clang][Wunsafe-buffer-usage] Add -Wunsafe-buffer-usage-in-static-sized-array (#176466)
This PR adds support for toggling on/off warnings around static sized
arrays. This supports / addresses
https://github.com/llvm/llvm-project/issues/87284, for those who use
-fsanitize=array-bounds which inserts checks for fixed sized arrays
already.
[lld][WebAssembly] Fix crash in debug info relocation against shared symbols (#176460)
When a weakly defined function is not include because its defined in
shared object we should use the tombstone value during relocation of
debug info.
Fixes: https://github.com/emscripten-core/emscripten/issues/26044
[VPlan] Add scalable check to SinkStoreInfo helper.
Bail out on scalable vectors in helper. Currently this is not causing
issues, but fixes a potential crash that would be exposed by a follow-up
change.
Test would exposes the issue in the future has been added in
8c5352cf3e14ec0c56f592091899d229de8436a7.
[HLSL][Matrix] Update indexed matrix elements individually (#176216)
Fixes #174629
This PR is similar to that of #169144 but for matrices.
When storing to a matrix element or matrix row, `insertelement`
instructions have been replaced by GEPs followed by stores to individual
matrix elements. There is no longer storing of the entire matrix to
memory all at once, thus avoiding data races when writing to independent
matrix elements from multiple threads.
Reland "[NFC][MI] Tidy Up RegState enum use (1/2)" (#176277)
This Change is to prepare to make RegState into an enum class. It:
- Updates documentation to match the order in the code.
- Brings the `get<>RegState` functions together and makes them
`constexpr`.
- Adopts the `get<>RegState` where RegStates were being chosen with
ternary operators in backend code.
- Introduces `hasRegState` to make querying RegState easier once it is
an enum class.
- Adopts `hasRegState` where equivalent was done with bitwise
arithmetic.
- Introduces `RegState::NoFlags`, which will be used for the lack of
flags.
- Documents that `0x1` is a reserved flag value used to detect if
someone is passing `true` instead of flags (due to implicit bool to
unsigned conversions).
- Updates two calls to `MachineInstrBuilder::addReg` which were passing
`false` to the flags operand, to no longer pass a value.
[6 lines not shown]
[LifetimeSafety] Track moved declarations to prevent false positives (#170007)
Prevent false positives in lifetime safety analysis when variables are
moved using `std::move`.
When a value is moved using `std::move`, ownership is transferred from
the original variable to another. The lifetime safety analysis was
previously generating false positives by warning about
use-after-lifetime when the original variable was destroyed after being
moved. This change prevents those false positives by tracking moved
declarations and exempting them from loan expiration checks.
- Added tracking for declarations that have been moved via `std::move`
in the `FactsGenerator` class
- Added a `MovedDecls` set to track moved declarations in a
flow-insensitive manner
- Implemented detection of `std::move` calls in `VisitCallExpr`
- Modified `handleLifetimeEnds` to skip loans for declarations that have
been moved
[17 lines not shown]
GlobalMerge: Do not merge globals with non-dbg metadata.
As noticed during the review of #149260, this transformation
is not necessarily correct for all metadata types.
Reviewers: efriedma-quic
Pull Request: https://github.com/llvm/llvm-project/pull/175875
[AggressiveInstCombine] Allow load folding for root inst with multiple uses. (#176101)
The load folding optimization was very conservative by requiring the
root OR instruction to have a single use. This prevented optimization
when to fold loads when only the root had multiple uses.
For example:
%val = or i32 ... ; Assembles 4 bytes to i32
%use1 = call @foo(%val)
%use2 = call @bar(%val)
Revert "[Serialization] Stop demote var definition as declaration" (#176441)
Reverts #172430 (c560f1cf03aa06c0bdd00c5a9b558c16d882af6f).
Causes some failures like `error: static assertion expression is not an
integral constant expression` and `error: substitution into constraint
expression resulted in a non-constant expression` in modules builds.
Repro TBD.
[OpenMP][Clang] Parsing/Sema support for `use_device_ptr(fb_preserve/fb_nullify)`. (2/4) (#170578)
Depends on #169603.
This is the `use_device_ptr` counterpart of #168905.
With OpenMP 6.1, a `fallback` modifier can be specified on the
`use_device_ptr` clause to control the behavior when a pointer lookup
fails, i.e. there is no device pointer to translate into.
The default is `fb_preserve` (i.e. retain the original pointer), while
`fb_nullify` means: use `nullptr` as the translated pointer.
Dependent PR: #173930.
[clangd] Support `=default` in DefineOutline to find insertion point (#175618)
Since #128164, the DefineOutline tweak is looking for a good insertion
point by looking at where neighboring functions are defined. That
heuristic didn't yet handle `= default`. This commit adds support for
it.
[flang][debuginfo] Use <stdin> for file name when reading from stdin
Currently, the DIFile debuginfo nodes use "standard input" as the file
name when compiling with -g and reading input from stdin. This has been
changed to "<stdin>" for consistency with clang and gfortran.
Fixes #60288
[Support][NFC] Use default move constr/assign for DomTree (#176423)
Added in 5e10e21d28496ba40ccd385740d7d1b4bb1368e4, hopefully MSVC can
generate the correct code 11 years later? (If not, we probably have
other problems, too? Unfortunately, I couldn't find information on what
the actual problem was.)
The explicit move constructor/assignment are error-prone to
modifications, because it is easy to forget updating them when modifying
members.