[Offload][L0] Copy a single slice as a 2D region (#246571)
For a 3D copy with a depth of one, add the z offsets to the source and
destination pointers and pass a z origin of zero to
zeCommandListAppendMemoryCopyRegion, instead of passing a nonzero z
origin with a depth of one.
Assisted by Claude.
---------
Co-authored-by: blazej-smorawski <blazej.smorawski at intel.com>
[ValueTracking] Limit compare analysis to integer types (#239757)
Fix bug introduced in https://github.com/llvm/llvm-project/pull/237661.
Improving KnownBits by doing compare analysis must not be done on fat
pointers since compares on them only test address bits and provide no
information on non-address bits. Fix by limiting analysis to integers.
Also do not analyze ICMP_NE since it provides almost no information.
---------
Signed-off-by: John Lu <John.Lu at amd.com>
[lldb] Show the stub's error string on failed memory access (#247810)
A stub that supports QEnableErrorStrings can say why a memory read or
write failed by replying `Exx;<hex text>`. ProcessGDBRemote dropped the
text and reported only the address. Append it to the error:
```
memory read failed for 0x1000: no such region
```
A bare `Exx` reply keeps the current message.
rdar://193043790
Assisted-by: Claude
[SystemZ][z/OS] Remove always triggering assertion (#248059)
HLASM does not have mnemonics for all conditions. However, these
instructions are generated, so this `assert()` triggers for all
non-trivial inputs, which really hinders debugging. When the issue is
solved at the right level, then this `assert()` can be added back.
[lldb] Use extensible RTTI for DWARFASTParser (NFC) (#247875)
This patch replaces the DWARFASTParser::Kind enum with
llvm::RTTIExtends. A new parser no longer needs to add itself to
DWARFASTParser.h, which is a first step towards letting parsers live
outside SymbolFileDWARF.
Assisted-by: Claude
[VPlan] Remove UncountableExitStyle (NFC). (#247242)
handleUncountableEarlyExits always picks the strategy from the plan
itself: it uses the masked strategy if the loop has stores and the
read-only strategy otherwise, ignoring the passed-in style. The only
caller passes ReadOnly unconditionally, so the enum and parameter carry
no information. Remove them and use the result of loopHasStores
directly. Fold the description of the two strategies into the doc
comment of handleUncountableEarlyExits. This came up as part of
https://github.com/llvm/llvm-project/pull/233313, where we effectively
pick another style for side-effects, based
on VPlan analysis.
If we want to chose the style based on target preference, I think it
would be cleaner to pass TTI to pick based on the VPlan analysis.
PR: https://github.com/llvm/llvm-project/pull/247242
[analyzer] Make the reports of the core.NullPointerArithm checker non-sinking (#247730)
Fixes #246710
Although null pointer arithmetic is undefined behavior, it does not
generally trap at runtime, and continuing the analysis after reporting
it is safe. This fix allows this by adjusting the report node to be
non-sinking.
[mlir][reducer] Show all mlir-reduce options in --help (#245992)
--no-implicit-module, --allow-unregistered-dialect and
--split-input-file were not in the mlir-reduce option category.
HideUnrelatedOptions marks options outside the category as really
hidden, so they were missing from both --help and --hidden flags. This
Puts them in the flags.
[lldb][Windows] Forward the inferior's output before reporting a stop (#248088)
`NativeProcessWindows` reads the inferior's stdout on its own thread and
passes it to `GDBRemoteCommunicationServerLLGS` with
`NewProcessOutput()`. There is a race condition where data can still be
in the pipe when the inferior is stopped. It only reaches the client
**after** the process resumes.
`TestChangeValueAPI` is flaky on Windows on ARM because of this.
This patch makes `NativeProcessWindows` wait for its read thread to send
what is already in the pipe before it reports a stop.
[Sparc] Don't drop inline asm clobbers of %f32-%f62 (#247789)
An inline asm clobber of %f32-%f62, as in `"~{f32}"`, was silently
ignored, while `"~{d16}"` worked. The registers for %f32-%f62 are
D16-D31,
and the generic lookup matches constraint names against the TableGen
register names, which are d16-d31. Operands are rewritten to {dN}
according to their value type, but a clobber has no value type, so it
fell through and matched nothing.
Map the even names %f32-%f62 in a clobber to D16-D31. These are the
names of the upper registers that clang accepts in clobbers.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[clang][OpenMP] Add no-loop SPMD kernel promotion (#224041)
A target teams distribute parallel for that is guaranteed a thread for
every iteration does not need the loop around its body. Flang already
drops it and runs the region as a no-loop kernel.
Enable the same optimization for Clang through mirroring Flang's MLIR
promotion using OpenMPIRBuilder. The kernel is tagged SPMD_NO_LOOP, so
the runtime sizes the grid to the iteration space, and the body is
emitted without a loop around it. The canonical loop it consumes is
reconstructed in the no-loop branch rather than taken from an
OMPCanonicalLoop node, so the promotion does not require
-fopenmp-enable-irbuilder.
Split out of #205325.
Assisted by: Claude Opus 5.5
[Mips] Fix big-endian va_arg of vectors smaller than a slot (#247572)
Vectors are passed like aggregates on MIPS, so on big-endian a vector
smaller than an argument slot is at the start of its slot, the same as
GCC. va_arg right-adjusted it instead and read the padding. On O32 this
broke vectors under 4 bytes, and on N32/N64 vectors under 8 bytes.
Fixes #247461
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Mips] Add microMIPS R6 patterns for is_fpclass (#247752)
IS_FPCLASS is legal on R6, but the CLASS.fmt patterns were only
defined for the standard encoding, so llvm.is.fpclass failed to select
on microMIPS R6. Add the microMIPS R6 equivalents.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[LAA] Conservatively handle compressed pointers
This allows vectorizing loops with `ptr` conditional inductions (that
are used to compute the addresses of loads/stores), and loops where
the pointers may alias (so need bounds checks).
For now, diff checks are not supported if either the source or sink is
a compressed pointer (as the difference may not be constant within the
loop). This could be relaxed for pointers derived from the same phi.
We ensure the over-approximation does not wrap before bounds checking
compressed pointers to ensure the bounds hold for the loop.
All SCEV predicates and bounds checks are frozen as the compressed
access may not occur in the scalar loop (if the condition turns out to
be false for the entire loop), to avoid branching on poison.
Assisted-by: Codex (adding test converage, comments my own).
[Analysis] Move collectCompressedPtrs to IVDescriptors.{cpp|h} (NFC)
`collectCompressedPtrs` needs to be accessible in LAA to handle runtime
checks for compressed ptrs.
[Docs] Fix getTerminator() documentation (#248010)
https://github.com/llvm/llvm-project/pull/189416 changes getTerminator()
to require a well-formed BasicBlock, but didn't adjust the documentation
in the ProgrammersManual.
[lldb][NativePDB] Accept functions without a type (#236547)
When I was trying to trim down the output from llvm with
`-gline-tables-only`, I noticed that lldb doesn't parse functions if
they don't have a type.
It's fine for functions to not have a type in PDB. If you look at the
PDBs from Microsoft's symbol servers, then, if they have functions at
all, they never have types (i.e. type index 0).
With this PR, lldb will accept these functions. They will get a nullptr
`Type*` and an `LLDB_INVALID_UID` for the type UID.
`ResolveTypeUID` couldn't handle that UID before, but now it will return
a nullptr type too.
I added two tests (of the same program). One to check that we can parse
the functions and another one to check that we can generate a backtrace.
I can't use the current clang-cl to compile this, because it would
generate types for functions, so it's using yaml2obj.
[AMDGPU] Invalidate stale UniformityInfo entries in 64-bit div/rem expansion (#215460)
expandDivRem64 erases instructions outside DeadVals worklist, so a freed
instruction address could be reused and misclassified by UniformityInfo
Found as a result of an audit after finding the same class of bug fixed
for Reassociate in #214719
[CIR][OpenMP] Add support for OpenMP reduction clause
This patch adds support for the OpenMP reduction clause on the teams and for
directives for reductions with built-in identifiers on local scalar integer and
floating-point variables. Other cases, such as user-defined reductions,
modifiers, arrays and globals, are reported as not yet implemented.
Assisted-by: Cursor / Claude Opus 5.5 Medium
[clang] Fix crash on trailing comma in vectorize_width
With `#pragma clang loop vectorize_width(4, )`, the token after the comma
is the end marker for the loop hint. The parser diagnoses the missing
argument, then lexes past the marker. Error recovery consumes the
following loop and crashes at the end of the file.
```text
Stack dump:
1. <eof> parser at end of file
2. <stdin>:1:10: parsing function body 'f'
3. <stdin>:1:10: in compound statement ('{}')
```
Leave the end marker for the existing recovery path so parsing resumes
at the following loop. Clang now emits only the malformed hint error.
```text
<stdin>:2:40: error: vectorize_width loop hint malformed; use vectorize_width(X, fixed) or vectorize_width(X, scalable) where X is an integer, or vectorize_width('fixed' or 'scalable')
[6 lines not shown]
[AMDGPU] Handle fp_class conditions in frexp select combine (#248079)
performFrexpSelectCombine removes a select that returns 0 for inf or nan
inputs to frexp_exp, but it only recognized setcc conditions. An isinf or
isfinite setcc is combined into AMDGPUISD::FP_CLASS, and with
-combiner-topological-sorting that happens before the select is visited.
Assisted-by: Claude Fable 5.2 <noreply at anthropic.com>
[MemProf] Don't clone functions whose block addresses escape (#247257)
CloneFunction only remaps block addresses used inside the function body.
If a function's block addresses escape, e.g. through a computed-goto
jump table stored in a global variable, a MemProf clone continues
loading the original function's block addresses and jumps into
the original function's blocks, leading to crashes.
Skip such functions when building the MemProf callsite context graph so
their allocations retain default behavior.
Assisted-by: Gemini