LLVM/project 410d635clang/lib/AST ExprClassification.cpp, clang/lib/Sema TreeTransform.h

[Sema] Avoid an undesired pack expansion while transforming PackIndexingType (#90195)

A pack indexing type can appear in a larger pack expansion, e.g
`Pack...[pack_of_indexes]...` so we need to temporarily disable
substitution of pack elements.

Besides, this patch also fixes an assertion failure in
`PackIndexingExpr::classify`: dependent `PackIndexingExpr`s are always
LValues and thus we don't need to consider their `IndexExpr`s.

Fixes https://github.com/llvm/llvm-project/issues/88925

---------

Co-authored-by: cor3ntin <corentinjabot at gmail.com>
DeltaFile
+34-0clang/test/SemaCXX/cxx2c-pack-indexing.cpp
+6-1clang/lib/AST/ExprClassification.cpp
+4-0clang/lib/Sema/TreeTransform.h
+44-13 files

LLVM/project 306ae14flang/include/flang/Common Fortran.h, flang/lib/Common Fortran.cpp

Revert "[flang][cuda] Update attribute compatibily check for unified matching rule" (#90696)

Reverts llvm/llvm-project#90679
DeltaFile
+1-23flang/lib/Common/Fortran.cpp
+4-6flang/lib/Evaluate/characteristics.cpp
+0-9flang/test/Semantics/cuf13.cuf
+2-3flang/lib/Semantics/check-call.cpp
+2-2flang/include/flang/Common/Fortran.h
+9-435 files

LLVM/project 8e9b1e9clang/lib/Format UnwrappedLineParser.cpp, clang/unittests/Format TokenAnnotatorTest.cpp

[clang-format] Fix a bug in annotating struct braces (#90555)

Fixes #60040.
DeltaFile
+13-0clang/unittests/Format/TokenAnnotatorTest.cpp
+4-1clang/lib/Format/UnwrappedLineParser.cpp
+17-12 files

LLVM/project 86e5d6fflang/include/flang/Common Fortran.h, flang/lib/Common Fortran.cpp

[flang][cuda] Update attribute compatibily check for unified matching rule (#90679)

This patch updates the compatibility checks for CUDA attribute iin
preparation to implement the matching rules described in section 3.2.3.
We this patch the compiler will still emit an error when there is
multiple specific procedures that matches since the matching distances
is not yet implemented. This will be done in a separate patch.


https://docs.nvidia.com/hpc-sdk/archive/24.3/compilers/cuda-fortran-prog-guide/index.html#cfref-var-attr-unified-data

gpu=unified and gpu=managed are not part of this patch since these
options are not recognized by flang yet.
DeltaFile
+23-1flang/lib/Common/Fortran.cpp
+6-4flang/lib/Evaluate/characteristics.cpp
+9-0flang/test/Semantics/cuf13.cuf
+3-2flang/lib/Semantics/check-call.cpp
+2-2flang/include/flang/Common/Fortran.h
+43-95 files

LLVM/project ef1dbcdllvm/lib/Support/Windows Signals.inc

[Windows] Restrict searchpath of dbghelp.dll to System32 (#90520)

LoadLibraryW will lookup dlls in user directories if its search path is
left unrestricted. This is a security vulnerability as one can name a
shared library the same as that of a system dll in order to run
arbitrary code when the shared library is loaded from the path in a user
directory. This change modifies it to only search within sys32 when
loading dbghelp.dll.
DeltaFile
+2-1llvm/lib/Support/Windows/Signals.inc
+2-11 files

LLVM/project 63a2969cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb mlir-support.cpp

[cross-project-tests] Update code to use mlir::cast (NFC)

/llvm-project/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp:41:16:
 error: 'cast' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
    VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f});
               ^
/llvm-project/llvm/../mlir/include/mlir/IR/Types.h:345:9: note: 'cast' has been explicitly marked deprecated here
U Type::cast() const {
        ^
/llvm-project/cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp:41:16:
 error: 'cast<mlir::ShapedType>' is deprecated: Use mlir::cast<U>() instead [-Werror,-Wdeprecated-declarations]
    VectorType.cast<mlir::ShapedType>(), llvm::ArrayRef<float>{2.0f, 3.0f});
               ^
/llvm-project/llvm/../mlir/include/mlir/IR/Types.h:112:5: note: 'cast<mlir::ShapedType>' has been explicitly marked deprecated here
  [[deprecated("Use mlir::cast<U>() instead")]]
    ^
2 errors generated.
DeltaFile
+1-1cross-project-tests/debuginfo-tests/llvm-prettyprinters/gdb/mlir-support.cpp
+1-11 files

LLVM/project b1b1bfaclang/test/CodeGenCoroutines coro-elide-thinlto.cpp

[Coroutines][Test] Only run coro-elide-thinlto under x86_64-linux (#90672)

Previous fix #90549 didn't completely address the Buildbot failures.
Some target may not recognize the target triple. This time, only run the
test under x86_64-linux.
DeltaFile
+1-0clang/test/CodeGenCoroutines/coro-elide-thinlto.cpp
+1-01 files

LLVM/project 986f832flang/include/flang/Optimizer/Dialect FIROps.td FIRTypes.td, flang/lib/Optimizer/CodeGen PreCGRewrite.cpp

[flang] Added fir.dummy_scope operation to preserve dummy arguments association. (#90642)

The new operation is just an abstract attribute that is attached to
[hl]fir.declare operations of dummy arguments of a subroutine.
Dummy arguments of the same subroutine refer to the same
fir.dummy_scope, so they can be recognized as such during FIR AliasAnalysis.
Note that the fir.dummy_scope must be specific to the runtime
instantiation of a subroutine, so any MLIR inlining/cloning should duplicate and
unique it vs using the same fir.dummy_scope for different runtime instantiations.
This is why I made it an operation rather than an attribute.
The new operation uses a write effect on DebuggingResource, same as
[hl]fir.declare, to avoid optimizing it away.
DeltaFile
+83-1flang/include/flang/Optimizer/Dialect/FIROps.td
+34-0flang/test/HLFIR/dummy_scope.fir
+34-0flang/test/Fir/dummy_scope.fir
+17-1flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
+11-0flang/include/flang/Optimizer/Dialect/FIRTypes.td
+10-0flang/test/HLFIR/declare-codegen.fir
+189-27 files not shown
+216-1113 files

LLVM/project 8cde1cfllvm/lib/CodeGen/AsmPrinter AsmPrinter.cpp, llvm/test lit.site.cfg.py.in CMakeLists.txt

[AIX] Add git revision to .file string (#88164)

If `LLVM_APPEND_VC_REV` is on, add the git revision to the `.file`
string. The revision can be set with `LLVM_FORCE_VC_REVISION`.

Before:
`.file  "git_revision.cpp",,"LLVM version 19.0.0git"`

After:
`.file  "git_revision.cpp",,"LLVM version 19.0.0git (LLVM_REVISION)"`
DeltaFile
+19-0llvm/test/CodeGen/PowerPC/lit.local.cfg
+12-0llvm/test/CodeGen/PowerPC/git_revision.ll
+8-4llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+2-0llvm/test/lit.site.cfg.py.in
+1-0llvm/test/CMakeLists.txt
+42-45 files

LLVM/project 2fdcc90llvm/lib/Transforms/Instrumentation MemorySanitizer.cpp

move debug counter back

Created using spr 1.3.4
DeltaFile
+7-7llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+7-71 files

LLVM/project 7cfab95llvm/lib/Transforms/Instrumentation MemorySanitizer.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.4
DeltaFile
+19-8llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+19-81 files

LLVM/project 75f7295mlir/lib/Dialect/Tensor/Transforms PackAndUnpackPatterns.cpp, mlir/test/Dialect/Tensor fold-into-pack-and-unpack.mlir

[mlir][Tensor] Fix unpack -> transpose folding pattern for padded unpacks (#90678)

Previously if the producer tensor.unpack op had "unpadding" semantics,
the folding pattern would construct a destination that does not match
with the result type of the transpose. Because both ops are DPS we can
just reuse the destination of the transpose.

Additionally cleans up a bunch of trailing whitespace in the test file.
DeltaFile
+85-58mlir/test/Dialect/Tensor/fold-into-pack-and-unpack.mlir
+3-6mlir/lib/Dialect/Tensor/Transforms/PackAndUnpackPatterns.cpp
+88-642 files

LLVM/project a03eeb0llvm/include/llvm/CodeGen SelectionDAG.h, llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp

[SelectionDAG][X86] Add a NoWrap flag to SelectionDAG::isAddLike. NFC (#90681)

If this flag is set, Xor will not be considered AddLike. If an Xor were
treated as an Add it may wrap. If we can prove there would be no carry out and
thus no wrap, the Xor would be turned into a disjoint Or by DAGCombine.

Use this new flag to fix a bug in X86 where an Xor is incorrectly being treated
as an NUWAdd.

Fixes #90668.
DeltaFile
+3-2llvm/include/llvm/CodeGen/SelectionDAG.h
+2-2llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+2-1llvm/test/CodeGen/X86/pr90668.ll
+1-1llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+8-64 files

LLVM/project 85f28cfflang/lib/Optimizer/Transforms DebugTypeGenerator.cpp

[flang] Fixed -g compilation issues caused by #90484. (#90683)

DeltaFile
+5-1flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+5-11 files

LLVM/project 0f628fdlldb/docs/use variable.rst, lldb/source/Core FormatEntity.cpp

Revert "[lldb] Support custom LLVM formatting for variables (#81196)"

This reverts commit 7a8d15e919dde70118dbfa34e927be1705ded67d.
DeltaFile
+10-60lldb/source/Core/FormatEntity.cpp
+0-20lldb/test/API/functionalities/data-formatter/custom-printf-summary/TestCustomSummaryLLVMFormat.py
+0-13lldb/test/API/functionalities/data-formatter/custom-printf-summary/main.c
+0-9lldb/docs/use/variable.rst
+0-2lldb/test/API/functionalities/data-formatter/custom-printf-summary/Makefile
+10-1045 files

LLVM/project 278774eclang/include/clang/Basic DiagnosticInstallAPIKinds.td, clang/include/clang/InstallAPI FileList.h

[InstallAPI] Cleanup I/O error handling for input lists (#90664)

Add validation in the FileList reader to check that the headers exist and use similar diagnostics in Options.cpp
DeltaFile
+9-1clang/lib/InstallAPI/FileList.cpp
+5-4clang/tools/clang-installapi/Options.cpp
+2-1clang/include/clang/InstallAPI/FileList.h
+1-1clang/include/clang/Basic/DiagnosticInstallAPIKinds.td
+17-74 files

LLVM/project a96b044llvm/lib/Target/AArch64 AArch64InstrInfo.td, llvm/test/CodeGen/AArch64 arm64-vabs.ll

[AArch64] Remove invalid uabdl patterns. (#89272)

These were added in https://reviews.llvm.org/D14208, which look like
they attempt to detect abs from xor+add+ashr. They do not appear to be
detecting the correct value for the src input though, which I think is
intended to be the sub(zext, zext) part of the pattern. We have pattens
from abs now, so the old invalid patterns can be removed.

Fixes #88784

(cherry picked from commit 851462fcaa7f6e3301865de84f98be7e872e64b6)
DeltaFile
+48-0llvm/test/CodeGen/AArch64/arm64-vabs.ll
+0-10llvm/lib/Target/AArch64/AArch64InstrInfo.td
+48-102 files

LLVM/project 2647bd7llvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV pr90652.ll

[RISCV][ISel] Fix types in `tryFoldSelectIntoOp` (#90659)

```
SelectionDAG has 17 nodes:
  t0: ch,glue = EntryToken
    t6: i64,ch = CopyFromReg t0, Register:i64 %2
  t8: i1 = truncate t6
          t4: i64,ch = CopyFromReg t0, Register:i64 %1
        t7: i1 = truncate t4
            t2: i64,ch = CopyFromReg t0, Register:i64 %0
          t10: i64,i1 = saddo t2, Constant:i64<1>
        t11: i1 = or t8, t10:1
      t12: i1 = select t7, t8, t11
    t13: i64 = any_extend t12
  t15: ch,glue = CopyToReg t0, Register:i64 $x10, t13
  t16: ch = RISCVISD::RET_GLUE t15, Register:i64 $x10, t15:1
```

`OtherOpVT` should be i1, but `OtherOp->getValueType(0)` returns `i64`,

    [2 lines not shown]
DeltaFile
+19-0llvm/test/CodeGen/RISCV/pr90652.ll
+1-1llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+20-12 files

LLVM/project 805f01fllvm/test/CodeGen/X86 pr90668.ll pr90688.ll

[X86] Rename test to correct bug number. NFC

I accidentally named it pr90688 instead of pr90668.
DeltaFile
+15-0llvm/test/CodeGen/X86/pr90668.ll
+0-15llvm/test/CodeGen/X86/pr90688.ll
+15-152 files

LLVM/project d688162llvm/test/CodeGen/X86 pr90688.ll

[X86] Pre-commit test for pr90668. NFC
DeltaFile
+15-0llvm/test/CodeGen/X86/pr90688.ll
+15-01 files

LLVM/project 805e08ebolt/lib/Rewrite LinuxKernelRewriter.cpp

[BOLT] Fix a warning

This patch fixes:

  bolt/lib/Rewrite/LinuxKernelRewriter.cpp:855:12: error: variable
  'PrevIP' set but not used [-Werror,-Wunused-but-set-variable]
DeltaFile
+1-0bolt/lib/Rewrite/LinuxKernelRewriter.cpp
+1-01 files

LLVM/project cd7a7a5libc/config/baremetal api.td, libc/config/linux api.td

Add basic char*_t support for libc (partial WG14 N2653) (#90360)

This PR implements a part of WG14 N2653:
 - Define C23 char8_t
 - Define C11 char16_t
 - Define C11 char32_t
 
 Missing goals are:
- The type of UTF-8 character literals is changed from unsigned char to
char8_t. (Since UTF-8 character literals already have type unsigned
char, this is not a semantic change).
- New mbrtoc8() and c8rtomb() functions declared in <uchar.h> enable
conversions between multibyte characters and UTF-8.
    - A new ATOMIC_CHAR8_T_LOCK_FREE macro.
    - A new atomic_char8_t typedef name.
DeltaFile
+17-0libc/include/llvm-libc-types/char16_t.h
+17-0libc/include/llvm-libc-types/char32_t.h
+17-0libc/include/llvm-libc-types/char8_t.h
+15-0libc/include/llvm-libc-types/CMakeLists.txt
+9-0libc/config/linux/api.td
+6-1libc/config/baremetal/api.td
+81-18 files not shown
+97-214 files

LLVM/project 89f8335flang/lib/Common Fortran.cpp, flang/test/Semantics cuf13.cuf

[flang][cuda] Allow PINNED argument to host dummy (#90651)

Update the `AreCompatibleCUDADataAttrs` function to return true when one
argument has the `PINNED` attribute and the other argument is just host
data.
DeltaFile
+28-0flang/test/Semantics/cuf13.cuf
+3-0flang/lib/Common/Fortran.cpp
+31-02 files

LLVM/project fb85a28clang/docs UsersManual.rst, clang/lib/Driver/ToolChains Clang.cpp

Fix -fno-unsafe-math-optimizations behavior (#89473)

This changes the handling of -fno-unsafe-fp-math to stop having that
option imply -ftrapping-math. In gcc, -fno-unsafe-math-optimizations
sets -ftrapping-math, but that dependency is based on the fact the
-ftrapping-math is enabled by default in gcc. Because clang does not
enable -ftrapping-math by default, there is no reason for
-fno-unsafe-math-optimizations to set it.

On the other hand, -funsafe-math-optimizations continues to imply
-fno-trapping-math because this option necessarily disables strict
exception semantics.

This fixes https://github.com/llvm/llvm-project/issues/87523
DeltaFile
+3-4clang/test/Driver/fast-math.c
+0-2clang/lib/Driver/ToolChains/Clang.cpp
+0-1clang/docs/UsersManual.rst
+3-73 files

LLVM/project 51aac5bllvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[SLP][NFCI]Improve compile time for phis with large number of incoming values.

Added a limit of 128 incoming values at max for PHIs nodes to be
vectorized plus improved performance by using logarithmic search instead
of linear if the number of incoming values is > 4.
DeltaFile
+93-20llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+93-201 files

LLVM/project 19f4d68llvm/include/llvm/CodeGen/GlobalISel LoadStoreOpt.h, llvm/lib/CodeGen/GlobalISel LoadStoreOpt.cpp

[GlobalISel] Fix store merging incorrectly classifying an unknown index expr as 0. (#90375)

During analysis, we incorrectly leave the offset part of an address info
struct
as zero, when in actual fact we failed to decompose it into base +
offset.
This results in incorrectly assuming that the address is adjacent to
another store
addr. To fix this we wrap the offset in an optional<> so we can
distinguish between
real zero and unknown.

Fixes issue #90242
DeltaFile
+52-10llvm/test/CodeGen/AArch64/GlobalISel/store-merging.mir
+28-20llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+16-4llvm/include/llvm/CodeGen/GlobalISel/LoadStoreOpt.h
+19-0llvm/test/CodeGen/AArch64/GlobalISel/store-merging.ll
+115-344 files

LLVM/project ecec131flang/include/flang/Optimizer/Builder/Runtime Main.h, flang/lib/Lower Bridge.cpp

[flang] Remove double pointer indirection for _QQEnvironmentDefaults (#90615)

A double pointer was being passed to the call to FortranStart rather than just a pointer to the EnvironmentDefaults.list. This now passes `null` directly when there's no EnvironmentDefaults.list and passes the list directly when there is, removing the original global variable which was a pointer to a pointer containing null or the EnvironmentDefaults.list global.

Fixes #90537
DeltaFile
+6-15flang/lib/Optimizer/Builder/Runtime/EnvironmentDefaults.cpp
+12-5flang/lib/Optimizer/Builder/Runtime/Main.cpp
+3-14flang/lib/Lower/Bridge.cpp
+5-4flang/test/Lower/environment-defaults.f90
+2-6flang/test/Driver/emit-mlir.f90
+4-2flang/include/flang/Optimizer/Builder/Runtime/Main.h
+32-462 files not shown
+37-508 files

LLVM/project f89e557libcxx/include string

@philnik777 proposal
DeltaFile
+2-2libcxx/include/string
+2-21 files

LLVM/project 0232b77clang/test/CodeGenCoroutines coro-elide-thinlto.cpp

[Coroutines][Test] Specify target triple in coro-elide-thinlto  (#90549)

Resolve test failure on non-x86 linux host
DeltaFile
+1-1clang/test/CodeGenCoroutines/coro-elide-thinlto.cpp
+1-11 files

LLVM/project c665e49bolt/lib/Rewrite LinuxKernelRewriter.cpp

[BOLT] Add ORC validation for the Linux kernel (#90660)

The Linux kernel expects ORC tables to be sorted by IP address (for
binary search to work). Add a post-emit pass in LinuxKernelRewriter that
validates the written .orc_unwind_ip against that expectation.
DeltaFile
+31-0bolt/lib/Rewrite/LinuxKernelRewriter.cpp
+31-01 files