Enhance the readability-enum-initial-value checker to list which
enumerators
are not initialized in notes. This makes it easier for users to identify
which
specific enumerators need explicit initialization.
The following can be used to reinterpret & extend a float, returning the
result as a double with the upper bits cleared:
return bit_cast<double>((uint64_t)bit_cast<uint32_t>(x))
this currently results in two fmovs being generated, i.e.
fmov w8, s0
fmov d0, x8
ret
This patch adds a pattern to improve this by using a single `fmov s0, s0`
instead, and also for the case where the integer value is truncated.
LLDB currently crashes when the super-class of an Objective-C type can't
be completed (i.e., has no definition). For Foundation types such as
`NSObject`, the debug-info would usually only contain forward
declarations. The definitions live in the Clang module `.pcm` files. But
if the source of the definition fails to be loaded (e.g., if we just
delete the module cache), then we can no longer guarantee that the
super-class has a definition. This breaks a key Clang invariant, which
requires base-classes to have definitions by the time we try to lay them
out. This patch adds an XFAILed test for such scenario.
rdar://168440264
Add time-trace scopes to the DTLTO-specific input-handling code to
improve observability and debugging.
These scopes are tested via LLD, as the primary purpose of this code is
to support member files of non-thin archives as DTLTO inputs.
`llvm-lto2` does not currently support archives. Adding archive support
to `llvm-lto2` solely for testing these scopes does not appear to be
worthwhile.
As part of this change, the deletion of temporary DTLTO input files has
been moved. Cleanup now occurs after LTO has completed, rather than
during destruction of the LTO object. This is required since by the time
the LTO object is destroyed, time-traces have already been finalized, so
no additional trace data can be recorded.
Recording time-trace data for temporary file deletion is important, as
this has been a source of performance issues in the past and an area
where we expect to make further performance improvements if supported by
the data.
SIE internal tracker: TOOLCHAIN-21021
Fix handling of reference-typed DeclRefExpr in lifetime analysis
Fixes https://github.com/llvm/llvm-project/issues/176399
This PR fixes a bug in the lifetime analysis where reference-typed DeclRefExpr nodes were incorrectly handled. The analysis was incorrectly removing the outer layer of origin for reference types, which led to missing some dangling reference warnings.
The fix adds a check to only remove the outer layer of origin when the declaration is not a reference type.
This test doesn't trigger an assertion on top-of-tree. Turn this into an
XFAIL instead.
Found this test because I'm working on improving parameter pack support
in the expression evaluator.
lldb-dap currently crashes when the first character is non ascii. This
is because we assume that the request column is ascii based instead of
UTF16 code units,
and end up in the middle of a character code point. causing an assertion
since we cannot not send invalid UTF-8 values.
This also handles the case in multilines and the column is outside the
range of the text.
Move completion description to the `CompletionItem.detail` property.
This patch removes the single uncountable exit constraint, allowing
loops with multiple early exits, if the exits form a dominance chain and
all other constraints hold for all uncountable early exits.
While legality now accepts such loops, vectorization is not yet
supported. VPlan support will be added in a follow up:
https://github.com/llvm/llvm-project/pull/174864
PR: https://github.com/llvm/llvm-project/pull/176403
No caller sets this parameter to `false`. It's odd that we would provide
such an option to a user. This gets used whenever we want to
ensure/check that a type has a definition. Never do we actually want to
expose the underlying mechanism of whether the type has been lazily
completed or not. A more dedicated API could introduced for this
purpose if we really wanted one.
Uncommenting `ENABLE_DEBUG_PRINTF` wasn't compiling on top-of-tree. This code may have been useful for debugging locally in the past but it doesn't seem compelling to keep this in the source-tree. Especially because it doesn't compile, indicating it's most likely not used.
This patch removes `DEBUG_PRINTF` entirely.
Prepared as a series of smaller commits as the cumulative diff is pretty
much unreviewable.
Supposed to help getting rid of lots of differences in the disassembler
counterpart of this test sitting downstream in the True16 branch.
I tried to make sure all important cases that were on the disassembler
side of the test, both upstream and downstream, are reflected in the
combined asm/disasm test.
No caller sets this to `true`. Initially added for and set by
`SymbolFileDWARFDebugMap` (see
`616f490777a4f35269a23abee851680134050065`). This was then removed
shortly after in:
```
commit 762f7135e290696595b6c7233245581f59eeb07c
Author: Greg Clayton <gclayton@apple.com>
Date: Sun Sep 18 18:59:15 2011 +0000
Don't put modules for .o files into the global shared module list. We
used to do this because we needed to find the shared pointer for a .o
file when the .o file's module was needed in a SymbolContext since the
module in a symbol context was a shared pointer. Now that we are using
intrusive pointers we don't have this limitation anymore since any
instrusive shared pointer can be made from a pointer to an object
all on its own.
```
At this point it's more of a foot-gun, because forcing it to true has
potentially significant performance implications (e.g.,
a5eaa05dce)
The `math.clampf` op is semantically incorrect when compared to both the
CUDA reference implementation and the SPIRV spec, both of which have a
clamp op.
- Fix the definition of `math.clampf` to agree with CUDA and SPIRV
- Explicitly state when `math.clampf` produces `ub.poison`
- Update the ExpandOps pass to reflect the corrected semantics
**This patch adds a marker to make hidden frames more explicit.**
---
Hidden frames can be confusing for some users, who see that the indexes
of the frames in a backtrace are not contiguous. This patch aims to
lessen the confusion by adding a delimiter for the first and last non
hidden frame, i.e the boundaries.
IDE's like Xcode and VSCode represent those in the UI by having the
hidden frames either greyed out or collapsed.
It's not possible to do this in the CLI, therefore, this patch makes use
of 2 unicode characters to mark the beginning and end of the hidden
frames range.
This patch depends on:
- https://github.com/llvm/llvm-project/pull/168603
# Examples
In the example below, frame `#2` to `#7` are is hidden, and therefore,
frame `#1` is the first non hidden frame of the range while frame `#8`
is the last non hidden frame:
<img width="488" height="112" alt="Screenshot 2025-11-18 at 18 41 11"
src="https://github.com/user-attachments/assets/a21431da-9729-4cf0-a6bc-024aa306fc45"
/>
If the selected frame is one of the 2 boundary frames, we replace the
delimiter character with the select character (`*`).
<img width="487" height="111" alt="Screenshot 2025-11-18 at 18 41 03"
src="https://github.com/user-attachments/assets/5616fa81-6db6-457d-9d1e-bbe46e710c26"
/>
<img width="488" height="111" alt="Screenshot 2025-11-18 at 18 40 55"
src="https://github.com/user-attachments/assets/93dfa6cf-0956-4718-b31c-f965ec72b56d"
/>
1. Implement `SelectionDAG::computeKnownBits` for TRUNCATE_SSAT_S/U and
TRUNCATE_USAT_U
2. Saturating truncation operations are well-defined for all inputs and
cannot create poison or undef values. This allows the optimizer to
eliminate unnecessary freeze instructions after these operations.
Fixes#152143
This PR fixes a bug when the lower and upper bound for the number of
teams was not an `int32`, but a different type. In this case, an
internal compiler would trigger due to a mismatching call to
`__kmpc_push_num_teams`.
PR #173096 extended -Wunsafe-buffer-usage-in-libc-call to apply to all
functions with the 'format' attribute.
This change moves those warnings behind a separate
-Wunsafe-buffer-usage-in-format-attr-call flag (implicitly enabled by
-Wunsafe-buffer-usage), allowing projects to decide whether they want to
opt in to this or not.
A miss-compile occurs at o2 or above when using GlobalISel. The error
occurs due to the GlobalMerge pass moving two variables together & a
store of the incorrect size overwriting one of the two merged variables.
Currently, `AArch64InstructionSelector` uses the size of LLT when
choosing which pre/post indexed store to choose. In this case, the size
of the LLT is 32 when the value being stored is 16. By changing this
selector to look at the size of the MMO we can avoid this issue.
---------
Co-authored-by: Nathan Corbyn <me@nathancorbyn.com>
Addresses a long-standing TODO to not drop the encoding when folding a
`tensor.empty` with a reshape operation (`tensor.expand_shape`,
`tensor.collapse_shape`).
---------
Signed-off-by: Lukas Sommer <lukas.sommer@amd.com>
`StdLibraryFunctionsChecker` contained the following condition for
`getcwd`:
```
.Case({NotNull(0),
ArgumentCondition(1, WithinRange, Range(1, SizeMax)),
ReturnValueCondition(BO_EQ, ArgNo(0))},
ErrnoMustNotBeChecked, GenericSuccessMsg)
```
In this case argument 1 should be not zero and return value is set to be
equal to argument 1. This would mean that return value is implicitly not
zero. But for unknown reason (probably analyzer inaccuracy) it can occur
that the return value is still assumable to be zero after this condition
was applied. This results in false positive if `ErrnoChecker` is enabled
because when the return value is 0 value of `errno` should be allowed to
be read but in this case it is not.
The bug is fixed by adding an extra (theoretically redundant) condition
for the return value to be non-zero.
Fixes#175136
As discussed on https://github.com/llvm/llvm-project/pull/144745, insert
a nop after unwinding inline assembly, as it may end on a call.
While the change itself is trivial, I ended up having to do two
infrastructure changes:
* The unwind flag needs to be propagated to ExtraInfo of the
MachineInstr.
* The MachineInstr needs to be passed through to emitInlineAsmEnd(), and
the method needs to be non-const.
Fixes https://github.com/llvm/llvm-project/issues/157073.
Motivation is similar to 25cfdaa4e9dc. Their spec don't specify a
required OpenCL version. Targets may expose them before OpenCL 1.2. Set
KHR extensions (depth images, mipmaps, subgroups, kernel clock, dot
product, ext_float_atomics, extended_bit_ops, cles_khr_int64) to
availability 1.0.
Changes to opencl-c.h:
* Relax header and test guards to allow extension macros whenever any
OpenCL C version is defined.
* Relax cl_khr_depth_images guard to allow cl_khr_depth_images, OpenCL
C++, or OpenCL C 2.0+, since image2d_depth_t and image2d_array_depth_t
types require that coverage.
* Guard image1d_t, image1d_array_t and image2d_array_t types with OpenCL
C++ or OpenCL C 1.2+ to match with OpenCL C spec.
Relates to https://github.com/KhronosGroup/OpenCL-CTS/pull/2376.
Update: The first attempt was reverted in #175993, but the regression
described in #175993 should be fixed in ROCm/llvm-project's opencl-c.h.
See https://github.com/llvm/llvm-project/pull/175993#issuecomment-3762586432
If the result of an integer load is only used by an integer-to-float
conversion, use a fp load instead. This eliminates an
integer-to-float-move (movgr2fr) instruction.
Minor fix typo.
Main issue:
https://github.com/llvm/llvm-project/issues/169959
I did research and found file with tests but I couldn't figure out how
cover this change. if this needs to be added then please advise.
@tomershafir
These passes run "RenumberBlocks()" on Machine function which renders
the dominator tree analyses in the cache stale (though passes may not
change anything structurally). we need to update the block numbers in
the cached analyses if we are to return PreservedAnalysis::all(). This
is not an issue with legacy PM since none of these passes preserve
dominator tree analyses anyway.
This change syncs the tutorial with the example code document for
chapter 2. This is necessary to lookup the top level expression with the
JIT in chapter 4.
Co-authored-by: Christyllin <DiskworldWizzard@Gmail.com>