LLVM/project 8649ac2llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

[VPlan] Remove (X && Y) | (X && !Y) -> X combine. NFC

We have smaller combines that can take care of this now that we process recipes in a worklist
DeltaFile
+1-8llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-81 files

LLVM/project bbea61bllvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

Precommit test
DeltaFile
+163-0llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+163-01 files

LLVM/project 8e8607dllvm/lib/Transforms/Vectorize LoopVectorizationPlanner.h VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

[VPlan] Append recipes created via builder to worklist

The previous PR appended the top most created recipe to the worklist, and this PR extends it to any other nested recipes that were created, similar to InstCombine.

This removes the header mask in a good few more places on RISC-V as measured on SPEC CPU 2017, e.g. for the following loop:

```c
long f(const int *p, const int *q, long n) {
  long a = 0, b = 0;
  for (long i = 0;; i++) {
    if (p[i] && q[i]) { a += i; b += i; }
    if (i + 1 == n) break;
  }
  return a + b;
}
```

Before:


    [49 lines not shown]
DeltaFile
+26-8llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+11-4llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+5-7llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+42-193 files

LLVM/project 8872533llvm/test/Transforms/LoopVectorize blend-i1.ll

Precommit test
DeltaFile
+58-0llvm/test/Transforms/LoopVectorize/blend-i1.ll
+58-01 files

LLVM/project c242d15llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

No need to dyn_cast to singledef recipe anymore
DeltaFile
+1-3llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-31 files

LLVM/project ce2ddcdllvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Unindent loop
DeltaFile
+14-13llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+14-131 files

LLVM/project 8a31437llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Address review comments

- Limit to double initial worklist size
- Use VPSingleDefRecipe type
DeltaFile
+11-6llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+11-61 files

LLVM/project b0f0d54llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Use make_pointer_range
DeltaFile
+1-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-21 files

LLVM/project a4d9929llvm/test/Transforms/LoopVectorize blend-i1.ll

Make then branch non-dead
DeltaFile
+10-6llvm/test/Transforms/LoopVectorize/blend-i1.ll
+10-61 files

LLVM/project 1b1f057llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Switch to SmallVector with space on stack

SmallVector allows for much larger small sizes than SetVector, so use 256 to match InstructionWorklist.
We don't need to worry about duplicate worklist entries until we add users to the worklist.
DeltaFile
+4-4llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+4-41 files

LLVM/project df5e1b2llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize iv_outside_user.ll blend-i1.ll

[VPlan] Process simplifyRecipes in a worklist

This brings simplifyRecipes further in line with InstCombine, and asides from unlocking more simplifications it also helps avoid spurious test churn whenever passes are moved around simplifyRecipes.

For now just push the new recipe onto the worklist, not its users.
This uses a post order traversal so we maintain the same simplification order as before.

I've gone through and checked every simplification we do is a canonicalisation that converges, and I checked on llvm-test-suite + SPEC CPU 2017 in various configurations that we don't hit any cycles.
DeltaFile
+23-14llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+4-8llvm/test/Transforms/LoopVectorize/dont-fold-tail-for-divisible-TC.ll
+2-3llvm/test/Transforms/LoopVectorize/blend-i1.ll
+1-2llvm/test/Transforms/LoopVectorize/iv_outside_user.ll
+30-274 files

LLVM/project 8a0cc1fllvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Capitalize variable names in comments
DeltaFile
+21-21llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+21-211 files

LLVM/project 933bab1llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Update comment
DeltaFile
+2-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+2-21 files

LLVM/project f3e662fllvm/lib/Transforms/Vectorize VPlanTransforms.cpp

Drop VPValue A
DeltaFile
+22-22llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+22-221 files

LLVM/project 5683232llvm/lib/Transforms/Vectorize LoopVectorize.cpp VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize vplan-print-before-after.ll

[VPlan] Split simplifyRecipes into simplifyRecipes and combineRecipes

Bringing it in line with InstSimplify and InstCombine, split up simplifyRecipe into a function that modifies and creates recipes (combineRecipe), and one that is analysis-only (simplifyRecipe).

This allows us to avoid adding simplficiation only folds to the worklist in #213899.

The funclet.ll test no longer erases the constant-folded intrinsic call because vputils::isDeadRecipe returns false.
DeltaFile
+231-216llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+9-6llvm/test/Transforms/LoopVectorize/X86/funclet.ll
+5-5llvm/test/Transforms/LoopVectorize/VPlan/vplan-print-before-after-all.ll
+4-4llvm/test/Transforms/LoopVectorize/vplan-print-before-after.ll
+4-4llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+1-1llvm/test/Transforms/LoopVectorize/VPlan/constant-fold.ll
+254-2361 files not shown
+255-2377 files

LLVM/project b113e26

Fix Bazel build for 52d922a (#222219)

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=52d922aa153b1232813470e014635419ce006023

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+0-00 files

LLVM/project 8c7d76bllvm/lib/Transforms/IPO MemProfContextDisambiguation.cpp, llvm/test/ThinLTO/X86 memprof-funcassigncloning.ll

[MemProf] Use NodeId to break ties deterministically in identifyClones (#222126)

In identifyClones(), ties between caller edges with identical allocation
types and matching clone candidates were previously broken by comparing
the first element of ContextIds (*A->ContextIds.begin() <
*B->ContextIds.begin()).
Because ContextIds is a DenseSet, its iteration order depends on hash
table
layout and bucket distribution, introducing non-determinism across
different
runs or architectures.

Replace this tie-breaker with caller NodeId (A->Caller->NodeId <
B->Caller->NodeId),
which provides a deterministic and stable ordering. Also apply
Callee->NodeId
in CalleeCallerEdgeLessThan for consistency.

Update tests whose remark or dump order depended on the previous

    [7 lines not shown]
DeltaFile
+35-35llvm/test/ThinLTO/X86/memprof-funcassigncloning.ll
+25-25llvm/test/Transforms/MemProfContextDisambiguation/funcassigncloning.ll
+6-7llvm/lib/Transforms/IPO/MemProfContextDisambiguation.cpp
+5-5llvm/test/Transforms/MemProfContextDisambiguation/inlined3.ll
+2-2llvm/test/Transforms/MemProfContextDisambiguation/duplicate-context-ids.ll
+1-1llvm/test/Transforms/MemProfContextDisambiguation/funcassigncloningrecursion.ll
+74-752 files not shown
+76-778 files

LLVM/project 33898ffclang/test/SemaCXX ms-ctor-closure.cpp

[clang][test] Add test for #67685 NFC (#222212)
DeltaFile
+15-0clang/test/SemaCXX/ms-ctor-closure.cpp
+15-01 files

LLVM/project a339879llvm/test/CodeGen/AMDGPU dpp_combine_rev_opcode.ll

[AMDGPU] Update REV Opcode DPP Combine test to not use True16

DPP is not implemented for VGPR16 operands, so it should be disabled to allow verifying opcodes that would use the still work
DeltaFile
+61-70llvm/test/CodeGen/AMDGPU/dpp_combine_rev_opcode.ll
+61-701 files

LLVM/project 5502e46llvm/lib/Target/AMDGPU GCNDPPCombine.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.h

[AMDGPU] Fix invalid 64-bit DPP formed from folding a 32-bit DPP mov

GCNDPPCombine already rejects 64-bit DPP when the DPP move itself is
64-bit, but a 32-bit move folded into a source of a 64-bit instruction
was not checked. On targets without FeatureDPALU_DPP this formed
V_LSHLREV_B64_e64_dpp, whose tied old operand got the move's 32-bit
register class instead of the 64-bit destination class.
DeltaFile
+10-6llvm/test/CodeGen/AMDGPU/dpp_combine_rev_opcode.ll
+5-1llvm/lib/Target/AMDGPU/GCNDPPCombine.cpp
+1-1llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+16-83 files

LLVM/project 1337fdfllvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

fixup! Address review comment
DeltaFile
+18-9llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+18-91 files

LLVM/project 75c8e63flang/lib/Optimizer/Transforms/CUDA CUFPredefinedVarToGPU.cpp, mlir/lib/Dialect/MemRef/TransformOps MemRefTransformOps.cpp

Rebase, address comments

Created using spr 1.3.7
DeltaFile
+1,318-55utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+79-79mlir/test/Dialect/Linalg/vectorization/linalg-ops-with-patterns.mlir
+121-0mlir/test/Target/LLVMIR/openmp-allocate-directive.mlir
+77-24mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+41-59flang/lib/Optimizer/Transforms/CUDA/CUFPredefinedVarToGPU.cpp
+94-0mlir/lib/Dialect/MemRef/TransformOps/MemRefTransformOps.cpp
+1,730-217317 files not shown
+3,992-2,256323 files

LLVM/project 6930b7fclang/docs ReleaseNotes.md, clang/lib/Sema SemaTemplateDeductionGuide.cpp

[Clang][CTAD] Implement deduction guides for alias templates with nested aliases
DeltaFile
+31-4clang/lib/Sema/SemaTemplateDeductionGuide.cpp
+5-0clang/docs/ReleaseNotes.md
+2-2clang/test/SemaCXX/cxx20-ctad-type-alias.cpp
+38-63 files

LLVM/project e1683efllvm/test/Transforms/GVN/PRE no-pre-load-for-token-like.ll no-phi-translate.ll, llvm/test/Transforms/LCSSA token-like-live-out.ll

[IR][DirectX] Drop IsTokenLike from `dx.*` target types (#222130)

We made the DirectX resource types "token-like" a while ago in order to
prevent transforms from moving them into PHIs and the like in ways that
made determining their provenance more difficult. However, there are
patterns in HLSL that can generate the problematic IR directly and we've
since implemented logic in `DXILResourceAccess` to handle such cases
anyway. Because of this, we aren't really getting any benefit from the
types being `IsTokenLike`, and in some cases we're working with
intermediate IR that doesn't actually pass the verifier.

Drop `IsTokenLike` from the `dx.*` types since it's no longer correct or
useful. I've updated the tests to use `amdgpu.stridemark` instead, and
slightly abused `llvm.ssa.copy` in order to manufacture SSA values of
that type. I had to drop the test that actually needed a load from a
value depending on the token-like type, as there just isn't really a way
for that to come up without the resource types.
DeltaFile
+23-28llvm/test/Transforms/GVN/PRE/no-phi-translate.ll
+0-46llvm/test/Transforms/SimplifyCFG/token_like_type.ll
+10-10llvm/test/Transforms/GVN/PRE/no-pre-load-for-token-like.ll
+6-6llvm/test/Transforms/SimpleLoopUnswitch/token-uses.ll
+5-5llvm/test/Transforms/LCSSA/token-like-live-out.ll
+4-2llvm/test/Verifier/tokenlike1.ll
+48-979 files not shown
+59-11315 files

LLVM/project dea8e29clang/test/SemaCXX cxx20-default-compare.cpp gh147127.cpp

[clang][test] Move test `gh147127.cpp` to `cxx20-default-compare.cpp` NFC (#222208)

Follow-up #198830
DeltaFile
+0-12clang/test/SemaCXX/gh147127.cpp
+9-0clang/test/SemaCXX/cxx20-default-compare.cpp
+9-122 files

LLVM/project 7209c7aclang/test/Driver modules-driver-depscan-log.cpp

[clang][Driver][test] Specify output path in modules-driver-depscan-log.cpp (#222209)

In `clang/test/Driver/modules-driver-depscan-log.cpp`, `%clang -c` is
invoked on `%t/A.cppm` without an explicit output file (`-o`). By
default, Clang writes the resulting object file (`A.o`) to the current
working directory.
In sandboxed or hermetic test environments where the test runner
executes with a read-only working directory (e.g., Bazel, Nix, or remote
build executors), the test fails with:

```text
error: unable to open output file 'A.o': 'Permission denied'
1 error generated.
DeltaFile
+1-1clang/test/Driver/modules-driver-depscan-log.cpp
+1-11 files

LLVM/project 4383c7fbolt/lib/Target/AArch64 AArch64MCPlusBuilder.cpp

[BOLT][AArch64] Fix relocation type for `LDRSW` (#221939)

Fix the incorrect relocation type for `LDRSW`. It should be
`ELF::R_AARCH64_LDST32_ABS_LO12_NC`, but it was mistakenly set to
`ELF::R_AARCH64_LDST64_ABS_LO12_NC` in PR #196051.
DeltaFile
+1-1bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+1-11 files

LLVM/project 1e2233cllvm/include/llvm/DebugInfo DIContext.h, llvm/lib/DebugInfo/DWARF DWARFDie.cpp

Print symbolic names for DW_AT_LLVM_address_space
DeltaFile
+60-0llvm/test/tools/llvm-dwarfdump/AMDGPU/DW_AT_LLVM_address_space.yaml
+23-8llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+16-0llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+1-0llvm/include/llvm/DebugInfo/DIContext.h
+100-84 files

LLVM/project 6bbc72dllvm/lib/DebugInfo/DWARF DWARFDie.cpp, llvm/tools/llvm-dwarfdump llvm-dwarfdump.cpp

Address review comments: avoid needless copies
DeltaFile
+6-5llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+1-1llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+7-62 files

LLVM/project d7da49eclang/include/clang/Options ClangOptionDocs.td Options.td, clang/utils/TableGen ClangOptionDocEmitter.cpp

[clang][flang][docs] Re-land Markdown CLI ref generator (#222147)

Reverts llvm/llvm-project#221937
Relands llvm/llvm-project#220385

This time, the migration includes flang command line reference
documentation, so the change passes `ninja docs-flang-html/man`.

Tracking issue: #201242

Assisted-By: Codex
DeltaFile
+42-51clang/include/clang/Options/FlangOptions.td
+33-32clang/include/clang/Options/Options.td
+39-26clang/utils/TableGen/ClangOptionDocEmitter.cpp
+15-15flang/docs/CMakeLists.txt
+11-12flang/docs/FlangOptionsDocs.td
+8-11clang/include/clang/Options/ClangOptionDocs.td
+148-1472 files not shown
+161-1588 files