[CIR] Implement returns_twice, cold, hot, noduplicate, convergent func attrs (#178289)
Continuing my quest to get most of the attributes completed, this patch
implements 5 attributes for CIR/Clang CIR codegen.
4 of the 5 are also implemented in LLVM-MLIR, since 'convergent' was
already there.
As a part of this, we also had to make sure that attributes were handled
properly for Call operation lowering, like we do for function
attributes.
[LifetimeSafety] Detect dangling fields (#177363)
Detect dangling field references when stack memory escapes to class
fields. This change extends lifetime safety analysis to detect a common
class of temporal memory safety bugs where local variables or parameters
are stored in class fields but outlive their scope.
- Added a new `FieldEscapeFact` class to represent when an origin
escapes via assignment to a field
- Refactored `OriginEscapesFact` into a base class with specialized
subclasses for different escape scenarios
- Added detection for stack memory escaping to fields in constructors
and member functions
- Implemented new diagnostic for dangling field references with
appropriate warning messages
Importantly,
- Added `AddParameterDtors` option to CFG to add parameter dtors and
lifetime ends behind an option. In principle, parameters ctors and dtors
[4 lines not shown]
[AMDGPU] Fix buggy insertion of DEALLOC_VGPRS message (#178401)
We inserted the DEALLOC_VGPRS message if there were no pending scratch
stores the first time an S_ENDPGM instruction was visited. But because
this pass uses a worklist to revisit blocks until it reaches a fixed
point, it is possible that pending scratch stores are only discovered on
the second or later visit to a block. Fix this by storing a flag for
each S_ENDPGM instruction which can be updated by later visits.
[FileCheck] Allow -check-prefix to take multiple prefixes (#178187)
There was no real benefit to disallowing this, and it sometimes caused
unnecessary churn in the RUN lines of tests which were updated from
single-to-multiple or multiple-to-single prefixes.
This effectively makes -check-prefixes the primary option and
-check-prefix just an alias of it. The documentation is upated
accordingly.
[OpenMP][docs] Revise building manual (#176175)
Go into more detail on the two non-legacy build modes.
I decided use create a dedicated document documention the build process.
`index.rst` only keeps the "Getting Started" part. `README.rst` is
vastly outdated with the still valid parts integrated into the new
documentation. `SupportAndFAQ.rst` is unstructured and keeps only the
non-building parts.
The the new building document is written in Meltdown, following the
decision from LLVM.
[mlir][emitc] Fix recurring operands in expression (#178382)
Relanding #175535 which got reverted for failing the buildbot.
New canonicalization pattern moved to dialect code.
[clang][ExprConst] Fix rendering of explicit this parameters (#177551)
in compile-time backtraces.
The two test cases used to be rendered as `foo(s, 0)` and `foo2(s)`.
[WebAssembly] Fix crash in ReplaceNodeResults for ANY_EXTEND_VECTOR_INREG (#178374)
Fixes a crash during type legalization by allowing
ISD::ANY_EXTEND_VECTOR_INREG to fall back to default expansion instead
of hitting llvm_unreachable.
Fixed: #177209
[flang][NFC] Separated test for --enable-constant-argument-globalisation (#178350)
The test for --enable-constant-argument-globalisation was added to
existing lowering test as part of
https://github.com/llvm/llvm-project/commit/de528ffb17ebce96e0bc4dde1749146c41ca1d0d
Decouple this test from the other lowering tests to ease conversion to
HLFIR lowering.
Co-authored-by: Jean Perier <jperier at nvidia.com>
Co-authored-by: Jean Perier <jperier at nvidia.com>
[SLP] Fix crash on extractelement with out-of-bounds index.....Fixes … (#176918)
…The cose modeling logic was attempting to set a bit in APInt for an
out-of-bounds index, causing an assertion failure. This patch ignores
OOB indices as they produce poison- which is already handled.
Fixes #176780
this is the same test result which produces this bug
<img width="1600" height="964" alt="image"
src="https://github.com/user-attachments/assets/80593902-9d15-4e18-850b-a558bca8518e"
/>
getSwitchImplicitDefaultCounterPair: Flatten expressions.
I believe the original form was already readable in this context,
but I rewrote it to match the requested style.