Skip to content

Conversation

@b-sumner
Copy link
Collaborator

@b-sumner b-sumner commented Nov 4, 2025

No description provided.

kazutakahirata and others added 30 commits November 2, 2025 15:52
"const" is extraneous in the presence of "constexpr" for simple
variables and arrays.
Identified with modernize-use-equals-default.
An LLVM 19-aligned libc++ was released with macOS 15.4 (and corresponding OSes),
and LLVM-20 aligned with macOS 26.0. This patch adds availability markup to
reflect that.
This PR adds block arguments check to prevent a crash in `emitc.for`
verifier. Fixes llvm#159950.
Previously, I was getting the following error when attempting to compile
libc++ on windows with modules enabled.

```
While building module 'std':
In file included from <module-includes>:1:
In file included from gen/third_party/libc++/src/include/algorithm:1865:
In file included from gen/third_party/libc++/src/include/__algorithm/inplace_merge.h:28:
In file included from gen/third_party/libc++/src/include/__memory/unique_temporary_buffer.h:17:
In file included from gen/third_party/libc++/src/include/__memory/allocator.h:19:
gen/third_party/libc++/src/include/__new/allocate.h(40,73): error: 
      declaration of 'align_val_t' must be imported from module
      'sys_stage1.sysroot_vcruntime_new_h' before it is required
   40 |     return static_cast<_Tp*>(__builtin_operator_new(__size, static_cast<align_val...
      |                                                                         ^
../../third_party/depot_tools/win_toolchain/vs_files/e4305f407e/VC/Tools/MSVC/14.44.35207/include/vcruntime_new.h(27,33): note: 
      declaration here is not visible
   27 |     _VCRT_EXPORT_STD enum class align_val_t : size_t {};
      |                                 ^
```
…6077)

`ninja check-mlir-python` will fail in the recent main branch due to
missing shared libraries (`libmlir_runner_utils.so` and
`libmlir_c_runner_utils.so`).

This PR adds `mlir_c_runner_utils` and `mlir_runner_utils` into
dependencies of `check-mlir-python` so it will make sure that these
libraries are available before the test cases are executed.

```
[4350/4351] Running the MLIR Python regression tests
FAIL: MLIR :: python/execution_engine.py (92 of 99)
******************** TEST 'MLIR :: python/execution_engine.py' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
env MLIR_RUNNER_UTILS=/llvm-project/build/lib/libmlir_runner_utils.so MLIR_C_RUNNER_UTILS=/llvm-project/build/lib/libmlir_c_runner_utils.so /python-env/bin/python3 /llvm-project/mlir/test/python/execution_engine.py 2>&1 | /llvm-project/build/bin/FileCheck /llvm-project/mlir/test/python/execution_engine.py
# executed command: env MLIR_RUNNER_UTILS=/llvm-project/build/lib/libmlir_runner_utils.so MLIR_C_RUNNER_UTILS=/llvm-project/build/lib/libmlir_c_runner_utils.so /python-env/bin/python3 /llvm-project/mlir/test/python/execution_engine.py
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: /llvm-project/build/bin/FileCheck /llvm-project/mlir/test/python/execution_engine.py
# .---command stderr------------
# | /llvm-project/mlir/test/python/execution_engine.py:741:16: error: CHECK-LABEL: expected string not found in input
# | # CHECK-LABEL: TEST: testNanoTime
# |                ^
# | <stdin>:62:24: note: scanning from here
# | TEST: testSharedLibLoad
# |                        ^
# | <stdin>:73:68: note: possible intended match here
# |  File "/llvm-project/mlir/test/python/execution_engine.py", line 732, in testSharedLibLoad
# |                                                                    ^
# | 
# | Input file: <stdin>
# | Check file: /llvm-project/mlir/test/python/execution_engine.py
# | 
# | -dump-input=help explains the following input dump.
# | 
# | Input was:
# | <<<<<<
# |              .
# |              .
# |              .
# |             57: TEST: testF8E5M2Memref 
# |             58:  
# |             59: TEST: testDynamicMemrefAdd2D 
# |             60: True 
# |             61:  
# |             62: TEST: testSharedLibLoad 
# | label:741'0                            X error: no match found
# |             63: Failed to create MemoryBuffer for: /llvm-project/build/lib/libmlir_runner_utils.so 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             64: Error: No such file or directory 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             65: Failed to create MemoryBuffer for: /llvm-project/build/lib/libmlir_c_runner_utils.so 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             66: Error: No such file or directory 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             67: JIT session error: Symbols not found: [ _mlir_ciface_printMemrefF32 ] 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             68: Traceback (most recent call last): 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             69:  File "/llvm-project/mlir/test/python/execution_engine.py", line 737, in <module> 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             70:  run(testSharedLibLoad) 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~
# |             71:  File "/llvm-project/mlir/test/python/execution_engine.py", line 35, in run 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             72:  f() 
# | label:741'0     ~~~~~
# |             73:  File "/llvm-project/mlir/test/python/execution_engine.py", line 732, in testSharedLibLoad 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | label:741'1                                                                        ?                        possible intended match
# |             74:  execution_engine.invoke("main", arg0_memref_ptr) 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             75:  File "/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir/execution_engine.py", line 31, in invoke 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             76:  func = self.lookup(name) 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             77:  ^^^^^^^^^^^^^^^^^ 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~
# |             78:  File "/llvm-project/build/tools/mlir/python_packages/mlir_core/mlir/execution_engine.py", line 22, in lookup 
# | label:741'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |              .
# |              .
# |              .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--

********************
********************
Failed Tests (1):
  MLIR :: python/execution_engine.py


Testing Time: 2.60s

Total Discovered Tests: 99
  Unsupported:  2 (2.02%)
  Passed     : 96 (96.97%)
  Failed     :  1 (1.01%)
FAILED: tools/mlir/test/python/CMakeFiles/check-mlir-python /llvm-project/build/tools/mlir/test/python/CMakeFiles/check-mlir-python 
cd /llvm-project/build/tools/mlir/test/python && /python-env/bin/python3 /llvm-project/build/./bin/llvm-lit -sv /llvm-project/build/tools/mlir/test/python
ninja: build stopped: subcommand failed.
```
The premerge advisor should return quickly. If it does not, time out
rather than waiting as it indicates there is probably something wrong
with the advisor instance we are trying to connect to.
When formatting Verilog code, the program changes the hash to
`kw_verilogHash` and the backtick to `tok::hash`. The developer did not
take that into account when writing the part for recognizing the `#-#`
and `#=#` operators. The part did not work. The program would add a
space within the operator.

after

```SystemVerilog
##[0 : 5] done #-# always !rst;
```

before

```SystemVerilog
##[0 : 5] done #- #always !rst;
```
Follows-up 2527b07 which missed
updating the status in the documentations.
4eed683 updated the LLVM side but did
not bump the libc++abi version. Bump the libc++abi version to fix the
test failure caused by the versions differing.
- Replace verifyFormat(Foo, Bar, ...) with verifyFormat(Foo, ...) or
verifyNoChange(Foo, ...) if Foo = Bar.

- Other minor cleanups
This patch removes const to allow std::move a couple of lines below to
perform a move operation as intended.

Identified with performance-move-const.
In C++17, static constexpr members are implicitly inline, so they no
longer require an out-of-line definition.

Identified with readability-redundant-declaration.
In C++17, static constexpr members are implicitly inline, so they no
longer require an out-of-line definition.

Identified with readability-redundant-declaration.
In C++17, static constexpr members are implicitly inline, so they no
longer require an out-of-line definition.

Identified with readability-redundant-declaration.
Rewrite sinkScalarOperands in VPlanTransforms for clarity, in
preparation for follow-up work to extend it to handle more recipes.
Use early exit in getOrCreateVPValueForSCEVExpr.
When OMPT is enabled, the stack pointer was not saved to frame pointer
register immediately after storing the frame pointer to the stack.
Therefore the frame pointers did not constitute a proper chain.
Fixes [llvm#163352](llvm#163352)
This simplifies the test by moving some of the complicated options
to loop attributes, so that it's easier to extend the test file
with new cases.

The options `-enable-epilogue-vectorization` and
`-epilogue-vectorization-force-VF=2` were not strictly necessary
for the test.
…155394)

Currently in optimizeMaskToEVL we convert every widened load, store or
reduction to a VP predicated recipe with EVL, regardless of whether or
not it uses the header mask.

So currently we have to be careful when working on other parts VPlan to
make sure that the EVL transform doesn't break or transform something
incorrectly, because it's not a semantics preserving transform.
Forgetting to do so has caused miscompiles before, like the case that
was fixed in llvm#113667

This PR rewrites it to work in terms of pattern matching, so it now only
converts a recipe to a VP predicated recipe if it is exactly masked with
the header mask.

After this the transform should be a true optimisation and not change
any semantics, so it shouldn't miscompile things if other parts of VPlan
change.

This fixes llvm#152541, and allows us to move addExplicitVectorLength into
tryToBuildVPlanWithVPRecipes in llvm#153144

It also splits out the load/store transforms into separate patterns for
reversed and non-reversed, which should make llvm#146525 easier to implement
and reason about.
…ter. nfc (llvm#165568)

The function simplifyRecipe now takes a VPSingleDefRecipe pointer since
it only simplifies single-def recipes for now.
If we have v4i64 mul(zext(v4i16), sext(v4i16)), we can code-generate
that as v4i64 smull(v4i32 zext(v4i16), sext(v4i16), as
zext(x)==sext(zext(x)). This teaches the part of CGP that sinks operands
to uses about that, so that it can treat a zext that is more than twice
the width as a sext.
…166034)

Don't drop `assume` intrinsic when it's using `public_type_test `
intrinsic, as it could be used by devirtualization.
AlexVlx and others added 28 commits November 4, 2025 14:37
…kernel_attributes` (llvm#165891)

This adds BE support for the
[`SPV_INTEL_kernel_attributes`](https://github.khronos.org/SPIRV-Registry/extensions/INTEL/SPV_INTEL_kernel_attributes.html)
extension. The extension is necessary to encode the rather useful
`max_work_group_size` kernel attribute, via `OpExecutionMode
MaxWorkgroupSizeINTEL`, which is the only Execution Mode added by the
extension that this patch adds full processing for. Future patches will
add the other Execution Modes and Capabilities. The test is adapted from
the equivalent Translator test; it depends on llvm#165815.
…lvm#165606)

`clang -x hip foo.c --offload-arch=amdgcnspirv --offload-new-driver
-save-temps` was crashing with the following error:

```
/usr/bin/ld: input file 'foo-x86_64-unknown-linux-gnu.o' is the same as output file
build/bin/clang-linker-wrapper: error: 'ld' failed
```

The `LinkerWrapperJobAction` [is
created](https://github.com/llvm/llvm-project/blob/957598f71bd8baa029d886e59ed9aed60e6e9bb9/clang/lib/Driver/Driver.cpp#L4888)
with `types::TY_Object` which makes `Driver::GetNamedOutputPath` assign
the same name as the assembler's output and thus causing the crash.
Replace the current `ADRRelaxationPass` with `AArch64RelaxationPass`,
which, besides the existing ADR relaxation, will also run LDR relaxation
that for now only handles these two forms of LDR instructions:
`ldr Xt, [label]` and `ldr Wt, [label]`.
According to discussion of
llvm#153600 (comment)

add LLVM_ABI to function getMemcmp declaration
NDD ADD is only supported on 64 bit, but `LEA32` has
`Requires<[Not64BitMode]>`. The reason it doesnt fail upstream is that
the predicates check is commented out on `X86MCInstLower.cpp`:

```
  // FIXME: Enable feature predicate checks once all the test pass.
  // X86_MC::verifyInstructionPredicates(MI->getOpcode(),
  //                                     Subtarget->getFeatureBits());

```

Introduced by: llvm#158254
…66217)

Emit empty line after a namespace scope is opened and before its closed.
Adjust DirectiveEmitter code empty line emission in response to this to
avoid lot of unit test changes.
This patch moves llvm::to_address to STLForwardCompat.h, a collection
of backports from C++20 and beyond.
In C++17, static constexpr members are implicitly inline, so they no
longer require an out-of-line definition.

Once we remove the redundant declarations, Minidump.cpp becomes
effectively empty, so this patch removes the file.

Identified with readability-redundant-declaration.
This patch replaces:

  using Foo = enum { A, B, C };

with the more conventional:

  enum Foo { A, B, C };

These two enum declaration styles are not identical, but their
difference does not matter in these .cpp files.  With the "using Foo"
style, the enum is unnamed and cannot be forward-declared, whereas the
conventional style creates a named enum that can be.  Since these
changes are confined to .cpp files, this distinction has no practical
impact here.
Some followups after llvm#131687 switched to the "runtimes build".

- The `check-sanitizer` build target doesn't exist in the runtimes build; use `check-runtimes` instead.
- ASan is not supported on 32-bit windows. Pass `-DCOMPILER_RT_BUILD_SANITIZERS=OFF`
- `check-runtimes` includes the orcjit tests, which never passed on windows; build with `-DCOMPILER_RT_BUILD_ORC=OFF`
- Various asan and libfuzzer tests fail; suppress them with `LIT_FILTER_OUT`
Enable the `SPV_INTEL_bfloat16_arithmetic` extension, which allows arithmetic, relational and `OpExtInst` instructions to take `bfloat16` arguments. This patch only adds support to arithmetic and relational ops. The extension itself is rather fresh, but `bfloat16` is ubiquitous at this point and not supporting these ops is limiting.
…ng (llvm#166268)

Though we have a few code examples in our documentation that show how to
*use* libclang, we never actually show how to *link* against it. I
myself mostly figured this out through trial and error some time ago,
and I’ve since had to explain it to others on several occasions, so I
thought adding some very minimal CMake example code might be helpful.
…r ops (llvm#163414)

As [suggested
here](llvm#163071 (comment))
the PR adds an optional layout attribute for `LoadGather` and
`StoreScatter` ops.

For the load-op the attribute describes the layout of the result (ex
`layout_result_0`), and for store-op it describes the layout for the
vector-to-store operand (ex `layout_operand_0`).

The PR also reworks `propagate-layout` pass to consider perm layout
attributes and back-propagate them accordingly.

The helper utility function `getDistributeLayoutAttr` is reworked to
return either `layout_operand/result_0` or `layout` for load/store ops
(denepding on which one is set). After an offline discussion decided
that the overall utilities layouts API is confusing since it tries to
mix permament and temporary layouts. Would need to change it in the
future.

---------

Signed-off-by: dchigarev <[email protected]>
…vm#166392)

This fixes a typo introduced in llvm#165606 which makes the test case fail.

---------

Co-authored-by: Joseph Huber <[email protected]>
… when navigating up/down (llvm#166394)

When stopped in a hidden frame (either because we selected the hidden
frame or hit a breakpoint inside it), a user most likely is intersted in
exploring the immediate frames around it. But currently issuing
`up`/`down` commands will unconditionally skip over all hidden frames.

This patch makes it so `up`/`down` commands don't skip hidden frames if
the frame we started it was a hidden frame.
This patch deprecates an APInt constructor that has been
soft-deprecated via comments since:

  commit 7a16288
  Author: Jeffrey Yasskin <[email protected]>
  Date:   Mon Jul 18 21:45:40 2011 +0000

This patch updates a small number of remaining uses.
Reverts llvm#115917 and its follow up llvm#116840.
Fixes llvm#153782 and introduces regression tests.
Reopens llvm#114270.
Directives cannot be nested. A directive sentinel that appears within
another directive should be ignored, and instead fall back to be treated
as a line comment.

Fixes: llvm#165874
This envar acts as an override blocksize to be used for Xteam reduction
kernels. The default is 0 (unused).
@b-sumner b-sumner closed this Nov 4, 2025
@b-sumner b-sumner deleted the amd/dev/bsumner_amdeng/asan-poison-fns branch November 10, 2025 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.