[WebAssembly] Add typed select (select t*, 0x1c) (#195953)
Add MC-layer support for the typed select instruction from the
reference-types proposal:
- New OPERAND_VALTYPE_LIST operand kind (ULEB count followed by N
single-byte valtypes), stored in the MCInst as count + N immediates.
- SELECT_T at 0x1c in WebAssemblyInstrRef.td, gated on
HasReferenceTypes.
- Plumbing through the disassembler, printer, encoder, asm parser, and
type checker.
- Encoding, disassembly, and type-checker error tests, covering
zero-length and multi-value vecs.
ISel continues to select the numeric SELECT_<type> variants at 0x1b. My
motivation is unblocking LLDB, which uses LLVM's disassembler. We got a
report that these instructions show up as <unknown> in LLDB.
rdar://170659547
Revert "[ASan][JSON] Unpoison memory before its reuse" (#196203)
Reverts llvm/llvm-project#79065
This is no longer necessary now that we have gotten rid of ASan short
string annotations in libc++.
Revert "[ASan][ADT] Don't scribble with ASan" (#196201)
Reverts llvm/llvm-project#79066
This is no longer necessary now that we have gotten rid of ASan short
string annotations in libc++ (#194208).
[lldb] Support dynamically loading ScriptInterpreter plugins (#189718)
Add support for building the script interpreter plugins as shared
libraries, controlled by the `LLDB_ENABLE_DYNAMIC_SCRIPTINTERPRETERS`
CMake variable. This allows the plugins, rather than `liblldb`, to link
against their respective dependencies such as Python and Lua, which has
several benefits:
1. It makes it possible to gracefully handle the Python or Lua
dependencies not being present, instead of crashing.
2. It enables programmatically deciding which Python or Lua library to
load.
3. Combined with (2), this opens up a path towards not statically
linking with Python at all, which is required in order to load the LLDB
module in a different Python interpreter (at least this is a hard
requirement on Darwin due to two-level namespaces and install names).
This PR completes #183791
Make it clear that log enable's output file is per channel not per category (#196178)
It is natural to try:
```
log enable -f file1 lldb step
log enable -f file2 lldb process
```
or whatever, and then be surprised that all the logs end up in
`file2`... The help on `log enable`'s `-f` option didn't specify what
you were setting the file for. This PR just changes the help text to be
clear about the current state of things.
[lldb] Fix misconstructed FromErrorStringWithFormatv format strings (#196189)
Fix mistakes in `FromErrorStringWithFormatv` format strings. Uses
https://github.com/llvm/llvm-project/pull/195974
---------
Co-authored-by: Jonas Devlieghere <jonas at devlieghere.com>
[clang][SYCL] Emit "sycl-module-id" function attribute (#195965)
Attach the "sycl-module-id" LLVM function attribute to SYCL device
functions that are candidates for entry points in device-code splitting.
The attribute value is the module identifier (translation unit name),
which clang-sycl-linker uses to group kernels by translation unit when
splitting device code.
The attribute is emitted at two sites:
1. SYCL kernel caller functions (spir_kernel) are synthesized by
EmitSYCLKernelCaller and do not go through EmitFunction, so the
attribute is set directly after SetSYCLKernelAttributes.
2. sycl_external function definitions go through
SetLLVMFunctionAttributesForDefinition; the attribute is added there
when SYCLIsDevice and SYCLExternalAttr are present.
Both sites call the new CodeGenModule::addSYCLModuleIdAttr helper.
Co-authored-by: Claude
[AMDGPU] Validate forced lit64() on VOP3 instructions (#196171)
Lit64 cannot be used with VOP3* but we did not validate it
in case it can be encoded as lit32, but forced with the
operand modifier.
[RFC][Docs] Clarify brace omission for single-line bodies
Update the Coding Standards brace guidance to emphasize that braces should be
omitted only for simple bodies that do not wrap across multiple physical lines.
Revert "[DenseMap] Add memory barrier for sanitizers in getInlineBuckets/getLargeRep (#183457)" (#196143)
Revert #183457 and fixup #193695 as they are not needed after #194208.
Related issue #182720.
This reverts commit b5ac484470b9ceda96addcbc946f9ded4c5ef972.
This reverts commit 8d5b74db2d8f54da2609d18040504153c1afe5df.
[lldb] Add LLDB_ENABLE_DYNAMIC_SCRIPTINTERPRETERS option (#196110)
Add a CMake option that will gate building the script interpreter
plugins as separate shared libraries, and expose it to C++ via
lldb/Host/Config.h.
The option defaults to OFF and currently has no consumers; subsequent
patches wire up the plugin, binding, and test build to use it.
Because dynamic plugins resolve lldb_private symbols against liblldb at
runtime, enabling this option implies LLDB_EXPORT_ALL_SYMBOLS. The
default for LLDB_EXPORT_ALL_SYMBOLS now follows
LLDB_ENABLE_DYNAMIC_SCRIPTINTERPRETERS, and a FATAL_ERROR is raised if
the user explicitly disables symbol export while requesting dynamic
plugins.
Extracted from #189718 for easier reviewing.
[lldb] Partially support ConstantPtrAuth in IRForTarget::UnfoldConstant (#195899)
IRForTarget aims to make generated LLVM IR relocatable. This is because
LLDB JITs and executes code in an environment where the location/value
of something may not be known ahead of runtime.
My motivation here is ObjC constant strings. They are generally emitted
as global variables with a constant global initializer. On arm64e, these
global initializers may have a ptrauth constant as the address
discriminator. These can be safely skipped because address
discriminators encode information about the signed value, they don't
actually need to be unfolded.
In this commit I explicitly do not handle the non-address discriminator
scenario. As I work through the arm64e test suite, I may come back to
implement this if I find it is needed.
[ValueTracking] Extend computeConstantRange for add/sub, sext/zext/trunc
Recursively compute operand ranges for add/sub and propagate ranges
through sext/zext/trunc.
For add/sub, the computed range is intersected with any existing range
from setLimitsForBinOp, and NSW/NUW flags are used via
addWithNoWrap/subWithNoWrap to tighten bounds.
The motivation is to enable further folding of reduce.add expressions
in comparisons, where the result range can be bounded by the input
element ranges.
[AMDGPU] Fix some links in the GFX950 documentation (#195951)
Some links in the GFX950 documentation are incorrect. For example all
the links for the operand 'simm16' in SOPK. This patch fixes those
problems. As part of the fix, an entry fo simm16 was added to
AMDGPUOperandSyntax.rst.
Revert "[AArch64][GlobalISel] Clean up and extend BF16 tests. NFC (#196175)" (#196192)
This reverts commit c4091d14fe6dd5c2961d22ef6785a0b25bd73b16 as the new
tests are causing expensive-check failures.
[AMDGPU] Validate forced lit64() on VOP3 instructions
Lit64 cannot be used with VOP3* but we did not validate it
in case it can be encoded as lit32, but forced with the
operand modifier.
[libc][stdlib] Use structure bindings instead of output params (#196169)
Refactored alloc_and_copy to return cpp::optional<AllocResult> instead
of using reference-to-pointer output parameters. The combination of char
**& parameters with array new/delete is known to trigger a segfault in
GCC 12's waccess GIMPLE pass.
The AllocResult struct holds the two allocated arrays (storage and
ownership). Call sites use structured bindings to unpack the result
after checking for nullopt.
Hopefully fixes the build failure in PR #195260 on the
libc-x86_64-debian-gcc-fullbuild-dbg builder.
Assisted-by: Automated tooling, human reviewed.
[mlir] Interface-ify updating starting positions on vector.transfer_* (#195186)
This commit adds methods to VectorTransferOpInterface that allow
transfer operations to be queried for whether their base memref (or
tensor) and permutation map can be updated in some particular way and
then for performing this update. This is part of a series of changes
designed to make passes like fold-memref-alias-ops more generic,
allowing downstream operations, like IREE's transfer_gather, to
participate in them without needing to duplicate patterns.
In order to test this new method, migrate FoldMemrefAliasOps to use
these methods to fold memref.subview, memref.expand_shape,and
memref.collapse_shape into tranfer_read and transfer_write.
AI note: the tranfer_read / transfer_write patterns, which are taken
from a previous PR, were written with Claude 4.5.
---------
Co-authored-by: Erick Ochoa Lopez <eochoalo at amd.com>
Co-authored-by: Erick Ochoa Lopez <erick.ochoalopez at amd.com>