LLVM/project 0b6cd1amlir/include/mlir/Dialect/LLVMIR LLVMOps.td, mlir/lib/Dialect/LLVMIR/IR LLVMDialect.cpp

[mlir][LLVM] Add support for `ptrtoaddr`

The `ptrtoaddr` op is akin to `ptrtoint` with some important differences:
* It does not capture the provenance of the pointer, meaning a pointer does not escape and subsequent `inttoptr` don't make a legal pointer. LLVM can then assume the pointer never escaped, which helps alias analysis.
* It does not support arbitrary integer types, but only exactly the integer type that is equal in width to the pointer type as specified by the data layout.

This PR adds the op the MLIR dialect and adds the corresponding verification for the datalayout property.
DeltaFile
+18-0mlir/test/Dialect/LLVMIR/invalid.mlir
+15-0mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
+9-0mlir/test/Target/LLVMIR/llvmir.mlir
+8-0mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
+2-0mlir/test/Dialect/LLVMIR/roundtrip.mlir
+2-0mlir/test/Target/LLVMIR/Import/instructions.ll
+54-06 files

LLVM/project a99d4a6mlir/lib/Tools/mlir-reduce MlirReduceMain.cpp

[mlir][reducer] Add split-input-file to mlir-reduce (#184970)

The tests for mlir-reduce are currently scattered. To centralize the
tests for mlir-reduce, I added the split-input-file feature to
mlir-reduce.It is part of
https://github.com/llvm/llvm-project/pull/184974.
DeltaFile
+43-30mlir/lib/Tools/mlir-reduce/MlirReduceMain.cpp
+43-301 files

LLVM/project ae4e712llvm/lib/Target/WebAssembly/AsmParser WebAssemblyAsmParser.cpp, llvm/lib/Target/WebAssembly/MCTargetDesc WebAssemblyTargetStreamer.cpp

[MC][WebAssembly] Allow strings for import modules and names in asm (#182896)

Current tooling for the WebAssembly component model uses import modules
and names such as `$root` and `[thread-index]`. Importing these from
assembly files requires support for non-valid identifiers in
`.import_name` and `.import_module` directives. This PR adds support for
specifying those as strings, e.g.:

```asm
        .import_module __wasm_component_model_builtin_thread_index, "$root"
        .import_name __wasm_component_model_builtin_thread_index, "[thread-index]"
```
DeltaFile
+46-1llvm/test/MC/WebAssembly/export-name.s
+44-2llvm/test/MC/WebAssembly/import-module.s
+18-3llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
+4-6llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyTargetStreamer.cpp
+4-4llvm/test/CodeGen/WebAssembly/lower-em-ehsjlj-options.ll
+4-1llvm/test/MC/WebAssembly/export-name-invalid.s
+120-174 files not shown
+132-2310 files

LLVM/project eada0f5clang-tools-extra/clang-doc/assets head-template.mustache clang-doc-mustache.css, clang-tools-extra/test/clang-doc basic-project.mustache.test

[clang-doc] Add button toggle for light/dark theme (#181587)

The user can now manually toggle the light or dark theme instead of
waiting for the system theme to change.

Also fixes a typo that caused some overflow issues even when there was
no content to cause an overflow.
DeltaFile
+42-2clang-tools-extra/clang-doc/assets/head-template.mustache
+8-4clang-tools-extra/test/clang-doc/basic-project.mustache.test
+9-1clang-tools-extra/clang-doc/assets/clang-doc-mustache.css
+10-0clang-tools-extra/clang-doc/assets/navbar-template.mustache
+69-74 files

LLVM/project 4d53c42compiler-rt/lib/builtins CMakeLists.txt

builtins: Make cmake formatting self-consistent aftr #183871

No behavior change.
DeltaFile
+4-2compiler-rt/lib/builtins/CMakeLists.txt
+4-21 files

LLVM/project 38459f3llvm/test/tools/llubi loadstore_le.ll loadstore_be.ll, llvm/tools/llubi/lib Context.cpp Interpreter.cpp

Revert "[llubi] Add support for load/store/lifetime markers (#182532)"

This reverts commit 0311bb623a1e1bd101e517cfde4538039f65aa24.
DeltaFile
+32-303llvm/tools/llubi/lib/Context.cpp
+0-192llvm/test/tools/llubi/loadstore_le.ll
+0-190llvm/test/tools/llubi/loadstore_be.ll
+8-127llvm/tools/llubi/lib/Interpreter.cpp
+17-46llvm/tools/llubi/lib/Value.h
+4-42llvm/tools/llubi/lib/Context.h
+61-9009 files not shown
+65-1,04815 files

LLVM/project 337fed3clang/lib/CodeGen CGExprAgg.cpp, clang/test/CodeGenHIP sret-nontrivial-copyable.hip

[Clang] Fix EmitAggregateCopy assertion for non-trivially-copyable sr… (#185091)

…et types

Fix for buildbot crash on #183639
The UseTemp path in AggExprEmitter::withReturnValueSlot copies back via
EmitAggregateCopy, which asserts that the type has a trivial copy/move
constructor or assignment operator. Gate the DestASMismatch condition on
isTriviallyCopyableType so that non-trivially-copyable types (e.g.
std::exception_ptr) fall through to the addrspacecast path instead.

Fix buildbot crash:
https://lab.llvm.org/buildbot/#/builders/73/builds/19803
DeltaFile
+34-0clang/test/CodeGenHIP/sret-nontrivial-copyable.hip
+7-6clang/lib/CodeGen/CGExprAgg.cpp
+2-2clang/test/OpenMP/amdgcn_sret_ctor.cpp
+43-83 files

LLVM/project bdec4dallvm/lib/Target/RISCV RISCVISelLowering.cpp RISCVInstrInfoP.td, llvm/test/CodeGen/RISCV rvp-ext-rv64.ll rvp-ext-rv32.ll

[RISCV][P-ext] Only support sshlsat for splat immediate shift amounts. (#184886)

Fixes cannot select errors for other types of shift amounts.

I've made a new RISCVISD node that only allows an immediate operand.
It's assumed that the lowering code will only allow valid immediates so
I'm not using a TImmLeaf in the match.
DeltaFile
+117-9llvm/test/CodeGen/RISCV/rvp-ext-rv64.ll
+90-6llvm/test/CodeGen/RISCV/rvp-ext-rv32.ll
+15-1llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+5-4llvm/lib/Target/RISCV/RISCVInstrInfoP.td
+227-204 files

LLVM/project d6f2ea4llvm/docs/TableGen ProgRef.rst, llvm/lib/TableGen TGParser.cpp TGParser.h

[TableGen] Add let append/prepend syntax for field concatenation
DeltaFile
+224-0llvm/test/TableGen/let-append.td
+91-14llvm/lib/TableGen/TGParser.cpp
+63-0llvm/test/TableGen/let-append-toplevel.td
+45-2llvm/docs/TableGen/ProgRef.rst
+22-4llvm/lib/TableGen/TGParser.h
+12-0llvm/test/TableGen/let-prepend-error.td
+457-202 files not shown
+481-208 files

LLVM/project 5230955flang/include/flang/Optimizer/Builder IntrinsicCall.h, flang/lib/Optimizer/Builder IntrinsicCall.cpp

[flang,acc] Support -ffp-maxmin-behavior option in lowering. (#184730)

This patch adds `flang -fc1` option `-ffp-maxmin-behavior` and
propagates it throughout Flang, so that semantics context,
lowering and the pass pipeline builder can use it.

MAX/MIN intrinsic and OpenACC max/min reduction lowering
are now controlled by the option.

I kept the `Legacy` mode, which is the default and matches the current
behavior. I am going to test and merge a follow-up patch that
replaces `Legacy` with `Portable`.

RFC:
https://discourse.llvm.org/t/flang-canonical-and-optimizable-representation-for-min-max/90037
DeltaFile
+64-67flang/lib/Optimizer/Builder/IntrinsicCall.cpp
+114-0flang/test/Lower/OpenACC/acc-reduction-maxmin.f90
+63-9mlir/include/mlir/Dialect/OpenACC/OpenACCOps.td
+52-0flang/test/Lower/fp-maxmin-behavior.f90
+46-0mlir/test/Dialect/OpenACC/ops.mlir
+1-44flang/include/flang/Optimizer/Builder/IntrinsicCall.h
+340-12024 files not shown
+605-15130 files

LLVM/project 4b072b7clang/lib/CodeGen/TargetBuiltins AMDGPU.cpp, clang/test/CodeGen amdgpu-abi-version.c

clang/AMDGPU: Fix workgroup size builtins for nonuniform work group sizes

These were assuming uniform work group sizes. Emit the v4 and v5 sequences
to take the remainder group for the nonuniform case.

Currently the device libs uses this builtin on the legacy ABI path with
the same sequence to calculate the remainder, and fully implements the v5
path. If you perform a franken-build of the library with the updated builtin,
the result is worse. The duplicate sequence does not fully fold out. However,
it does not appear to be wrong. The relevant conformance tests still pass.
DeltaFile
+627-0clang/test/CodeGenOpenCL/builtins-amdgcn-workgroup-size.cl
+123-36clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+100-16clang/test/CodeGenCUDA/amdgpu-workgroup-size.cu
+60-30clang/test/Headers/gpuintrin.c
+35-15clang/test/CodeGen/amdgpu-abi-version.c
+0-19clang/test/CodeGenOpenCL/builtins-amdgcn.cl
+945-1166 files

LLVM/project a8783dclldb/test/Shell/ScriptInterpreter/Python bytecode.test

[lldb][bytecode] Disable bytecode.test on windows (#185096)

The test is failing on the lldb-x86_64-win buildbot.
DeltaFile
+1-0lldb/test/Shell/ScriptInterpreter/Python/bytecode.test
+1-01 files

LLVM/project df783c5llvm/docs/TableGen ProgRef.rst, llvm/lib/TableGen TGParser.cpp TGParser.h

[TableGen] Add let append/prepend syntax for field concatenation
DeltaFile
+224-0llvm/test/TableGen/let-append.td
+91-14llvm/lib/TableGen/TGParser.cpp
+63-0llvm/test/TableGen/let-append-toplevel.td
+45-2llvm/docs/TableGen/ProgRef.rst
+22-4llvm/lib/TableGen/TGParser.h
+13-0llvm/test/TableGen/let-append-error.td
+458-202 files not shown
+483-208 files

LLVM/project 0d71610clang/test/CodeGenObjC expose-direct-method-visibility-linkage.m expose-direct-method-linkedlist.m

add darwin back
DeltaFile
+0-48clang/test/CodeGenObjC/expose-direct-method-visibility-linkage.m
+1-0clang/test/CodeGenObjC/expose-direct-method-linkedlist.m
+1-482 files

LLVM/project ab10f08clang/lib/CIR/CodeGen CIRGenFunction.cpp CIRGenVTables.cpp, clang/test/CIR/CodeGen thunks.cpp

[CIR] Fix a crash when source location is unknown (#185059)

When we call `getLoc()` with an invalid `SourceLocation` and
`currSrcLoc` is also invalid, we were crashing or asserting. I tracked
down one case where this was happening (generating an argument in a
vtable thunk) and fixed that to provide a location. I also am updating
the `getLoc()` implementation so that it will use an unknown location in
release builds rather than crashing because the location isn't critical
for correct compilation.
DeltaFile
+64-0clang/test/CIR/CodeGen/thunks.cpp
+12-4clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+2-2clang/lib/CIR/CodeGen/CIRGenVTables.cpp
+78-63 files

LLVM/project d32ffdeclang/docs ClangIRABILowering.md index.rst

[CIR] Add MLIR ABI Lowering design document

Design document for MLIR dialect-agnostic calling convention
lowering that builds on the LLVM ABI Lowering Library
(llvm/lib/ABI/) as the single source of truth for ABI
classification.  Dialects use the library via an adapter layer:
ABITypeMapper maps dialect types to abi::Type*, the library
classifies arguments and returns, and a dialect-specific
ABIRewriteContext applies the decisions back to IR operations.

Targets x86_64 and AArch64, with parity against Classic Clang
CodeGen validated through differential testing.
DeltaFile
+545-0clang/docs/ClangIRABILowering.md
+1-0clang/docs/index.rst
+546-02 files

LLVM/project 2cb01dcclang-tools-extra/clang-doc/benchmarks ClangDocBenchmark.cpp CMakeLists.txt

[clang-doc] Fix benchmark not compiling (#185065)

CI didn't flag that the benchmark was using the outdated Ctx call
when landing the Mustache MD patch since this benchmark isn't tested.
Also added missing libraries in CMake that prevented me from building
the benchmark locally.
DeltaFile
+2-2clang-tools-extra/clang-doc/benchmarks/ClangDocBenchmark.cpp
+2-0clang-tools-extra/clang-doc/benchmarks/CMakeLists.txt
+4-22 files

LLVM/project 918d0fellvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp, llvm/test/CodeGen/AMDGPU asyncmark-pregfx12.ll asyncmark-waitcnt.mir

[AMDGPU] fix asyncmark soft waitcnt bug (#184851)

Asyncmarks record the current wait state and so should not allow waitcnts that occur after them to be merged into waitcnts that occur before.
DeltaFile
+111-8llvm/test/CodeGen/AMDGPU/asyncmark-pregfx12.ll
+25-0llvm/test/CodeGen/AMDGPU/asyncmark-waitcnt.mir
+11-7llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+147-153 files

LLVM/project 097122cclang/lib/CodeGen CGExprCXX.cpp, clang/test/CodeGenCXX microsoft-abi-diamond-template-multiple-vbptrs.cpp

  [clang][CodeGen] Fix size calculation in vbptr split memory region in EmitNullBaseClassInitialization (#184558)

When splitting memory stores around multiple virtual base pointers
(vbptrs)
in the Microsoft ABI, the calculation for the size of the memory region
after
  each vbptr was incorrect.

The bug/old calculation: SplitAfterSize = LastStoreSize -
SplitAfterOffset
  This subtracts an absolute offset from a relative size, causing
  incorrect (too small) sizes after the second vbptr.
  
  The correct size should be:
  SplitAfterSize = (LastStoreOffset + LastStoreSize) - SplitAfterOffset

Since all store regions extend to the end of the non-virtual portion
(NVSize),
  this patch uses the simplified form: 

    [3 lines not shown]
DeltaFile
+122-0clang/test/CodeGenCXX/microsoft-abi-diamond-template-multiple-vbptrs.cpp
+1-2clang/lib/CodeGen/CGExprCXX.cpp
+123-22 files

LLVM/project 216a3f1utils/bazel/llvm-project-overlay/clang BUILD.bazel

[Bazel] Fixes 3da28bf (#185082)

This fixes 3da28bfbce4d7ac8eaea6b8489031d01748d4fc5.

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

LLVM/project 25e201bclang/test/CodeGenObjC expose-direct-method-cross-linkage.m

Address reviewer's concerns
DeltaFile
+0-174clang/test/CodeGenObjC/expose-direct-method-cross-linkage.m
+0-1741 files

LLVM/project 2065c7fllvm/test/Instrumentation/AddressSanitizer basic-msvc64.ll

clean up triple + arg
DeltaFile
+1-2llvm/test/Instrumentation/AddressSanitizer/basic-msvc64.ll
+1-21 files

LLVM/project 9cc615allvm/lib/Transforms/Scalar LoopFuse.cpp

[LoopFusion] remove else after return (NFC) (#184993)

A bit of a small nitpick, close it if unnecessary. (clang-tidy warnings)
DeltaFile
+2-4llvm/lib/Transforms/Scalar/LoopFuse.cpp
+2-41 files

LLVM/project f01f875clang/test/CodeGenObjC expose-direct-method.m expose-direct-method-varargs.m

Address reviewer's concerns
DeltaFile
+41-2clang/test/CodeGenObjC/expose-direct-method.m
+3-3clang/test/CodeGenObjC/expose-direct-method-varargs.m
+2-2clang/test/CodeGenObjC/expose-direct-method-linkedlist.m
+46-73 files

LLVM/project 57f1ec6compiler-rt/lib/builtins CMakeLists.txt

builtins: adjust FP80 source management (#183871)

We would previously include the FP80 sources into the Windows build if
we built with the GNU driver rather than the `cl` driver.
DeltaFile
+13-7compiler-rt/lib/builtins/CMakeLists.txt
+13-71 files

LLVM/project 7af05aeclang/lib/CodeGen ItaniumCXXABI.cpp, clang/test/DebugInfo/CXX ptrauth-member-function-pointer-debuglocs.cpp

[AArch64][PAC] Emit `!dbg` locations in `*_vfpthunk_` functions (#179688)

The usage of pointers to member functions with Pointer Authentication
requires generation of `*_vfpthunk_` functions. These thunk functions
can be later inlined and optimized by replacing the indirect call
instruction with a direct one and then inlining that function call.

In absence of `!dbg` metadata attached to the original call instruction,
such inlining ultimately results in an assertion "!dbg attachment points
at wrong subprogram for function" in the assertions-enabled builds. By
manually executing `opt` with `-verify-each` option on the LLVM IR
produced by the frontend, an actual issue can be observed: "inlinable
function call in a function with debug info must have a !dbg location"
after the replacement of indirect call instruction with the direct one
takes place.

This commit fixes the issue by attaching artificial `!dbg` locations to
the original call instruction (as well as most other instructions in
`*_vfpthunk_` function) the same way it is done for other

    [3 lines not shown]
DeltaFile
+39-0clang/test/DebugInfo/CXX/ptrauth-member-function-pointer-debuglocs.cpp
+4-0clang/lib/CodeGen/ItaniumCXXABI.cpp
+43-02 files

LLVM/project 0eb9577clang/lib/AST PrintfFormatString.cpp FormatString.cpp, clang/lib/Sema SemaChecking.cpp

add format string handling

(cherry picked from commit 20a6fdfe3045eebaf1acc4fff7269c66e85e10c3)
(cherry picked from commit f416afce1fda8733c693aaef3f15c8b099154c20)
DeltaFile
+241-164clang/lib/AST/PrintfFormatString.cpp
+128-118clang/lib/AST/FormatString.cpp
+104-51clang/lib/AST/ScanfFormatString.cpp
+40-36clang/lib/Sema/SemaChecking.cpp
+23-16clang/lib/AST/FormatStringParsing.h
+19-0llvm/lib/Support/TextEncoding.cpp
+555-38512 files not shown
+618-39718 files

LLVM/project 08cd2e9clang/include/clang/Basic TargetInfo.h, clang/lib/AST ASTContext.cpp

convert to exec-charset inside getPredefinedStringLiteralFromCache, test __builtin_FILE()

(cherry picked from commit 9e4f1d155064ed3cef04ce15df068ca906aa3c55)
DeltaFile
+28-0clang/test/CodeGen/systemz-charset.cpp
+10-0clang/lib/AST/ASTContext.cpp
+5-4clang/lib/Lex/TextEncodingConfig.cpp
+3-0clang/lib/Basic/TargetInfo.cpp
+2-0clang/include/clang/Basic/TargetInfo.h
+0-1llvm/include/llvm/Support/TextEncoding.h
+48-56 files

LLVM/project 3da28bfclang/include/clang/Basic Diagnostic.td, clang/lib/Basic DiagnosticIDs.cpp

[clang][diagnostics] Stable IDs for Clang diagnostics (#168153)

Part of the implementation of [[RFC] Emitting Auditable SARIF Logs from
Clang](https://discourse.llvm.org/t/rfc-emitting-auditable-sarif-logs-from-clang/88624)

SARIF diagnostics require that each rule have a stable `id` property to
identify that rule across runs, even when the compiler or analysis tool
has changed. We were previously setting the `id` property to the numeric
value of the enum value for that diagnostic within the Clang
implementation; this value changes whenever an unrelated diagnostic is
inserted or removed earlier in the list.

This change sets the `id` property to the _text_ of that same enum
value. This value would only change if someone renames the enum value
for that diagnostic, which should happen much less frequently than
renumbering.

For now, we will just assume that renaming happens infrequently enough
that existing consumers of SARIF will not notice. In the future, we

    [32 lines not shown]
DeltaFile
+424-0clang/test/Frontend/Inputs/expected-sarif/sarif-diagnostics.cpp.sarif
+144-1clang/utils/TableGen/ClangDiagnosticsEmitter.cpp
+72-4clang/lib/Basic/DiagnosticIDs.cpp
+76-0clang/test/Frontend/Inputs/expected-sarif/sarif-legacy-stable-ids.c.sarif
+5-45clang/test/Frontend/sarif-diagnostics.cpp
+21-0clang/include/clang/Basic/Diagnostic.td
+742-5016 files not shown
+821-8222 files

LLVM/project fe58a85clang/lib/Frontend VerifyDiagnosticConsumer.cpp, clang/lib/Interpreter IncrementalParser.cpp

[clang-repl] Create virtual files for `input_line_N` buffers (#182044)

Instead of using memory buffers without file backing, this patch
`input_line_N` buffers as virtual files.

This patch enables us to use input line numbers when verifying tests
`clang-repl`.

Co-authored-by: Vassil Vassilev <v.g.vassilev at gmail.com>
(cherry picked from commit 9cc0df99de853a3cdf778c0c33e4fb5050c46c5b)
DeltaFile
+20-4clang/lib/Frontend/VerifyDiagnosticConsumer.cpp
+16-0clang/test/Interpreter/verify-diagnostics.cpp
+11-2clang/lib/Interpreter/IncrementalParser.cpp
+47-63 files