Commit Graph

545421 Commits

Author SHA1 Message Date
Florian Hahn
3fd53db858 [VPlan] Remove unneeded VPVectorPointer after narrowing to replicate.
The replicate recipes created when narrowing interleave groups don't
need a VPVectorPointer, they can simply use the existing pointer.
2025-07-19 20:18:04 +01:00
Mikhail R. Gadelha
4d76ff9d2e [libc] Fix setitimer build when full_build=OFF (#149665)
When we pull the headers from the system, we might get a suseconds_t
that's a long long, so add a cast to prevent a implicit conversion
error.
2025-07-19 16:03:09 -03:00
Vassil Vassilev
0a463bd43e [clang-repl] Mark asan and systemz as unsupported for now.
While waiting for the bot owners it seems that this is not a major issue due
to the big endianness of the systemz platform. Instead it looks like we are not
modelling something well for enum types. Probably `va_arg` has a bug for that
platform or similar.

The asan failure seems to be a crash in asan and maybe related to the issues
we've mentioned in llvm/llvm-project#102858.

This patch should appease the bots that were broken by llvm/llvm-project#148701
2025-07-19 17:45:56 +00:00
Maksim Levental
906295b8a3 [mlir] update affine+arith create APIs (1/n) (#149656)
This PR updates create APIs for arith and affine - specifically these
are the only in-tree dialects/ops with "custom" builders:

```
AffineDmaStartOp
AffineDmaWaitOp
ConstantIntOp
ConstantFloatOp
ConstantIndexOp
```

See https://github.com/llvm/llvm-project/pull/147168 for more info.
2025-07-19 12:37:39 -05:00
Corentin Jabot
c43f828d59 [Clang] Be less strict about diagnosing null pointer dereference. (#149648)
In #143667, we made constant evaluation fail on `*null_ptr`, as this is
UB. However, `&(*(foo*)0)` seems to be a common pattern, which made
#143667 too disruptive.

So instead of failing the evaluation, we note the UB, which let clang
recovers when checking for constant initialization.

Fixes #149500
2025-07-19 19:30:16 +02:00
Fangrui Song
1fcf49a35c MC: Replace FT_PseudoProbe with FT_LEB
The fragment type introduced by https://reviews.llvm.org/D91878 is
unnecessary and can be replaced with FT_LEB.
2025-07-19 10:15:25 -07:00
Fangrui Song
ecf0cbda18 MCFragment: Refactor LEB
* Deduplicate creation of SLEB128/ULEB128 with makeLEB.
* Call newFragment to prepare for removing getOrCreateDataFragment.
2025-07-19 09:59:27 -07:00
Hui
64220357b4 [libc++] constexpr flat_multimap (#148417)
Fixes #128674
2025-07-20 00:36:29 +08:00
Vassil Vassilev
50408eeff6 Revert "[clang-repl] Spell out the enum types to appease some bots."
This did not help the bots. Add another check that might help me figure out the
issue.

This reverts commit 193de1a566.
2025-07-19 14:31:19 +00:00
Louis Dionne
167c695cec [libc++] Add and empty skeleton for LLVM 22 release notes (#149535) 2025-07-19 14:32:54 +01:00
Amr Hesham
0aff1b6cdd [CIR][NFC] Replace bool by cir::UnaryOpKind in emitComplexPrePostIncDec (#149566)
Replace bool by cir::UnaryOpKind in emitComplexPrePostIncDec
2025-07-19 15:19:42 +02:00
Amr Hesham
65bde89c9a [CIR] Upstream CompoundLiteralExpr for Scalar (#148943)
Upstream CompoundLiteralExpr for Scalar as a prerequisite for
CompoundLiteralExpr for ComplexType
2025-07-19 15:13:36 +02:00
Guy David
802ea0eb78 [Support] System include SipHash.h (#149499)
A regular include may not search the system include path.
2025-07-19 15:00:21 +03:00
Durgadoss R
3866e4e7f8 [NVPTX] Add im2colw/w128 modes support to TMA intrinsics (#148863)
This patch adds support for the im2col-w/w128 and scatter/gather modes
for TMA Copy and Prefetch intrinsics, completing support for all the
available modes. These are lowered through tablegen, building
on top of earlier patches.

* lit tests are added for all the combinations and verified with a
  12.8 ptxas executable.
* Documentation is updated in the NVPTXUsage.rst file.

Signed-off-by: Durgadoss R <durgadossr@nvidia.com>
2025-07-19 17:16:21 +05:30
Vassil Vassilev
193de1a566 [clang-repl] Spell out the enum types to appease some bots.
This change is a follow-up of llvm/llvm-project#148701 where clang-s390x-linux
and clang-s390x-linux-lnt failed.
2025-07-19 11:28:26 +00:00
Nikolas Klauser
b5348e7622 [libc++] Diagnose passing null pointers to a bunch of APIs (#148585) 2025-07-19 11:12:20 +02:00
kissholic
baf2953097 Optimize fptrunc(x)>=C1 --> x>=C2 (#99475)
Fix https://github.com/llvm/llvm-project/issues/85265#issue-2186848949
2025-07-19 17:52:06 +09:00
Charles Zablit
224e221f1b [NFC][lldb] fix extra line after documentation (#149482)
Formatting patch which removes an extra line after a docstring.
2025-07-19 10:46:28 +02:00
Naveen Seth Hanig
6855b9c598 [clang][deps] Properly capture the global module and '\n' for all module directives (#148685)
Previously, the newline after a module directive was not properly
captured and printed by `clang::printDependencyDirectivesAsSource`.

According to P1857R3, each directive must, after skipping horizontal
whitespace, appear at the start of a logical line. Because the newline
after module directives was missing, this invalidated the following
line.
This fixes tests that were previously in violation of P1857R3,
including for Objective-C directives, which should also comply with
P1857R3.

This also ensures that the global module fragment `module;` is captured
by the dependency directives scanner.
2025-07-19 09:47:37 +02:00
Nikolas Klauser
6b371cab94 [libc++] Move a bunch of extensions tests to test/extensions (#149275) 2025-07-19 09:44:25 +02:00
YexuanXiao
7c402b8b81 Reland [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types (#149613)
The checks for the 'z' and 't' format specifiers added in the original
PR #143653 had some issues and were overly strict, causing some build
failures and were consequently reverted at
4c85bf2fe8.

In the latest commit
27c58629ec,
I relaxed the checks for the 'z' and 't' format specifiers, so warnings
are now only issued when they are used with mismatched types.

The original intent of these checks was to diagnose code that assumes
the underlying type of `size_t` is `unsigned` or `unsigned long`, for
example:

```c
printf("%zu", 1ul); // Not portable, but not an error when size_t is unsigned long
```  

However, it produced a significant number of false positives. This was
partly because Clang does not treat the `typedef` `size_t` and
`__size_t` as having a common "sugar" type, and partly because a large
amount of existing code either assumes `unsigned` (or `unsigned long`)
is `size_t`, or they define the equivalent of size_t in their own way
(such as
sanitizer_internal_defs.h).2e67dcfdcd/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h (L203)
2025-07-19 03:44:14 -03:00
Vassil Vassilev
9bf7d04c43 [clang-repl] Lay the basic infrastructure for pretty printing of types (#148701)
The idea is to store a type-value pair in clang::Value which is updated
by the interpreter runtime. The class copies builtin types and boxes
non-builtin types to provide some lifetime control.

The patch enables default printers for C and C++ using a very
minimalistic approach. We handle enums, arrays and user types. Once we
land this we can focus on enabling user-defined pretty-printers which
take control over printing of types

The work started as part of https://reviews.llvm.org/D146809, then we
created a giant in https://github.com/llvm/llvm-project/pull/84769
2025-07-19 09:25:27 +03:00
Connector Switch
c875bb8eef [flang] Minor revision of the getting started guide. (#149632)
- C++17 is now the default, no need to specify explicitly.

b3c9ed151f/flang/CMakeLists.txt (L13)

- The current recommended way to set up OpenMP is as a runtime, not as a
project.

b3c9ed151f/llvm/CMakeLists.txt (L209-L214)
2025-07-19 13:41:07 +08:00
Timm Baeder
ef49ed4829 [clang][bytecode] Use bytecode interpreter in isPotentialConstantExprU… (#149462)
…nevaluated

Fake a function call to the given function and evaluate the given
expression as if it was part of that function call.

Fixes #149383
2025-07-19 07:18:51 +02:00
Florian Mayer
a5481e7d5a [NFCI] [HWASan] add test for custom section global (#149625) 2025-07-18 21:53:53 -07:00
Teresa Johnson
e57315e6ca [MemProf] Fix discarding of noncold contexts after inlining (#149599)
When we rebuild the call site tries after inlining of an allocation with
MD_memprof metadata, we don't want to reapply the discarding of small
non-cold contexts (under -memprof-callsite-cold-threshold=) because we
have either no context size info (without -memprof-report-hinted-sizes
or another option that causes us to keep that as metadata), and even
with that information in the metadata, we have imperfect information at
that point as we have already discarded some contexts during matching.

The first case was even worse because we didn't guard our check by
whether the number of cold bytes was 0, leading to very aggressive
pruning during post-inline metadata rebuilding without the context size
information.
2025-07-18 21:11:37 -07:00
Jordan Rupprecht
e1ac57c1a5 [mlir][test] Add missing REQUIRES: asserts for --debug-only flag (#149634)
Debug flags are not provided in fully optimized builds.

Test added in #149378 / #146228
2025-07-18 22:21:09 -05:00
Muhammad Bassiouni
cfddb401db [libc][math] Refactor acos implementation to header-only in src/__support/math folder. (#148409)
Part of #147386

in preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2025-07-19 05:21:34 +03:00
Alex MacLean
b3c9ed151f [NVPTX][test] regenerate some tests broken by successive changes (#149611)
#149393 and #149571 landed in quick succession requiring
some tests to be regenerated to account for their interactions.
2025-07-18 18:49:49 -07:00
Matt Arsenault
2f38ced51b StringMap: Remove redundant member init in constructor (#149491)
These are already zeroinitialized in the field definitions.
2025-07-19 09:15:48 +09:00
Jens Reidel
a5d6fa68e3 [compiler-rt][Mips] Fix stat size check on mips64 musl (#143301)
The sizes of the struct stat on MIPS64 differ in musl vs glibc.

See https://godbolt.org/z/qf9bcq8Y8 for the proof. Prior to this change,
compilation for MIPS64 musl would fail.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-07-18 20:01:44 -04:00
Colin De Vlieghere
fef4238288 [MLIR][SCF] Add dedicated Python bindings for ForallOp (#149416)
This patch specializes the Python bindings for ForallOp and
InParallelOp, similar to the existing one for ForOp. These bindings
create the regions and blocks properly and expose some additional
helpers.
2025-07-18 19:53:11 -04:00
Jonas Devlieghere
68fd102598 [lldb] Use std::make_shared for StopInfoSP (#149612)
Use std::make_shared to create a StopInfoSP, which inherits from
shared_from_this. It's both the most efficient and safest way to create
these objects:

- With make_shared, the object and the control block are allocated
together, which is more efficient.
- With make_shared, the enable_shared_from_this base class is properly
linked to the control block before the constructor finishes, so
shared_from_this() will be safe to use (though still not recommended
during construction).
2025-07-18 16:15:38 -07:00
lonely eagle
09bea21d95 [mlir][memref] Simplify memref.copy canonicalization (#149506)
FoldCopyOfCast has both a OpRewritePattern implementation and a folder
implementation. This PR removes the OpRewritePattern implementation.
2025-07-19 07:11:10 +08:00
Chelsea Cassanova
7c57b559a4 [lldb][scripts] Fix framework script unifdef test (#149607)
Fixes a test that's failing on LLDB GreenDragon due to a mistake in the
arguments used when calling the framework-header-fix script.
2025-07-18 17:43:46 -05:00
Florian Mayer
7b5d8a02d2 Revert "[NFC][profdata] Apply lints and other format fixes" (#149601)
Reverts llvm/llvm-project#149433

This broke the hwasan buildbot:
https://lab.llvm.org/buildbot/#/builders/55/builds/14455
2025-07-18 15:06:50 -07:00
Kazu Hirata
b9aa06f897 [llvm] Improve grammar and punctuation of LLVM Language Reference Manual (#149553) 2025-07-18 14:59:53 -07:00
Kazu Hirata
28c1433cf3 [Vectorize] Fix a warning
This patch fixes:

  llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp:726:13: error:
  unused variable 'RedPhiRK' [-Werror,-Wunused-variable]
2025-07-18 14:58:52 -07:00
lntue
20c5daa032 [libc] Fix conflicting symbols when shared/math.h is included. (#149591) 2025-07-18 17:54:47 -04:00
Kelvin Li
2e67dcfdcd [flang] update ppc lit tests after using vector.insert and vector.extract (NFC) (#148775)
See https://github.com/llvm/llvm-project/pull/143272
2025-07-18 14:43:15 -07:00
Diego Caballero
c99c213e72 [mlir][Flang][NFC] Replace use of vector.insertelement/extractelement (#143272)
This PR is part of the last step to remove `vector.extractelement` and
`vector.insertelement` ops (RFC:
https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops).
It replaces `vector.insertelement` and `vector.extractelement` with
`vector.insert` and `vector.extract` in Flang. It looks like no lit
tests are impacted?
2025-07-18 14:43:03 -07:00
Prabhu Rajasekaran
921c6dbeca [llvm] Introduce callee_type metadata
Introduce `callee_type` metadata which will be attached to the indirect
call instructions.

The `callee_type` metadata will be used to generate `.callgraph` section
described in this RFC:
https://lists.llvm.org/pipermail/llvm-dev/2021-July/151739.html

Reviewers: morehouse, petrhosek, nikic, ilovepi

Reviewed By: nikic, ilovepi

Pull Request: https://github.com/llvm/llvm-project/pull/87573
2025-07-18 14:40:54 -07:00
Stanislav Mekhanoshin
6d8e53d4af [AMDGPU] Support nv memory instructions modifier on gfx1250 (#149582) 2025-07-18 14:38:46 -07:00
Florian Mayer
1b8a136a09 [Sanitizer] remove array-bounds-pseudofn (#149430)
This has been replaced by -fsanitize-annotate-debug-info
2025-07-18 14:31:21 -07:00
Jonas Devlieghere
3641448e08 [lldb] Use StopInfoSP instead of StopInfo* (NFC)
Don't make assumptions about the lifetime of the underlying object and
use the shared_ptr to participate in reference counting and extend the
lifetime of the object to the end of the lexical scope.
2025-07-18 14:29:20 -07:00
Alex MacLean
965b68e8f2 [NVPTX] Prevent fptrunc of v2f32 from being folded into store (#149571) 2025-07-18 14:20:13 -07:00
Andres-Salamanca
b02787d33f [CIR] Fix alignment when lowering set/get bitfield operations (#148999)
This PR fixes incorrect alignment when lowering `set` and `getBitField`
operations to LLVM IR. The issue occurred because during lowering, the
function was being called with an alignment of 0, which caused it to
default to the alignment of the packed member. For example, if the
bitfield was packed inside a `u64i`, it would use an alignment of 8.
With this change, the generated code now matches what the classic
codegen produces.
In the assembly format, I changed to be similar to how it's done in
loadOp. If there's a better approach, please feel free to point it out.
2025-07-18 16:13:34 -05:00
Princeton Ferro
d63ab5467d [NVPTX] don't erase CopyToRegs when folding movs into loads (#149393)
We may still need to keep CopyToReg even after folding uses into vector
loads, since the original register may be used in other blocks.

Partially reverts 1fdbe69849
2025-07-18 14:11:31 -07:00
Jay Foad
3be44e2580 [TableGen] Add some -time-phases support in CodeGenRegisters (#149309) 2025-07-18 22:05:54 +01:00
Shilei Tian
d46de86ca4 [NFC][AMDGPU] Re-enable two tests previously disabled due to missing upstream features (#149568)
This PR re-enables two tests that were previously disabled because they
depended on features not yet upstreamed.
2025-07-18 17:04:34 -04:00