565895 Commits

Author SHA1 Message Date
Endre Fülöp
d1e02cd31e
[clang-tidy] Improve readability-enum-initial-value diagnostic message (#176485)
Enhance the readability-enum-initial-value checker to list which
enumerators
are not initialized in notes. This makes it easier for users to identify
which
specific enumerators need explicit initialization.
2026-01-19 15:42:17 +01:00
Frank Schlimbach
d12019d5e5
[mlir][shard,mpi] lowering shard.all_slice in shard-to-mpi (#176438)
Lowering shard.all_slice in shard-to-mpi and reusing lowering for
shard.processmultindex.
2026-01-19 15:37:35 +01:00
Kerry McLaughlin
6c53fb5dfe
[AArch64] Remove redundant fmovs when bitcasting from ext/trunc of bitcast (#175983)
The following can be used to reinterpret & extend a float, returning the
result as a double with the upper bits cleared:
  return bit_cast<double>((uint64_t)bit_cast<uint32_t>(x))

this currently results in two fmovs being generated, i.e.
  fmov    w8, s0
  fmov    d0, x8
  ret

This patch adds a pattern to improve this by using a single `fmov s0, s0`
instead, and also for the case where the integer value is truncated.
2026-01-19 14:37:18 +00:00
Michael Buch
230f6ab1b8 [lldb][test] Add a test for evaluating Obj-C types with an incomplete super-class
LLDB currently crashes when the super-class of an Objective-C type can't
be completed (i.e., has no definition). For Foundation types such as
`NSObject`, the debug-info would usually only contain forward
declarations. The definitions live in the Clang module `.pcm` files. But
if the source of the definition fails to be loaded (e.g., if we just
delete the module cache), then we can no longer guarantee that the
super-class has a definition. This breaks a key Clang invariant, which
requires base-classes to have definitions by the time we try to lay them
out. This patch adds an XFAILed test for such scenario.

rdar://168440264
2026-01-19 14:34:46 +00:00
anoopkg6
fb953283af
[dfsan] Add dataflow sanitizer support for SystemZ (#168991)
Add SystemZ specific changes for dataflow sanitizer on top of following
two common code changes
i) Fix Endianness issue
[#162881](https://github.com/llvm/llvm-project/pull/162881)
ii) Fix ShadowAddress computation
[#162864](https://github.com/llvm/llvm-project/pull/162864[](url))

See conversation in original
pr#[#162195](https://github.com/llvm/llvm-project/pull/162195)
2026-01-19 15:28:34 +01:00
Ben Dunbobbin
31f5be4ce5
[DTLTO] Add DTLTO-specific LTO input handling time-trace scopes (#175799)
Add time-trace scopes to the DTLTO-specific input-handling code to
improve observability and debugging.

These scopes are tested via LLD, as the primary purpose of this code is
to support member files of non-thin archives as DTLTO inputs.
`llvm-lto2` does not currently support archives. Adding archive support
to `llvm-lto2` solely for testing these scopes does not appear to be
worthwhile.

As part of this change, the deletion of temporary DTLTO input files has
been moved. Cleanup now occurs after LTO has completed, rather than
during destruction of the LTO object. This is required since by the time
the LTO object is destroyed, time-traces have already been finalized, so
no additional trace data can be recorded.

Recording time-trace data for temporary file deletion is important, as
this has been a source of performance issues in the past and an area
where we expect to make further performance improvements if supported by
the data.

SIE internal tracker: TOOLCHAIN-21021
2026-01-19 14:06:58 +00:00
Utkarsh Saxena
777c7b85ff
[LifetimeSafety] Fix handling of reference-type DeclRefExpr (#176728)
Fix handling of reference-typed DeclRefExpr in lifetime analysis

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

This PR fixes a bug in the lifetime analysis where reference-typed DeclRefExpr nodes were incorrectly handled. The analysis was incorrectly removing the outer layer of origin for reference types, which led to missing some dangling reference warnings.

The fix adds a check to only remove the outer layer of origin when the declaration is not a reference type.
2026-01-19 14:55:47 +01:00
Nikita Popov
af7c10618b [BitcodeReader] Improve error messages
Avoid using "Invalid record" for all errors. At least mention
what kind of record it is.
2026-01-19 14:28:40 +01:00
Michael Buch
42764ec59b [lldb][test] TestFunctionTemplateParameterPack.py: XFAIL instead of skip
This test doesn't trigger an assertion on top-of-tree. Turn this into an
XFAIL instead.

Found this test because I'm working on improving parameter pack support
in the expression evaluator.
2026-01-19 13:27:27 +00:00
Charles Zablit
09b45640a7
Revert "[lldb] add a marker before hidden frames (#167550)" (#176747) 2026-01-19 13:14:50 +00:00
Ramkumar Ramachandra
302565b39e
[VPlan] Move VPDerivedIVRecipe::execute to VPlanRecipes (NFC) (#176577) 2026-01-19 13:06:37 +00:00
Ebuka Ezike
3ca7a72990
[lldb-dap] Fix Completions Request crash (#176211)
lldb-dap currently crashes when the first character is non ascii. This
is because we assume that the request column is ascii based instead of
UTF16 code units,
and end up in the middle of a character code point. causing an assertion
since we cannot not send invalid UTF-8 values.

This also handles the case in multilines and the column is outside the
range of the text.

Move completion description to the `CompletionItem.detail` property.
2026-01-19 12:57:03 +00:00
Simon Pilgrim
09efc282c2
[X86] clmul-vector.ll - add missing clmulr_v2i64 test coverage (#176743) 2026-01-19 12:52:53 +00:00
Simon Pilgrim
9b64509862
[X86] combine-pclmul.ll - add tests showing failure to merge shuffles into X86ISD::PCLMULQDQ node control mask (#176741) 2026-01-19 12:44:46 +00:00
Florian Hahn
5e5d6389f6
[LV] Allow loops with multiple early exits in legality checks. (#176403)
This patch removes the single uncountable exit constraint, allowing
loops with multiple early exits, if the exits form a dominance chain and
all other constraints hold for all uncountable early exits.

While legality now accepts such loops, vectorization is not yet
supported. VPlan support will be added in a follow up:
https://github.com/llvm/llvm-project/pull/174864

PR: https://github.com/llvm/llvm-project/pull/176403
2026-01-19 12:32:04 +00:00
Aryan Kadole
91291ac3d0
[DAG] Add ISD::CLMUL/H/R to isCommutativeBinOp (#176615)
Resolves #176351.
2026-01-19 12:27:20 +00:00
Utkarsh Saxena
41e231cae3
[LifetimeSafety] Read lifetimebound attribute on implicit 'this' from all redeclarations (#176188)
Fix handling of `lifetimebound` attributes on implicit `this` parameters across function redeclarations.

Previously, the lifetime analysis would miss `lifetimebound` attributes on implicit `this` parameters if they were only present on certain redeclarations of a method. This could lead to false negatives in the lifetime safety analysis. This change ensures that if any redeclaration of a method has the attribute, it will be properly detected and used in the analysis.

I can't seem to work around the crash in the earlier attempt https://github.com/llvm/llvm-project/pull/172146.

Reproducer of the original crash:

```cpp
struct a {
  a &b() [[_Clang::__lifetimebound__]];
};
a &a::b() {}
```
This only crashes with `-target i686-w64-mingw32`. `bin/clang++ -c a.cpp` works fine.
Problematic merging logic:
```cpp
 // If Old has lifetimebound but New doesn't, add it to New.
  if (OldLBAttr && !NewLBAttr) {
    QualType NewMethodType = New->getType();
    QualType AttributedType =
        S.Context.getAttributedType(OldLBAttr, NewMethodType, NewMethodType);
    TypeLocBuilder TLB;
    TLB.pushFullCopy(NewTSI->getTypeLoc());
    AttributedTypeLoc TyLoc = TLB.push<AttributedTypeLoc>(AttributedType); // Crashes.
    TyLoc.setAttr(OldLBAttr);
    New->setType(AttributedType);
    New->setTypeSourceInfo(TLB.getTypeSourceInfo(S.Context, AttributedType));
  }
```

<details>
<summary>Crash</summary>

```
clang++: /REDACTED//llvm-project/clang/lib/Sema/TypeLocBuilder.cpp:89: TypeLoc clang::TypeLocBuilder::pushImpl(QualType, size_t, unsigned int): Assertion `TLast == LastTy && "mismatch between last type and new type's inner type"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: bin/clang++ -target i686-w64-mingw32 -c /REDACTED//a.cpp
1.      /REDACTED//a.cpp:4:11: current parser token '{'
 #0 0x000055971cfcb838 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /REDACTED//llvm-project/llvm/lib/Support/Unix/Signals.inc:842:13
 #1 0x000055971cfc9374 llvm::sys::RunSignalHandlers() /REDACTED//llvm-project/llvm/lib/Support/Signals.cpp:109:18
 #2 0x000055971cfcaf0c llvm::sys::CleanupOnSignal(unsigned long) /REDACTED//llvm-project/llvm/lib/Support/Unix/Signals.inc:0:3
 #3 0x000055971cf38116 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) /REDACTED//llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
 #4 0x000055971cf38116 CrashRecoverySignalHandler(int) /REDACTED//llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390:51
 #5 0x00007fe9ebe49df0 (/lib/x86_64-linux-gnu/libc.so.6+0x3fdf0)
 #6 0x00007fe9ebe9e95c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #7 0x00007fe9ebe49cc2 raise ./signal/../sysdeps/posix/raise.c:27:6
 #8 0x00007fe9ebe324ac abort ./stdlib/abort.c:81:3
 #9 0x00007fe9ebe32420 __assert_perror_fail ./assert/assert-perr.c:31:1
#10 0x000055971f969ade clang::TypeLocBuilder::pushImpl(clang::QualType, unsigned long, unsigned int) /REDACTED//llvm-project/clang/lib/Sema/TypeLocBuilder.cpp:93:3
#11 0x000055971f237255 clang::QualType::hasLocalQualifiers() const /REDACTED//llvm-project/clang/include/clang/AST/TypeBase.h:1065:37
#12 0x000055971f237255 clang::ConcreteTypeLoc<clang::UnqualTypeLoc, clang::AttributedTypeLoc, clang::AttributedType, clang::AttributedLocInfo>::isKind(clang::TypeLoc const&) /REDACTED//llvm-project/clang/include/clang/AST/TypeLoc.h:392:26
#13 0x000055971f237255 clang::AttributedTypeLoc clang::TypeLoc::castAs<clang::AttributedTypeLoc>() const /REDACTED//llvm-project/clang/include/clang/AST/TypeLoc.h:79:5
#14 0x000055971f237255 clang::AttributedTypeLoc clang::TypeLocBuilder::push<clang::AttributedTypeLoc>(clang::QualType) /REDACTED//llvm-project/clang/lib/Sema/TypeLocBuilder.h:106:47
#15 0x000055971f280cc8 clang::AttributedTypeLoc::setAttr(clang::Attr const*) /REDACTED//llvm-project/clang/include/clang/AST/TypeLoc.h:1035:30
#16 0x000055971f280cc8 mergeLifetimeBoundAttrOnMethod(clang::Sema&, clang::CXXMethodDecl*, clang::CXXMethodDecl const*) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:4497:11
#17 0x000055971f280cc8 clang::Sema::MergeCompatibleFunctionDecls(clang::FunctionDecl*, clang::FunctionDecl*, clang::Scope*, bool) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:4528:5
#18 0x000055971f27eb1f clang::Sema::MergeFunctionDecl(clang::FunctionDecl*, clang::NamedDecl*&, clang::Scope*, bool, bool) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:0:0
#19 0x000055971f29c256 clang::Sema::CheckFunctionDeclaration(clang::Scope*, clang::FunctionDecl*, clang::LookupResult&, bool, bool) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:12371:9
#20 0x000055971f28dab0 clang::Declarator::setRedeclaration(bool) /REDACTED//llvm-project/clang/include/clang/Sema/DeclSpec.h:2738:51
#21 0x000055971f28dab0 clang::Sema::ActOnFunctionDeclarator(clang::Scope*, clang::Declarator&, clang::DeclContext*, clang::TypeSourceInfo*, clang::LookupResult&, llvm::MutableArrayRef<clang::TemplateParameterList*>, bool&) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:10877:9
#22 0x000055971f2890fc clang::Sema::HandleDeclarator(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:0:11
#23 0x000055971f2aab99 clang::Sema::ActOnStartOfFunctionDef(clang::Scope*, clang::Declarator&, llvm::MutableArrayRef<clang::TemplateParameterList*>, clang::SkipBodyInfo*, clang::Sema::FnBodyKind) /REDACTED//llvm-project/clang/lib/Sema/SemaDecl.cpp:15904:15
#24 0x000055971efab286 clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /REDACTED//llvm-project/clang/lib/Parse/Parser.cpp:1364:23
#25 0x000055971f013b40 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) /REDACTED//llvm-project/clang/lib/Parse/ParseDecl.cpp:2268:18
#26 0x000055971efaa54f clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /REDACTED//llvm-project/clang/lib/Parse/Parser.cpp:0:10
#27 0x000055971efa9e36 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /REDACTED//llvm-project/clang/lib/Parse/Parser.cpp:1202:12
#28 0x000055971efa8df8 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /REDACTED//llvm-project/clang/lib/Parse/Parser.cpp:0:14
#29 0x000055971efa7574 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /REDACTED//llvm-project/clang/lib/Parse/Parser.cpp:743:10
#30 0x000055971ef9c0ee clang::ParseAST(clang::Sema&, bool, bool) /REDACTED//llvm-project/clang/lib/Parse/ParseAST.cpp:169:5
#31 0x000055971dbcdad6 clang::FrontendAction::Execute() /REDACTED//llvm-project/clang/lib/Frontend/FrontendAction.cpp:1317:10
#32 0x000055971db3c5fd llvm::Error::getPtr() const /REDACTED//llvm-project/llvm/include/llvm/Support/Error.h:278:42
#33 0x000055971db3c5fd llvm::Error::operator bool() /REDACTED//llvm-project/llvm/include/llvm/Support/Error.h:241:16
#34 0x000055971db3c5fd clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /REDACTED//llvm-project/clang/lib/Frontend/CompilerInstance.cpp:1006:23
#35 0x000055971dcb4f9c clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /REDACTED//llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:310:25
#36 0x000055971a5e655e cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /REDACTED//llvm-project/clang/tools/driver/cc1_main.cpp:304:15
#37 0x000055971a5e29cb ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>) /REDACTED//llvm-project/clang/tools/driver/driver.cpp:226:12
#38 0x000055971a5e4c1d clang_main(int, char**, llvm::ToolContext const&)::$_0::operator()(llvm::SmallVectorImpl<char const*>&) const /REDACTED//llvm-project/clang/tools/driver/driver.cpp:0:12
#39 0x000055971a5e4c1d int llvm::function_ref<int (llvm::SmallVectorImpl<char const*>&)>::callback_fn<clang_main(int, char**, llvm::ToolContext const&)::$_0>(long, llvm::SmallVectorImpl<char const*>&) /REDACTED//llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#40 0x000055971d9bfe79 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0::operator()() const /REDACTED//llvm-project/clang/lib/Driver/Job.cpp:442:30
#41 0x000055971d9bfe79 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_0>(long) /REDACTED//llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:46:12
#42 0x000055971cf37dbe llvm::function_ref<void ()>::operator()() const /REDACTED//llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:0:12
#43 0x000055971cf37dbe llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /REDACTED//llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:426:3
#44 0x000055971d9bf5ac clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const /REDACTED//llvm-project/clang/lib/Driver/Job.cpp:442:7
#45 0x000055971d98422c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /REDACTED//llvm-project/clang/lib/Driver/Compilation.cpp:196:15
#46 0x000055971d984447 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const /REDACTED//llvm-project/clang/lib/Driver/Compilation.cpp:246:13
#47 0x000055971d99ee08 llvm::SmallVectorBase<unsigned int>::empty() const /REDACTED//llvm-project/llvm/include/llvm/ADT/SmallVector.h:83:46
#48 0x000055971d99ee08 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) /REDACTED//llvm-project/clang/lib/Driver/Driver.cpp:2265:23
#49 0x000055971a5e2303 clang_main(int, char**, llvm::ToolContext const&) /REDACTED//llvm-project/clang/tools/driver/driver.cpp:414:21
#50 0x000055971a5f2527 main /usr/local/google/home/usx/build/tools/clang/tools/driver/clang-driver.cpp:17:10
#51 0x00007fe9ebe33ca8 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#52 0x00007fe9ebe33d65 call_init ./csu/../csu/libc-start.c:128:20
#53 0x00007fe9ebe33d65 __libc_start_main ./csu/../csu/libc-start.c:347:5
#54 0x000055971a5e0361 _start (bin/clang+++0x6636361)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
clang version 23.0.0git (https://github.com/llvm/llvm-project.git 282a065c5bb36186c05b903980d1d3a37fce2175)
Target: i686-w64-windows-gnu
Thread model: posix
InstalledDir: /usr/local/google/home/usx/build/bin
Build config: +assertions
clang++: note: diagnostic msg: 
********************
```

</details>
2026-01-19 13:02:59 +01:00
Michael Buch
cf4cf854df [lldb][TypeSystemClang] Remove redundant allow_completion parameter to GetCompleteQualType
No caller sets this parameter to `false`. It's odd that we would provide
such an option to a user. This gets used whenever we want to
ensure/check that a type has a definition. Never do we actually want to
expose the underlying mechanism of whether the type has been lazily
completed or not. A more dedicated API could introduced for this
purpose if we really wanted one.
2026-01-19 11:50:39 +00:00
Michael Buch
9c75d27394 [lldb][DWARFASTParserClang][NFC] Remove obsolete DEBUG_PRINTF
Uncommenting `ENABLE_DEBUG_PRINTF` wasn't compiling on top-of-tree. This code may have been useful for debugging locally in the past but it doesn't seem compelling to keep this in the source-tree. Especially because it doesn't compile, indicating it's most likely not used.

This patch removes `DEBUG_PRINTF` entirely.
2026-01-19 11:20:27 +00:00
Ebuka Ezike
c61d5f9814
[lldb-dap][NFC] Address comments grammar. (#176233)
From
https://github.com/llvm/llvm-project/pull/175930#pullrequestreview-3667183086
2026-01-19 11:09:41 +00:00
Ivan Kosarev
7533573aaf
[AMDGPU][NFC] Templatise and round-trip gfx11_asm_vop3_dpp8.s (#176450)
Prepared as a series of smaller commits as the cumulative diff is pretty
much unreviewable.
    
Supposed to help getting rid of lots of differences in the disassembler
counterpart of this test sitting downstream in the True16 branch.
    
I tried to make sure all important cases that were on the disassembler
side of the test, both upstream and downstream, are reflected in the
combined asm/disasm test.
2026-01-19 11:08:57 +00:00
Pierre van Houtryve
22057b04bf
[InstCombine] Fix crash on large integers in visitShl (#176723)
Do not call getExtendedType without first checking if the type can be
extended.

Solves SWDEV-547672
2026-01-19 12:07:03 +01:00
Longsheng Mou
be037864f9
[mlir][affine] Use lookupNearestSymbolFrom to simplify code (NFC) (#176679) 2026-01-19 19:03:01 +08:00
Michael Buch
f74c2668cc
[lldb][Module][NFC] Remove unused always_create parameter to GetSharedModule (#176325)
No caller sets this to `true`. Initially added for and set by
`SymbolFileDWARFDebugMap` (see
`616f490777a4f35269a23abee851680134050065`). This was then removed
shortly after in:
```
commit 762f7135e290696595b6c7233245581f59eeb07c
Author: Greg Clayton <gclayton@apple.com>
Date:   Sun Sep 18 18:59:15 2011 +0000

    Don't put modules for .o files into the global shared module list. We
    used to do this because we needed to find the shared pointer for a .o
    file when the .o file's module was needed in a SymbolContext since the
    module in a symbol context was a shared pointer. Now that we are using
    intrusive pointers we don't have this limitation anymore since any
    instrusive shared pointer can be made from a pointer to an object
    all on its own.
```

At this point it's more of a foot-gun, because forcing it to true has
potentially significant performance implications (e.g.,
a5eaa05dce)
2026-01-19 10:57:52 +00:00
Ramkumar Ramachandra
bfe6668130
[VPlan] Strip VPWidenSelectSC from VPRecipeTy (NFC) (#176722)
WidenSelect has been removed in 16830b2 ([VPlan] Remove
VPWidenSelectRecipe, use VPWidenRecipe instead, #174234).
2026-01-19 10:49:22 +00:00
Jack
4b8ff4c63d
[mlir][math] Fix the semantics of math.clampf (#175012)
The `math.clampf` op is semantically incorrect when compared to both the
CUDA reference implementation and the SPIRV spec, both of which have a
clamp op.
- Fix the definition of `math.clampf` to agree with CUDA and SPIRV
- Explicitly state when `math.clampf` produces `ub.poison`
- Update the ExpandOps pass to reflect the corrected semantics
2026-01-19 10:49:01 +00:00
Charles Zablit
e43331f94a
[lldb] add a marker before hidden frames (#167550)
**This patch adds a marker to make hidden frames more explicit.**

---

Hidden frames can be confusing for some users, who see that the indexes
of the frames in a backtrace are not contiguous. This patch aims to
lessen the confusion by adding a delimiter for the first and last non
hidden frame, i.e the boundaries.

IDE's like Xcode and VSCode represent those in the UI by having the
hidden frames either greyed out or collapsed.

It's not possible to do this in the CLI, therefore, this patch makes use
of 2 unicode characters to mark the beginning and end of the hidden
frames range.

This patch depends on:
- https://github.com/llvm/llvm-project/pull/168603

# Examples

In the example below, frame `#2` to `#7` are is hidden, and therefore,
frame `#1` is the first non hidden frame of the range while frame `#8`
is the last non hidden frame:
<img width="488" height="112" alt="Screenshot 2025-11-18 at 18 41 11"
src="https://github.com/user-attachments/assets/a21431da-9729-4cf0-a6bc-024aa306fc45"
/>

If the selected frame is one of the 2 boundary frames, we replace the
delimiter character with the select character (`*`).

<img width="487" height="111" alt="Screenshot 2025-11-18 at 18 41 03"
src="https://github.com/user-attachments/assets/5616fa81-6db6-457d-9d1e-bbe46e710c26"
/>
<img width="488" height="111" alt="Screenshot 2025-11-18 at 18 40 55"
src="https://github.com/user-attachments/assets/93dfa6cf-0956-4718-b31c-f965ec72b56d"
/>
2026-01-19 11:43:45 +01:00
Jerry Dang
d2c5892c22
[SelectionDAG] Add TRUNCATE_SSAT_S/U and TRUNCATE_USAT_U to canCreateUndefOrPoison and computeKnownBits (#152143) (#168809)
1. Implement `SelectionDAG::computeKnownBits` for TRUNCATE_SSAT_S/U and
TRUNCATE_USAT_U
2. Saturating truncation operations are well-defined for all inputs and
cannot create poison or undef values. This allows the optimizer to
eliminate unnecessary freeze instructions after these operations.

Fixes #152143
2026-01-19 10:25:08 +00:00
Michael Klemm
9f19d1895d
[OpenMP] Fix truncation/extension bug when calling __kmpc_push_num_teams (#173067)
This PR fixes a bug when the lower and upper bound for the number of
teams was not an `int32`, but a different type. In this case, an
internal compiler would trigger due to a mismatching call to
`__kmpc_push_num_teams`.
2026-01-19 11:20:11 +01:00
NAKAMURA Takumi
e697dba370 Fix a warning triggered by #152260 [-Wunused-variable] 2026-01-19 19:13:42 +09:00
Hans Wennborg
3d90b7a2d7
[-Wunsafe-buffer-usage] Separate flag for format-attributed functions (#175749)
PR #173096 extended -Wunsafe-buffer-usage-in-libc-call to apply to all
functions with the 'format' attribute.

This change moves those warnings behind a separate
-Wunsafe-buffer-usage-in-format-attr-call flag (implicitly enabled by
-Wunsafe-buffer-usage), allowing projects to decide whether they want to
opt in to this or not.
2026-01-19 10:11:34 +00:00
Matt Arsenault
0e304e6d9f
GlobalISel: Use LibcallLoweringInfo more in LegalizerHelper (#176411)
Avoid using TargetLowering for libcall information.
2026-01-19 11:07:56 +01:00
NAKAMURA Takumi
5931034653 CoverageMappingWriter.cpp: Append yet another comarison, endLoc.
This was the part of #125407.

For "Same Kind and same startLoc", reorder records BY endLoc DESC, to
prioritize wider Regions with the same startLoc.
2026-01-19 18:31:20 +09:00
Matthias Springer
4a880833b7
[mlir][NFC] remove-dead-values: Get canonicalization patterns from ops (#176712)
Collect canonicalization patterns from the region branch ops (instead of
populating all canonicalization patterns).

Addresses a
[comment](https://github.com/llvm/llvm-project/pull/173505#discussion_r2675222999)
on a merged PR.
2026-01-19 10:30:19 +01:00
Ryan Cowan
78481a2444
[AArch64][GISel] Use MachineMemoryOperand size when choosing indexed store (#175747)
A miss-compile occurs at o2 or above when using GlobalISel. The error
occurs due to the GlobalMerge pass moving two variables together & a
store of the incorrect size overwriting one of the two merged variables.

Currently, `AArch64InstructionSelector` uses the size of LLT when
choosing which pre/post indexed store to choose. In this case, the size
of the LLT is 32 when the value being stored is 16. By changing this
selector to look at the size of the MMO we can avoid this issue.

---------

Co-authored-by: Nathan Corbyn <me@nathancorbyn.com>
2026-01-19 09:29:21 +00:00
Lukas Sommer
5b454fb11b
[mlir][tensor] Preserve encoding when folding empty (#176427)
Addresses a long-standing TODO to not drop the encoding when folding a
`tensor.empty` with a reshape operation (`tensor.expand_shape`,
`tensor.collapse_shape`).

---------

Signed-off-by: Lukas Sommer <lukas.sommer@amd.com>
2026-01-19 10:23:49 +01:00
Pradeep Kumar
db98b99f1e
[LLVM][NVPTX] Add support for tcgen05.ld.red Instruction (#175919)
This commit adds support for tcgen05.ld.red instruction with tests under tcgen05-ld-red.ll
2026-01-19 14:36:55 +05:30
Gergely Bálint
d88138d348
[BOLT] Fix long-jmp-bti-plt.c test (#176709)
The test checked for exact addresses in disassembly. This was failing on
some platforms.

Fix: changed test to check for regular expressions
2026-01-19 10:03:09 +01:00
Thomas Symalla
ff5e583dbe
[FileCheck] Add %ProtectFileCheckOutput to backref-limit.txt test. (#176705)
This test passes locally and asserts as intended, but fails on BuildBot.
2026-01-19 09:02:56 +00:00
Islam Imad
5104e7783e
[libc][math] Refactor f16fma to header only (#176244)
closes #175320

Part of #175313
2026-01-19 11:01:03 +02:00
David Zbarsky
4885d1fcf6
Fix typo in clang/www/builtins.py (#174304)
`__builtin_ia32_subss` appeared in the list twice
2026-01-19 09:54:03 +01:00
Balázs Kéri
dc26c7e14d
[clang][analyzer] StdLibraryFunctionsChecker getcwd fix (#175794)
`StdLibraryFunctionsChecker` contained the following condition for
`getcwd`:
```
           .Case({NotNull(0),
                  ArgumentCondition(1, WithinRange, Range(1, SizeMax)),
                  ReturnValueCondition(BO_EQ, ArgNo(0))},
                 ErrnoMustNotBeChecked, GenericSuccessMsg)
```
In this case argument 1 should be not zero and return value is set to be
equal to argument 1. This would mean that return value is implicitly not
zero. But for unknown reason (probably analyzer inaccuracy) it can occur
that the return value is still assumable to be zero after this condition
was applied. This results in false positive if `ErrnoChecker` is enabled
because when the return value is 0 value of `errno` should be allowed to
be read but in this case it is not.
The bug is fixed by adding an extra (theoretically redundant) condition
for the return value to be non-zero.

Fixes #175136
2026-01-19 09:33:59 +01:00
hev
671f3bc8cd
[clang][LoongArch] Guard FCSR intrinsics with __loongarch_hard_float (#176545)
Link:
https://gcc.gnu.org/pipermail/gcc-patches/2025-December/703313.html
2026-01-19 16:21:36 +08:00
Matt Arsenault
0899e8a3cc
InstCombine: Split aggregate tests for SimplifyDemandedFPClass to new fie (#176702)
This is a workaround; currently alive2 silently errors when trying to
verify transforms on some of these cases.
2026-01-19 08:21:14 +00:00
Nikita Popov
792670a400
[X86][WinEH] Insert nop after unwinding inline assembly (#176393)
As discussed on https://github.com/llvm/llvm-project/pull/144745, insert
a nop after unwinding inline assembly, as it may end on a call.

While the change itself is trivial, I ended up having to do two
infrastructure changes:
* The unwind flag needs to be propagated to ExtraInfo of the
MachineInstr.
* The MachineInstr needs to be passed through to emitInlineAsmEnd(), and
the method needs to be non-const.

Fixes https://github.com/llvm/llvm-project/issues/157073.
2026-01-19 09:09:04 +01:00
Wenju He
b12e070b92
[OpenCL] Set KHR extensions minimum version to OpenCL 1.0 (2nd try) (#176681)
Motivation is similar to 25cfdaa4e9dc. Their spec don't specify a
required OpenCL version. Targets may expose them before OpenCL 1.2. Set
KHR extensions (depth images, mipmaps, subgroups, kernel clock, dot
product, ext_float_atomics, extended_bit_ops, cles_khr_int64) to
availability 1.0.
Changes to opencl-c.h:
* Relax header and test guards to allow extension macros whenever any
OpenCL C version is defined.
* Relax cl_khr_depth_images guard to allow cl_khr_depth_images, OpenCL
C++, or OpenCL C 2.0+, since image2d_depth_t and image2d_array_depth_t
types require that coverage.
* Guard image1d_t, image1d_array_t and image2d_array_t types with OpenCL
C++ or OpenCL C 1.2+ to match with OpenCL C spec.

Relates to https://github.com/KhronosGroup/OpenCL-CTS/pull/2376.

Update: The first attempt was reverted in #175993, but the regression
described in #175993 should be fixed in ROCm/llvm-project's opencl-c.h.
See https://github.com/llvm/llvm-project/pull/175993#issuecomment-3762586432
2026-01-19 16:04:59 +08:00
Zhaoxin Yang
a2d8950f20
[LoongArch] Convert ld to fld when result is only used by sitofp (#165523)
If the result of an integer load is only used by an integer-to-float
conversion, use a fp load instead. This eliminates an
integer-to-float-move (movgr2fr) instruction.
2026-01-19 15:53:27 +08:00
Seraphimt
767a04c9bb
Fix typo in condition AArch64InstrInfo::copyPhysReg. (#173450)
Minor fix typo.
Main issue:
https://github.com/llvm/llvm-project/issues/169959

I did research and found file with tests but I couldn't figure out how
cover this change. if this needs to be added then please advise.
@tomershafir
2026-01-19 09:51:53 +02:00
Vikram Hegde
58a99d4e3d
[CodeGen][NPM] Update dominator tree and post dominator tree consistently (#173485)
These passes run "RenumberBlocks()" on Machine function which renders
the dominator tree analyses in the cache stale (though passes may not
change anything structurally). we need to update the block numbers in
the cached analyses if we are to return PreservedAnalysis::all(). This
is not an issue with legacy PM since none of these passes preserve
dominator tree analyses anyway.
2026-01-19 13:16:28 +05:30
Crivens6
5dcb977eb4
[Kaleidoscope] Update tutorial ch2 to match example code document (#172392)
This change syncs the tutorial with the example code document for
chapter 2. This is necessary to lookup the top level expression with the
JIT in chapter 4.

Co-authored-by: Christyllin <DiskworldWizzard@Gmail.com>
2026-01-19 18:39:12 +11:00