[all-commits] [llvm/llvm-project] b1d5d7: [VPlan] Don't use the legacy cost model for loop c...

Ryotaro Kasuga via All-commits all-commits at lists.llvm.org
Wed Jun 3 07:26:18 PDT 2026


  Branch: refs/heads/users/kasuga-fj/loop-interchange-fix-call-check
  Home:   https://github.com/llvm/llvm-project
  Commit: b1d5d7e3237ac5be660f82c71ec7323d6db7b724
      https://github.com/llvm/llvm-project/commit/b1d5d7e3237ac5be660f82c71ec7323d6db7b724
  Author: John Brawn <john.brawn at arm.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/test/Transforms/LoopVectorize/AArch64/cmp_cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/fully-unrolled-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/low-trip-count.ll
    M llvm/test/Transforms/LoopVectorize/X86/CostModel/vpinstruction-cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
    M llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
    M llvm/test/Transforms/LoopVectorize/X86/reduction-small-size.ll

  Log Message:
  -----------
  [VPlan] Don't use the legacy cost model for loop conditions (#156864)

The current behaviour of using the legacy cost model for instructions
that compute the loop exit condition gets the wrong result when the loop
has been transformed to use a different exit condition, e.g. when have
tail-folded predicated vectorization the exit condition is based on the
predicate vector.

Fix this by adding cost computation for BranchOnCount and removing the
restriction on computing the cost for scalar ICmp/FCmp, and removing the
use of the legacy cost model for loop exit conditions.

This causes quite a lot of changes to expected output in tests. Some of
these are just changes to the -debug output, others are choosing a
different VF due to previously over or under-estimating the cost, and in
others the minimum trip count has changed as we now compute the cost for
compares in the middle block.


  Commit: 0fd2402e94447ae9ae77e319cc8e312b97e5a30e
      https://github.com/llvm/llvm-project/commit/0fd2402e94447ae9ae77e319cc8e312b97e5a30e
  Author: Jan Patrick Lehr <JanPatrick.Lehr at amd.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M offload/ci/hip-tpl.py

  Log Message:
  -----------
  [HIP] Remove explicit compiler-rt from bot recipe (#201329)

The same change was done to the AnnotatedBuilder script recently. Let's
keep them in sync.
https://github.com/llvm/llvm-zorg/pull/861


  Commit: 52cf94a82eabfe70d417c17a3ab38736ded4938b
      https://github.com/llvm/llvm-project/commit/52cf94a82eabfe70d417c17a3ab38736ded4938b
  Author: Arseniy Obolenskiy <arseniy.obolenskiy at amd.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
    M llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
    M llvm/test/CodeGen/AMDGPU/amdgpu-late-codegenprepare.ll
    M llvm/test/CodeGen/AMDGPU/widen_extending_scalar_loads.ll

  Log Message:
  -----------
  [AMDGPU] Drop !noundef when widening sub-DWORD constant loads (#201085)

The widened i32 load reads bytes outside the original sub-DWORD load, so
new op cannot claim !noundef


  Commit: 70d62e1e10907e1bd6dd0e92968acbf6fe58af37
      https://github.com/llvm/llvm-project/commit/70d62e1e10907e1bd6dd0e92968acbf6fe58af37
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M clang/include/clang/Driver/Driver.h
    M clang/include/clang/Driver/ToolChain.h
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChain.cpp
    M clang/lib/Driver/ToolChains/AIX.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
    M clang/lib/Driver/ToolChains/AVR.cpp
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/Cuda.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/lib/Driver/ToolChains/Flang.cpp
    M clang/lib/Driver/ToolChains/FreeBSD.cpp
    M clang/lib/Driver/ToolChains/Fuchsia.cpp
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/lib/Driver/ToolChains/HIPAMD.cpp
    M clang/lib/Driver/ToolChains/Haiku.cpp
    M clang/lib/Driver/ToolChains/Hexagon.cpp
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/lib/Driver/ToolChains/OpenBSD.cpp
    M clang/lib/Driver/ToolChains/PS4CPU.cpp
    M clang/lib/Driver/ToolChains/SPIRV.cpp
    M clang/lib/Driver/ToolChains/Serenity.cpp
    M clang/lib/Driver/ToolChains/WebAssembly.cpp

  Log Message:
  -----------
  [Clang] Rework LTO mode selection to be a Toolchain property (#201155)

Summary:
Currently, the LTO mode is a property of the Driver, which makes sense
because it is used to set up phases. However, we currently have `-flto`
and `-foffload-lto`, which is a split that doesn't fully work with the
full context of a heterogenous compilation as it is 'all-or-nothing'.

This PR seeks to be mostly NFC for now, just moving the queries to a
per-toolchain interface rather than the static driver mode setting we
have right now. The *single* use of this before ToolChains are created
is for the Webassembly toolchain to set an include path. This is now
just a direct check on the flag, which is consistent. In the future they
could shift to fat LTO objects as well.

The main goal for the PR is to allow the GPU / Offloading toolchains to
specify their "real" LTO behavior. Right now SPIR-V and AMDGCN both
default to LTO, but rather than re-use the LTO handling we hack through
the driver phases to override it. Allowing this split would let us
heavily simplify this logic.

Co-authored-by: Cursor <cursoragent at cursor.com>

---------

Co-authored-by: Cursor <cursoragent at cursor.com>


  Commit: 911eddeed7ba2359c953396afce934fee269f50e
      https://github.com/llvm/llvm-project/commit/911eddeed7ba2359c953396afce934fee269f50e
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/test/Driver/include-omp-header.f90
    M flang/test/lit.cfg.py
    M openmp/module/CMakeLists.txt

  Log Message:
  -----------
  [Flang] Fix omp_lib.h location and search path (#201104)

Before this PR, omp_lib.h is emitted to `${PREFIX}/include` or
`${PREFIX}/lib/clang/<version>/include` (install prefix) and
`${PREFIX}/runtime/src/omp_lib.h` (builddir prefix). It is never found
there because the driver only adds `${PREFIX}/include/flang/OpenMP` to
the include path.

Fix the `omp_lib.h` include by using the same mechanism as the
omp_lib.mod; that is, move it to
`${PREFIX}/lib/clang/<version>/finclude/flang/<target-triple>`. The
search path is already added by the driver via
`-fintrinsics-modules-path` by the driver. Although omp_lib.h currently
does not contain anything target-specific, it could do so in the future
and I don't think it is worth the effort to add a mechanism without the
target triple. It should also me consistent with omp_lib.mod.

The changes in detail consist of:
1. Move the omp_lib.h output in the builddir to
`${RUNTIMES_OUTPUT_RESOURCE_MOD_DIR}`. This already takes care of
whether it is a bootstrapping build or not.
3. Move the omp_lib.h install dir to
`${RUNTIMES_INSTALL_RESOURCE_MOD_PATH}`.
4. Remove the implicit search path `include/flang/OpenMP` from the
frontend. There is nothing in there anyway.
5. Hardcoding the include search path for testing to the
`LLVM_RUNTIME_TARGETS=default` build becomes unnecessary. This was way
the `include-omp-header.f90` test was still passing, although it would
not work outside the regression tests. Essentially, it tested
lit.site.cfg, not the driver.
6. Replace the old `include-omp-header.f90` test. It created a temporary
`omp_lib.h` that interferes with any other test that use `include
omp_lib.h` (there currently isn't but I originally intended to add the
replacement as an additional omp_lib.h test which resulted in a flaky
test while the original test was there). Due to how the %flang(_fc1)
substitution works, lookup order may also vary.


  Commit: e5332f3ea1766a0cfaa1a50a4db9f78c9d39cd3b
      https://github.com/llvm/llvm-project/commit/e5332f3ea1766a0cfaa1a50a4db9f78c9d39cd3b
  Author: Kai Nacke <kai.peter.nacke at ibm.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M llvm/include/llvm/MC/MCGOFFObjectWriter.h
    M llvm/lib/MC/GOFFObjectWriter.cpp

  Log Message:
  -----------
  [SystemZ][GOFF] Implement reset() for GOFFObjectWriter (#201197)

The reset() methods is used to free memory before the object is
destructed or reused. This change adds this functionality to the GOFF
writer.


  Commit: c689c165ba2723285258975a14cd562d41d059ab
      https://github.com/llvm/llvm-project/commit/c689c165ba2723285258975a14cd562d41d059ab
  Author: Zorojuro <sawantsukumar at gmail.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M libc/src/__support/FPUtil/bfloat16.h
    M libc/test/src/__support/FPUtil/bfloat16_test.cpp

  Log Message:
  -----------
  [libc] Add compound assignment operator overloads for BFloat16 (#201301)

The current Bfloat16 has normal operator overloads `+` , `-` , `=`,
`!=`, `*`, & `/`.
Later during a function failure `*=` was added in
https://github.com/llvm/llvm-project/pull/182882
For completeness the rest of the operators: `/=`, `+=`, `-=` are added 
These are added along with some smoke test .


  Commit: a2369b9743391351b1dd4a5c38fb61e295ff7088
      https://github.com/llvm/llvm-project/commit/a2369b9743391351b1dd4a5c38fb61e295ff7088
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M clang/lib/Driver/ToolChains/Clang.cpp

  Log Message:
  -----------
  [Clang] Fix leftover use of old LTO path (#201360)

Summary:
This was accidentally missed when I merged the refactor because it
showed up after I made the PR and didn't have any merge conflicts I
noticed.


  Commit: ef4fb183a8d5c0d1910f7b5b6776ba669d6795ef
      https://github.com/llvm/llvm-project/commit/ef4fb183a8d5c0d1910f7b5b6776ba669d6795ef
  Author: khaki3 <47756807+khaki3 at users.noreply.github.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
    M flang/test/HLFIR/opt-bufferization-eval_in_mem.fir

  Log Message:
  -----------
  [flang][hlfir] Resolve shape_of users when bufferizing eval_in_mem (#201214)

A follow-up to #197814.

Example:

```fortran
bmat = matmul(mat, mat)   ! bmat is allocatable
```

In this code, `SeparateAllocatableAssign` sizes the reallocation with an
`hlfir.shape_of` of the RHS. Once the `matmul` is lowered to
`hlfir.eval_in_mem`, that `shape_of` is an extra user, so
`EvaluateIntoMemoryAssignBufferization` erases the `eval_in_mem` while
it's still used, hitting a `use-after-erase` assertion at `-O2`.

Fix: in `OptimizedBufferization`, redirect a `shape_of` user to the
`eval_in_mem`'s shape operand before erasing it.


  Commit: a7bfea843c73c9b48feb1b94c996924d2881f362
      https://github.com/llvm/llvm-project/commit/a7bfea843c73c9b48feb1b94c996924d2881f362
  Author: Cullen Rhodes <cullen.rhodes at arm.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    R llvm/test/Transforms/InferAddressSpaces/AMDGPU/old-pass-regressions-inseltpoison.ll
    R llvm/test/Transforms/InterleavedAccess/AArch64/interleaved-accesses-inseltpoison.ll

  Log Message:
  -----------
  [Transforms] Delete identical poison tests (NFC) (#201349)

These are now bit-identical to the original tests:
- llvm/test/Transforms/InferAddressSpaces/AMDGPU/old-pass-regressions.ll
- llvm/test/Transforms/InterleavedAccess/AArch64/interleaved-accesses.ll


  Commit: 9e01e0970c4cf810e99bdfde3a2329610df6d90c
      https://github.com/llvm/llvm-project/commit/9e01e0970c4cf810e99bdfde3a2329610df6d90c
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M flang-rt/CMakeLists.txt

  Log Message:
  -----------
  [Flang-RT] Disable tests by default without modules (#201311)

With #201297 flang-rt-mod is required for running tests. Disable tests
by default if module files are not built.


  Commit: 7eff475c4998039878563b987121c7fcc002b7b3
      https://github.com/llvm/llvm-project/commit/7eff475c4998039878563b987121c7fcc002b7b3
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M clang/test/Driver/hip-toolchain-no-rdc.hip

  Log Message:
  -----------
  [HIP] Fix test for --no-lto (#201367)


  Commit: 9e36ae5ac9555857578f8c8b420c8c9a3661a4cf
      https://github.com/llvm/llvm-project/commit/9e36ae5ac9555857578f8c8b420c8c9a3661a4cf
  Author: Ryotaro Kasuga <kasuga.ryotaro at fujitsu.com>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M clang/include/clang/Driver/Driver.h
    M clang/include/clang/Driver/ToolChain.h
    M clang/lib/Driver/Driver.cpp
    M clang/lib/Driver/SanitizerArgs.cpp
    M clang/lib/Driver/ToolChain.cpp
    M clang/lib/Driver/ToolChains/AIX.cpp
    M clang/lib/Driver/ToolChains/AMDGPU.cpp
    M clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
    M clang/lib/Driver/ToolChains/AVR.cpp
    M clang/lib/Driver/ToolChains/BareMetal.cpp
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Driver/ToolChains/Cuda.cpp
    M clang/lib/Driver/ToolChains/Darwin.cpp
    M clang/lib/Driver/ToolChains/Flang.cpp
    M clang/lib/Driver/ToolChains/FreeBSD.cpp
    M clang/lib/Driver/ToolChains/Fuchsia.cpp
    M clang/lib/Driver/ToolChains/Gnu.cpp
    M clang/lib/Driver/ToolChains/HIPAMD.cpp
    M clang/lib/Driver/ToolChains/Haiku.cpp
    M clang/lib/Driver/ToolChains/Hexagon.cpp
    M clang/lib/Driver/ToolChains/MSVC.cpp
    M clang/lib/Driver/ToolChains/MinGW.cpp
    M clang/lib/Driver/ToolChains/OpenBSD.cpp
    M clang/lib/Driver/ToolChains/PS4CPU.cpp
    M clang/lib/Driver/ToolChains/SPIRV.cpp
    M clang/lib/Driver/ToolChains/Serenity.cpp
    M clang/lib/Driver/ToolChains/WebAssembly.cpp
    M clang/test/Driver/hip-toolchain-no-rdc.hip
    M flang-rt/CMakeLists.txt
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Optimizer/HLFIR/Transforms/OptimizedBufferization.cpp
    M flang/test/Driver/include-omp-header.f90
    M flang/test/HLFIR/opt-bufferization-eval_in_mem.fir
    M flang/test/lit.cfg.py
    M libc/src/__support/FPUtil/bfloat16.h
    M libc/test/src/__support/FPUtil/bfloat16_test.cpp
    M llvm/include/llvm/MC/MCGOFFObjectWriter.h
    M llvm/lib/MC/GOFFObjectWriter.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
    M llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
    M llvm/test/CodeGen/AMDGPU/amdgpu-late-codegenprepare.ll
    M llvm/test/CodeGen/AMDGPU/widen_extending_scalar_loads.ll
    R llvm/test/Transforms/InferAddressSpaces/AMDGPU/old-pass-regressions-inseltpoison.ll
    R llvm/test/Transforms/InterleavedAccess/AArch64/interleaved-accesses-inseltpoison.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/cmp_cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/conditional-branches-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/fully-unrolled-cost.ll
    M llvm/test/Transforms/LoopVectorize/AArch64/scalable-vectorization-cost-tuning.ll
    M llvm/test/Transforms/LoopVectorize/ARM/mve-icmpcost.ll
    M llvm/test/Transforms/LoopVectorize/RISCV/low-trip-count.ll
    M llvm/test/Transforms/LoopVectorize/X86/CostModel/vpinstruction-cost.ll
    M llvm/test/Transforms/LoopVectorize/X86/consecutive-ptr-uniforms.ll
    M llvm/test/Transforms/LoopVectorize/X86/cost-model.ll
    M llvm/test/Transforms/LoopVectorize/X86/reduction-small-size.ll
    M offload/ci/hip-tpl.py
    M openmp/module/CMakeLists.txt

  Log Message:
  -----------
  Merge branch 'main' into users/kasuga-fj/loop-interchange-fix-call-check


Compare: https://github.com/llvm/llvm-project/compare/afa43b52c9f0...9e36ae5ac955

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list