LLVM/project fc43f7dutils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes 9889e62 (#206294)

This fixes 9889e626983fe38aca09283e9092fd8cebdae8fa.

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+1-01 files

LLVM/project 10e7761libc/shared builtins.h, libc/shared/builtins subdf3.h

[libc] add shared subdf3 builtin (#205673)

Re-exposes LLVM-libc's `__subdf3` as `shared::subdf3` for reuse by
compiler-rt's builtins.

Stacked change - merge these first:
- #200094
- #205669
- #205670
- #205671
- #205672

Part of #197824
DeltaFile
+32-0libc/src/__support/builtins/subdf3.h
+29-0libc/shared/builtins/subdf3.h
+9-0libc/src/__support/builtins/CMakeLists.txt
+1-0libc/shared/builtins.h
+1-0libc/test/shared/CMakeLists.txt
+1-0libc/test/shared/shared_builtins_test.cpp
+73-06 files

LLVM/project 9889e62mlir/include/mlir-c IR.h, mlir/include/mlir/CAPI IRMapping.h

[mlir-c] Add IRMapping C API bindings (#206146)

Expose IRMapping through the MLIR C API with full create/destroy/map, lookup, contains/erase, and clone-with-mapping functionality.

Assisted by: Claude
DeltaFile
+121-0mlir/test/CAPI/ir.c
+89-0mlir/include/mlir-c/IR.h
+85-0mlir/lib/CAPI/IR/IR.cpp
+43-0mlir/test/CAPI/rewrite.c
+18-0mlir/include/mlir/CAPI/IRMapping.h
+7-0mlir/lib/CAPI/Transforms/Rewrite.cpp
+363-01 files not shown
+368-07 files

LLVM/project 115eae2llvm/include/llvm/Support WithColor.h raw_ostream.h, llvm/test lit.cfg.py

[FileCheck] Improve colors in input dumps (#204936)

This patch makes two improvements to colors used in FileCheck input
dumps:

1. Without this patch, input line numbers and ellipses have a foreground
    color of black, which is hard to see in a terminal with a dark color
    theme. This patch changes that to bright black (a grayish color), which
    looks good to me for all terminal themes I have tried while remaining
    distinct from the input text.
2. Without this patch, the input text is accidentally set to bold when
    neither `-v` or `-vv` is specified. Perhaps I never noticed because I
    tend to always use `-vv`. This patch changes that to use the terminal's
    default color.

Case 2 exposes a problem with LLVM's color implementation. Without this
patch, the call to `WithColor`'s constructor actually specifies bold as
`false`, but `WithColor` ignores that when the color is `SAVEDCOLOR`.
While it seems like that should be fixed, I am concerned about the

    [6 lines not shown]
DeltaFile
+112-0llvm/test/FileCheck/dump-input/color.txt
+93-0llvm/test/lit.cfg.py
+17-9llvm/test/FileCheck/opt-color.txt
+14-4llvm/utils/FileCheck/FileCheck.cpp
+4-0llvm/include/llvm/Support/WithColor.h
+2-0llvm/include/llvm/Support/raw_ostream.h
+242-136 files

LLVM/project e6203d0mlir/include/mlir-c IR.h, mlir/include/mlir/CAPI IRMapping.h

[mlir-c] Add IRMapping C API bindings

Expose IRMapping through the MLIR C API with full create/destroy/map,
lookup, contains/erase, and clone-with-mapping functionality.
DeltaFile
+121-0mlir/test/CAPI/ir.c
+89-0mlir/include/mlir-c/IR.h
+85-0mlir/lib/CAPI/IR/IR.cpp
+43-0mlir/test/CAPI/rewrite.c
+18-0mlir/include/mlir/CAPI/IRMapping.h
+7-0mlir/lib/CAPI/Transforms/Rewrite.cpp
+363-01 files not shown
+368-07 files

LLVM/project deb7809llvm/test/tools/obj2yaml/DXContainer PRIVPart.yaml

[DirectX][ObjectYAML] Attempt to fix flaky PRIVPart.yaml (#206278)

This test was meant to round-trip YAML twice, to ensure correct
processing of non-4-byte-padded PRIV section.
However, second invocation of yaml2obj had wrong arguments (it was
reading from test file instead of stdin). Fix that.

Also, round-trips were split into several RUN lines, to make it clear on
which line an error occurs if the test is still flaky.
DeltaFile
+3-1llvm/test/tools/obj2yaml/DXContainer/PRIVPart.yaml
+3-11 files

LLVM/project cb9e849llvm/test/FileCheck/dump-input color.txt

Fix typo in color.txt comment about unmatched input
DeltaFile
+1-1llvm/test/FileCheck/dump-input/color.txt
+1-11 files

LLVM/project 91cfa57clang/docs SanitizerSpecialCaseList.rst ReleaseNotes.rst, clang/unittests/Basic DiagnosticTest.cpp

Reland "Make sanitizer special case list slash-agnostic" (#206250)

This changes the glob matcher for the sanitizer special case format so
that it treats `/` as matching both forward and back slashes.

When dealing with cross-compiles or build systems that don't normalize
slashes, it's possible to run into file paths with inconsistent
slashiness, e.g. `../..\v8/include\v8-internal.h` when [building
chromium](https://g-issues.chromium.org/issues/425364464).

We can match this using the current syntax using this ugly kludge:
`src:*{/,\\}v8{/,\\}*`. However, since the format is explicitly for
listing file paths, it makes sense to treat `/` as denoting a path
separator rather than a literal forward slash. This allows us to write
the much more natural form `src:*/v8/*` and have it work on any
platform.

This is technically a behavior change, but it seems very unlikely to
come up in practice. It will only make a difference if a user has a

    [16 lines not shown]
DeltaFile
+35-0clang/unittests/Basic/DiagnosticTest.cpp
+25-6llvm/lib/Support/SpecialCaseList.cpp
+20-0llvm/unittests/Support/SpecialCaseListTest.cpp
+12-0clang/docs/SanitizerSpecialCaseList.rst
+5-0clang/docs/ReleaseNotes.rst
+97-65 files

LLVM/project 2a811dellvm/include/llvm/Analysis HashRecognize.h, llvm/lib/Analysis HashRecognize.cpp

[HashRecognize] Rename ByteOrderSwapped to IsBigEndian (NFC) (#206243)

In order to avoid talking about bit-endianness versus byte-endianness,
rename ByteOrderSwapped to IsBigEndian, which is algorithm-agnostic. In
fact, CRC is a bitwise-algorithm, and hence the bit order is reversed.
DeltaFile
+27-28llvm/lib/Analysis/HashRecognize.cpp
+6-7llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+5-4llvm/include/llvm/Analysis/HashRecognize.h
+38-393 files

LLVM/project 6568c95llvm/lib/Transforms/Vectorize VPlanUtils.cpp, llvm/test/Transforms/LoopVectorize/VPlan/X86 scalarize-wide-load-for-address-use.ll

[VPlan] Skip VPInst where mask is only operand in chain in isUsed (NFC) (#206286)

Update isUsedByLoadStoreAddress o skip VPInstruction where the operand
in the use chain is only used as mask. Those do not contribute to the
load address, so should not force scalarization.

Fixes a regression with f2459f9e
(https://github.com/llvm/llvm-project/pull/196842).
DeltaFile
+7-3llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+4-3llvm/test/Transforms/LoopVectorize/VPlan/X86/scalarize-wide-load-for-address-use.ll
+11-62 files

LLVM/project 6a85214llvm/lib/Target/X86 X86TargetVerifier.cpp X86.h

[X86] Add target verifier

Add an X86 TargetVerify and register it by triple so the
TargetVerifierPass dispatches to it for X86 modules. It performs no
checks yet; the subtarget-dependent checks are added in a follow-up.
DeltaFile
+43-0llvm/lib/Target/X86/X86TargetVerifier.cpp
+6-0llvm/lib/Target/X86/X86.h
+6-0llvm/lib/Target/X86/X86TargetMachine.cpp
+1-0llvm/lib/Target/X86/CMakeLists.txt
+56-04 files

LLVM/project b33de64llvm/include/llvm/Target TargetVerifier.h, llvm/lib/Passes PassBuilder.cpp PassRegistry.def

[Target] Add target-independent TargetVerifier dispatcher

Introduce a target-dependent IR verification framework that can be run
from target-independent locations.

TargetVerify is a base class each backend subclasses to check a function
for constructs that are invalid for a particular target. Backends
register a factory keyed by Triple::ArchType via registerTargetVerify(),
typically from their LLVMInitialize<Target>Target().

TargetVerifierPass (registered as "target-verifier") is the dispatcher:
it reads the module triple and, if a verifier is registered for that
architecture, runs the generic IR verifier followed by the target's
TargetVerify. It is a no-op for targets that have not registered a
verifier, so it is safe to schedule from generic, target-independent
pipelines (e.g. `opt -passes=target-verifier`).
DeltaFile
+134-0llvm/include/llvm/Target/TargetVerifier.h
+82-0llvm/lib/Target/TargetVerifier.cpp
+1-0llvm/lib/Target/CMakeLists.txt
+1-0llvm/lib/Passes/PassBuilder.cpp
+1-0llvm/lib/Passes/PassRegistry.def
+219-05 files

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

[VPlan] Drop dead CostCtx/Range arg sfrom getScaledReductions (NFC) (#206285)

Neither parameter is referenced; the cost-checking they described moved
to createPartialReductions. Also remove the stale comment.
DeltaFile
+2-6llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+2-61 files

LLVM/project 7ee4111llvm/test/Transforms/LoopVectorize/VPlan/X86 scalarize-wide-load-for-address-use.ll

[LV] Add test for over-eager load scalarization (NFC). (#206283)

Add test showing over-eager load scalarization after f2459f9e
(https://github.com/llvm/llvm-project/pull/196842), when a load is only
used as mask of another load.
DeltaFile
+71-0llvm/test/Transforms/LoopVectorize/VPlan/X86/scalarize-wide-load-for-address-use.ll
+71-01 files

LLVM/project 631cb35.github/workflows merged-prs.yml

workflows/merged-prs: Use github-automation container (#206151)
DeltaFile
+3-14.github/workflows/merged-prs.yml
+3-141 files

LLVM/project 5971a0dllvm/test/CodeGen/DirectX strip-debug-info.ll

[DirectX] Test stripping debug info for DirectX (#206261)

Test that all debug info is stripped after changes in #201336.
Merging this PR to main instead of the stacked #204874.
DeltaFile
+92-0llvm/test/CodeGen/DirectX/strip-debug-info.ll
+92-01 files

LLVM/project b2fe1daclang/docs LibASTMatchersReference.html, clang/docs/tools dump_ast_matchers.py

[ASTMatchers][Docs] make dump_ast_matchers.py read classes from sources (#203784)

With this change, `dump_ast_matchers.py` script no longer need to probe
network to search for classes.
This allows the script to run offline which is needed for
https://github.com/llvm/llvm-project/pull/165472.
The script now operates on assumption that all classes in AST/ will be
here: https://llvm.org/doxygen/ (which is true in general unless doxygen
page is down)
DeltaFile
+299-124clang/docs/LibASTMatchersReference.html
+32-35clang/docs/tools/dump_ast_matchers.py
+331-1592 files

LLVM/project a02ef60llvm/include/llvm/Support Allocator.h, llvm/test/tools/llubi undef.ll unsupported_constant.ll

[llubi] Add support for undef values (#205602)

Although we are planning to deprecate the undef value, it is still
widely used in the intermediate results of the pipeline, which blocks
the pass bisection. This patch uses `freeze poison` as a refinement of
undef.

Note that the undef value evaluates to different values each time the
user is executed. So it cannot be cached like other constants. A
temporary buffer is introduced to take ownership of these values and
avoid breaking the interface (although this is a bit ugly...). This will
also be used by a follow-up patch for ptrtoint/inttoptr.

From my experience, it is enough for test case reduction of middle-end
miscompilation bugs (there are still counterexamples like
https://github.com/dtcxzyw/llvm-autoreduce/issues/61). However, when
processing backend miscompilation bugs, lli typically uses a garbage
value, so that llvm-reduce may produce an invalid result. I think we may
need to introduce two flags to migrate this issue: one for poisoning

    [5 lines not shown]
DeltaFile
+97-51llvm/tools/llubi/lib/Context.cpp
+35-0llvm/test/tools/llubi/undef.ll
+23-4llvm/tools/llubi/lib/Context.h
+0-12llvm/test/tools/llubi/unsupported_constant.ll
+2-0llvm/include/llvm/Support/Allocator.h
+1-0llvm/tools/llubi/lib/Interpreter.cpp
+158-676 files

LLVM/project fe1fc78llvm/include/llvm/ADT SmallVector.h

[SmallVector] Out-of-line the trivially-copyable push_back grow path (#206213)

In the approximately trivially-copyable specialization, push_back's grow
path does not early return. Both Clang and GCC likely keep `this` and
`Elt` live across the out-of-line `grow_pod` call, saving and restoring
them in the prologue/epilogue. Shrink wrapping can't sink it (the saved
values are used in the store block the fast path also reaches).

Move the grow-and-store into a noinline `growAndPushBack` helper and
tail call it. The fast path needs no callee-saved registers.
`push_back(int)` drops from 14 to 7 instructions on x86-64.

```
// void vec_pb_int(llvm::SmallVectorImpl<int>&v, int x){ v.push_back(x); }

        mov     eax, dword ptr [rdi + 8]
        cmp     eax, dword ptr [rdi + 12]
        jae     _ZN4llvm23SmallVectorTemplateBaseIiLb1EE15growAndPushBackEi # TAILCALL
        mov     rcx, qword ptr [rdi]

    [12 lines not shown]
DeltaFile
+13-2llvm/include/llvm/ADT/SmallVector.h
+13-21 files

LLVM/project c6b0a8dlibcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members get_long_double_zh_CN.pass.cpp, libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members put_long_double_zh_CN.pass.cpp

[libc++][FreeBSD] Fix localization test on FreeBSD (#186066)

Some ifdefs are missing so that we try to add it back and allow test to
run.
DeltaFile
+20-22libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp
+12-14libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_zh_CN.pass.cpp
+2-4libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp
+2-4libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
+2-4libcxx/test/std/localization/locale.categories/facet.numpunct/locale.numpunct.byname/thousands_sep.pass.cpp
+1-3libcxx/test/std/localization/locale.categories/category.time/locale.time.put.byname/put1.pass.cpp
+39-513 files not shown
+43-579 files

LLVM/project d02dbafllvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn build] Port 78af5e2b68da (#206268)
DeltaFile
+3-4llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+3-41 files

LLVM/project cb962bellvm/utils/gn/secondary/lldb/source/Core BUILD.gn, llvm/utils/gn/secondary/lldb/source/Utility BUILD.gn

[gn build] Port 2ceab13545c2 (#206267)
DeltaFile
+0-1llvm/utils/gn/secondary/lldb/source/Utility/BUILD.gn
+1-0llvm/utils/gn/secondary/lldb/source/Core/BUILD.gn
+1-12 files

LLVM/project e35ef5cllvm/utils/gn/secondary/llvm/lib/Target/Hexagon BUILD.gn

[gn build] Port 1485386b78dc (#206266)
DeltaFile
+2-0llvm/utils/gn/secondary/llvm/lib/Target/Hexagon/BUILD.gn
+2-01 files

LLVM/project 3ad436ellvm/utils/gn/secondary/lldb/source/Host BUILD.gn

[gn] port 049448403c7b (#206265)
DeltaFile
+3-1llvm/utils/gn/secondary/lldb/source/Host/BUILD.gn
+3-11 files

LLVM/project f99a584bolt/test/X86 infer_no_exits.test

[BOLT] Work around BSD sed's lack of in-place editing support (#206183)

BSD sed does not implement `-i` the same way as GNU sed. Use a
copy-and-replace approach instead of in-place editing to ensure
compatibility.
DeltaFile
+2-1bolt/test/X86/infer_no_exits.test
+2-11 files

LLVM/project d7b8c61llvm/utils/gn/secondary/libcxx/include BUILD.gn

[gn] use `sources` instead of `inputs` for libc++ header copy action (#206263)

`sources` and `inputs` have the same semantics for GN action targets,
but the sync script can only handle `sources`.

Follow-up to cd98648925531663.
DeltaFile
+2-2llvm/utils/gn/secondary/libcxx/include/BUILD.gn
+2-21 files

LLVM/project 3992e30libcxx/include/__random random_device.h

[libc++][NFC] Mark random_device::__padding_ as [[maybe_unused]] (#206248)

Instead of pushing and popping warnings we can just mark the offending
member as `[[maybe_unused]]`, improving compile times a bit and
simplifying the code.
DeltaFile
+1-5libcxx/include/__random/random_device.h
+1-51 files

LLVM/project b61a41cllvm/lib/Support GlobPattern.cpp, llvm/lib/Target/RISCV/AsmParser RISCVAsmParser.cpp

Merge branch 'main' into revert-205399-revert-149886-slashy
DeltaFile
+1,129-0llvm/test/CodeGen/X86/vector-reduce-add-subvector.ll
+43-71llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+62-0llvm/unittests/Support/GlobPatternTest.cpp
+37-14llvm/lib/Support/GlobPattern.cpp
+16-21llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+6-12llvm/test/Transforms/InstCombine/and-fcmp.ll
+1,293-1189 files not shown
+1,333-16215 files

LLVM/project ad35cfellvm/lib/Transforms/AggressiveInstCombine AggressiveInstCombine.cpp

[AggressiveInstCombine] Factor out the beginning of foldSelectSplitCTTZ/CTLZ into common entry point. NFC (#206220)

Both start by matching a select and a eq/ne compare with 0.

Assisted-by: claude
DeltaFile
+43-71llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
+43-711 files

LLVM/project 1210e04llvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer non-power-of-2-buildvector.ll

[SLP] Allow non-power-of-2 VF in tryToVectorizeList
DeltaFile
+92-0llvm/test/Transforms/SLPVectorizer/non-power-of-2-buildvector.ll
+6-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+98-12 files