524221 Commits

Author SHA1 Message Date
Prashanth
d54d8d7e5a
[libc][docs] Add termios page to the status of implementations docs (#123004)
These changes ensure that the termios header is documented properly with
respect to the issue ( https://github.com/llvm/llvm-project/issues/122006 ) .
2025-01-17 08:59:49 -08:00
Cullen Rhodes
f719771f25
Revert "[AArch64] Combine and and lsl into ubfiz" (#123356)
Reverts llvm/llvm-project#118974
2025-01-17 16:53:33 +00:00
Kazu Hirata
c5312553cb
[CodeGen] Avoid repeated hash lookups (NFC) (#123287) 2025-01-17 08:48:06 -08:00
Kazu Hirata
d5aa6dfe8c
[Analysis] Avoid repeated hash lookups (NFC) (#123286) 2025-01-17 08:47:38 -08:00
Kazu Hirata
d5ef2c054d
[AST] Avoid repeated hash lookups (NFC) (#123285) 2025-01-17 08:47:15 -08:00
Kazu Hirata
f5736aee11
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#123284)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect Stored to be nonnull.
2025-01-17 08:46:52 -08:00
Kazu Hirata
3f07af93dc
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#123283)
Note that PointerUnion::dyn_cast has been soft deprecated in
PointerUnion.h:

  // FIXME: Replace the uses of is(), get() and dyn_cast() with
  //        isa<T>, cast<T> and the llvm::dyn_cast<T>

Literal migration would result in dyn_cast_if_present (see the
definition of PointerUnion::dyn_cast), but this patch uses dyn_cast
because we expect Source to be nonnull.
2025-01-17 08:46:16 -08:00
Prashanth
9f627cf540
[libc][docs] Add sys/time page to the status of implementations docs (#123000)
These changes ensure that the sys/time header is documented properly
with respect to the issue ( #122006 ) .
2025-01-17 08:38:03 -08:00
Sean Perry
89305c3715
[z/OS] add tail padding to TypeLoc if needed (#122761)
The code in getLocalDataSize() returns the sum of the size of the
LocalData plus the size of the extra data. The start of the extra data
is padded so it starts on a multiple of it's alignment. We also need to
be adding tail padding so the final size is a multiple of the alignment
of the LocalData. On most systems the alignment of the extra data is the
same or greater than the alignment of the LocalData so you don't need
the tail padding. However, on z/OS, the alignment of the extra data is
less than the alignment of the LocalData and thus you do need the tail
padding to make the final size a multiple of the LocalData alignment.

The extra data is the WrittenBuiltinSpecs struct. This struct is just a
struct of bitfields. On most systems the alignment of the struct is
determined by the type of the bitfields (eg. unsigned int -> align of
4). On z/OS, all bitfields are 1 byte aligned. Thus on z/OS
WrittenBuiltinSpecs is only size 2 with alignment of 1 (verses 4 & 4).
2025-01-17 11:14:50 -05:00
Paul Kirth
71ad9a958a
[fuchsia][cmake] Add runtimes for cortex-m4 for the Fuchsia toolchain (#123258) 2025-01-17 08:06:49 -08:00
Keyi Zhang
c9f72b2873
[MLIR][LLVM] Fix #llvm.constant_range parsing (#123009)
When `APInt` parses negative numbers, it may extend the bit width. This
patch ensures the bit width matches with the attribute.

Fixes https://github.com/llvm/llvm-project/issues/122996.
2025-01-17 17:01:39 +01:00
Michael Buch
7c729418d7
[llvm][DebugInfo] Attach object-pointer to DISubprogram declarations (#122742)
Currently Clang only attaches `DW_AT_object_pointer` to
`DW_TAG_subprogram` definitions. LLDB constructs C++ method types from
their `DW_TAG_subprogram` declaration, which is also the point at which
it needs to determine whether a method is static or not. LLDB's
heuristic for this could be very simple if we emitted
`DW_AT_object_pointer` on declarations. But since we don't, LLDB has to
guess whether an argument is an implicit object parameter based on the
DW_AT_name and DW_AT_type.

To simplify LLDB's job (and to eventually support C++23's explicit
object parameters), this patch adds the `DIFlagObjectPointer` to
`DISubprogram` declarations.

For reference, GCC attaches the object-pointer DIE to both the
definition and declaration: https://godbolt.org/z/3TWjTfWon

Fixes https://github.com/llvm/llvm-project/issues/120973
2025-01-17 15:27:48 +00:00
Konrad Kleine
ba44d7ba1f
[MLIR][test] Fixup for checking for ml_dtypes (#123240)
In order to optionally run some checks that depend on the `ml_dtypes`
python module we have to remove the `CHECK` lines for those tests or
they will be required and missed in the test output.

I've changed to use asserts as recommended in [1].

[1]:
https://github.com/llvm/llvm-project/pull/123061#issuecomment-2596116023
2025-01-17 16:25:08 +01:00
Iman Hosseini
63b0ab8425
remove extra ; (#123352)
Remove erroneous extra semicolon in:
https://github.com/llvm/llvm-project/pull/122788

Co-authored-by: ImanHosseini <imanhosseini.17@gmail.com>
2025-01-17 15:11:52 +00:00
Doug Wyatt
0417cd1b3e
[Clang] FunctionEffects: Correctly navigate through array types in FunctionEffectsRef::get(). (#121525)
`FunctionEffectsRef::get()` is supposed to strip off layers of
indirection (pointers/references, type sugar) to get to a
`FunctionProtoType` (if any) and return its effects (if any).

It wasn't correctly dealing with situations where the compiler
implicitly converts an array to a pointer.

---------

Co-authored-by: Doug Wyatt <dwyatt@apple.com>
Co-authored-by: Sirraide <aeternalmail@gmail.com>
2025-01-17 07:11:36 -08:00
Simon Pilgrim
8abbd76cfb [X86] Regenerate VFPCLASS assembly comments. NFC. 2025-01-17 15:10:52 +00:00
Simon Pilgrim
123b24ff97 [X86] avx512fp16-arith.ll - regenerate VPTERNLOG comments 2025-01-17 15:10:52 +00:00
Simon Pilgrim
2f853d851b [X86] Regenerate VMOVSH assembly comments. NFC. 2025-01-17 15:10:52 +00:00
John Brawn
edf3a55bce
[LoopVectorize][NFC] Centralize the setting of CostKind (#121937)
In each class which calculates instruction costs (VPCostContext,
LoopVectorizationCostModel, GeneratedRTChecks) set the CostKind once in
the constructor instead of in each function that calculates a cost. This
is in preparation for potentially changing the CostKind when compiling
for optsize.
2025-01-17 15:06:18 +00:00
Michael Buch
a4d45fe846 [lldb][DWARF] Change GetAttributes parameter from SmallVector to SmallVectorImpl
Fixes the lldb-arm-ubuntu buildbot failure:
```
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:374:26:
error: non-const lvalue reference to type 'SmallVector<[...], (default)
CalculateSmallVectorDefaultInlinedElements<T>::value aka 6>' cannot bind
to a value of unrelated type 'SmallVector<[...], 3>'
  374 |     if (!::GetAttributes(worklist, seen, attributes)) {
      |                          ^~~~~~~~
../llvm-project/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:288:56:
note: passing argument to parameter 'worklist' here
  288 | static bool GetAttributes(llvm::SmallVector<DWARFDIE> &worklist,
      |                                                        ^
1 error generated.
```
2025-01-17 14:56:41 +00:00
Simon Pilgrim
76569025dd
[X86] Fold (v4i32 (scalar_to_vector (i32 (anyext (bitcast (f16)))))) -> (v4i32 bitcast (v8f16 scalar_to_vector)) (#123338)
This pattern tends to appear during f16 -> f32 promotion

Partially addresses the unnecessary XMM->GPR->XMM moves when working with f16 types (#107086)
2025-01-17 14:46:22 +00:00
Iman Hosseini
8ae1cb2bcb
add power function to APInt (#122788)
I am trying to calculate power function for APFloat, APInt to constant
fold vector reductions: https://github.com/llvm/llvm-project/pull/122450
I need this utility to fold N `mul`s into power.

---------

Co-authored-by: ImanHosseini <imanhosseini.17@gmail.com>
Co-authored-by: Jakub Kuderski <kubakuderski@gmail.com>
2025-01-17 14:40:31 +00:00
Brox Chen
a18f4bdb18
[AMDGPU][True16][MC] true16 for v_cmpx_lt_f16 (#122936)
True16 format for v_cmpx_lt_f16. Update VOPCX t16 and fake16 pseudo.
2025-01-17 09:38:52 -05:00
Brox Chen
703e9e97d9
[AMDGPU][True16][CodeGen] true16 codegen for bswap (#122849)
true16 codegen pattern for bswap
2025-01-17 09:36:55 -05:00
Louis Dionne
8688a31729 [libc++] Allow passing arguments to GoogleBenchmark's compare.py tool 2025-01-17 09:28:47 -05:00
Phoebe Wang
48803bc8c7
[X86][AMX-AVX512][NFC] Remove P from intrinsic and instruction name (#123270)
Ref.: https://cdrdv2.intel.com/v1/dl/getContent/828965
2025-01-17 22:21:19 +08:00
Chuanqi Xu
baa5b769f2 [C++20] [Modules] Make module local decls visible to language linkage in the same module
Close https://github.com/llvm/llvm-project/issues/123343

See the issue and the comments in the patch for details.
2025-01-17 22:17:50 +08:00
Timm Baeder
0171e56ed0
[clang][bytecode] Fix rejecting invalid sizeof expressions (#123332)
Emit the invalid note instead of nothing.
2025-01-17 15:14:47 +01:00
Congcong Cai
eb7dea8bb1
[mutation analyzer] enhance stability for hasAnyInit matcher (#122915)
I cannot minimal produce it, but when I run clangd with
`misc-const-correctness` check in a big project
clangd crashed due to deref nullptr here.
clang may pass a nullptr to `InitExprs` when meets some error cases.
2025-01-17 22:14:23 +08:00
Michael Buch
dc1ef2cc1a
[lldb][DWARFASTParserClang] Don't overwrite DW_AT_object_pointer of definition with that of a declaration (#123089)
In https://github.com/llvm/llvm-project/pull/122742 we will start
attaching DW_AT_object_pointer to method declarations (in addition to
definitions).

Currently when LLDB parses a `DW_TAG_subprogram` definition, it will
parse all the attributes of the declaration as well. If we have
`DW_AT_object_pointer` on both, then we would overwrite the more
specific attribute that we got from the defintion with the one from the
specification. This is problematic because LLDB relies on getting the
`DW_AT_name` from the `DW_AT_object_pointer`, which doesn't exist on the
specification.

Note GCC does attach `DW_AT_object_pointer` on declarations *and*
definitions already (see https://godbolt.org/z/G1GvddY48), so there's
definitely some expressions that will fail for GCC compiled binaries.
This patch will fix those cases (e.g., I would expect `TestConstThis.py`
to fail with GCC).
2025-01-17 14:11:05 +00:00
Florian Hahn
7629e01479
[InstCombine,PhaseOrder] Add additional tests with align assumptions. 2025-01-17 14:05:54 +00:00
Congcong Cai
48d0ef1a07
[clang-tidy][NFC] refactor modernize-raw-string-literal fix hint (#122909) 2025-01-17 21:47:47 +08:00
Congcong Cai
361f363c11
[clang-tidy]fix incorrect fix-it for the string contains a user-defined suffix (#122901)
Fixed: #97243
2025-01-17 21:41:48 +08:00
Durgadoss R
6dcb2a0902
[MLIR][NVVM] Add Float to TF32 conversion Op (#123199)
PR #121507 added 'cvt' intrinsics to convert
float to tf32, with the valid set of rounding and
saturation modes. This PR adds an NVVM Dialect Op
for the same.
* lit tests are added to verify the lowering to intrinsics.
* Negative tests are also added to check the error-handling of invalid
combinations.

Signed-off-by: Durgadoss R <durgadossr@nvidia.com>
2025-01-17 19:02:25 +05:30
Ilia Kuklin
f597d346ab
[clang][Sema] Move computing best enum types to a separate function (#120965)
Move the code that computes BestType and BestPromotionType for an enum
to a separate function which can be called from outside of Sema.
2025-01-17 18:23:07 +05:00
lonely eagle
d28a4f1fc0
[mlir][affine]introducing new symbol rules that the result of a Pure operation that whose operands are valid symbolic identifiers (#118478)
introducing new symbol rules that the result of a Pure operation that whose operands are valid symbolic identifiers.
2025-01-17 21:21:41 +08:00
David Green
eff6b64258 [AArch64][GlobalISel] Update and regenerate some vecreduce and other tests. NFC 2025-01-17 13:19:11 +00:00
Michael Buch
5153a90453
[lldb][DWARF] Change GetAttributes to always visit current DIE before recursing (#123261)
`GetAttributes` returns all attributes on a given DIE, including any
attributes that the DIE references via `DW_AT_abstract_origin` and
`DW_AT_specification`. However, if an attribute exists on both the
referring DIE and the referenced DIE, the first one encountered will be
the one that takes precendence when querying the returned
`DWARFAttributes`. But there was no guarantee in which order those
attributes get visited. That means there's no convenient way of ensuring
that an attribute of a definition doesn't get shadowed by one found on
the declaration. One use-case where we don't want this to happen is for
`DW_AT_object_pointer` (which can exist on both definitions and
declarations, see https://github.com/llvm/llvm-project/pull/123089).

This patch makes sure we visit the current DIE's attributes before
following DIE references. I tried keeping as much of the original
`GetAttributes` unchanged and just add an outer `GetAttributes` that
keeps track of the DIEs we need to visit next.

There's precendent for this iteration order in
`llvm::DWARFDie::findRecursively` and also
`lldb_private::ElaboratingDIEIterator`. We could use the latter to
implement `GetAttributes`, though it also follows `DW_AT_signature` so I
decided to leave it for follow-up.
2025-01-17 13:09:52 +00:00
Wesley Wiser
41f430a48d
[X86] Don't fold very large offsets into addr displacements during ISel (#121678)
Doing so can cause the resulting displacement after frame layout to
become inexpressible (or cause over/underflow currently during frame
layout).

Fixes the error reported in
https://github.com/llvm/llvm-project/pull/101840#issuecomment-2306975944.
2025-01-17 20:09:00 +07:00
Chuanqi Xu
fb2c9d940a
[C++20] [Modules] Makes sure internal declaration won't be found by other TU (#123059)
Close https://github.com/llvm/llvm-project/issues/61427

And this is also helpful to implement
https://github.com/llvm/llvm-project/issues/112294 partially.

The implementation strategy mimics
https://github.com/llvm/llvm-project/pull/122887. This patch split the
internal declarations from the general lookup table so that other TU
can't find the internal declarations.
2025-01-17 21:03:53 +08:00
Florian Hahn
22637a877a
[Loads] Respect UseDerefAtPointSemantics in isDerefAndAlignedPointer. (#123196)
If a pointer gets freed, it may not be dereferenceable any longer, even
though there is a dominating dereferenceable assumption. As first step,
only consider assumptions if the pointer value cannot be freed if
UseDerefAtPointSemantics is used.

PR: https://github.com/llvm/llvm-project/pull/123196
2025-01-17 12:52:24 +00:00
Kiran Chandramohan
8a229f595a
Revert "Revert "Revert "[Flang][Driver] Add a flag to control zero initializa…" (#123330)
Reverts llvm/llvm-project#123097

Reverting due to buildbot failure
https://lab.llvm.org/buildbot/#/builders/89/builds/14577.
2025-01-17 12:27:58 +00:00
Alexandros Lamprineas
ce3280a644
Fix for buildbot errors on non-aarch64 targets. (#123322)
Add missing REQUIRES: aarch64-registered-target
2025-01-17 12:25:37 +00:00
Simon Pilgrim
bacfdcd7e0
[DAG] Add SDPatternMatch::m_BitCast matcher (#123327)
Simplifies a future patch
2025-01-17 12:22:07 +00:00
Kiran Chandramohan
8c63648117
Revert "Revert "[Flang][Driver] Add a flag to control zero initializa… (#123097)
…tion of global v…" (#123067)"

This reverts commit 44ba43aa2b740878d83a9d6f1d52a333c0d48c22.

Adds the flag to bbc as well.
2025-01-17 12:14:20 +00:00
Fraser Cormack
a90b5b1885
[libclc] Move degrees/radians to CLC library & optimize (#123222)
Missing half variants were also added.

The builtins are now consistently emitted in vector form (i.e., with a
splat of the literal to the appropriate vector size).
2025-01-17 12:11:53 +00:00
Pavel Labath
58fc8029e9 [lldb] Skip TestStepUntilAPI on !x86_64, !aarch64
The compiler does not support this feature on other architectures.
2025-01-17 13:07:06 +01:00
Jan Patrick Lehr
61f94ebc9e
[NFC][Offload] Structure/Readability of CMake cache (#123328)
Preparing to add more config options and want to group them all from
most-common to project / component specific.
2025-01-17 13:01:25 +01:00
Timm Baeder
7075eee6bd
[clang][bytecode] Add InitLinkScope for toplevel Expr temporary (#123319) 2025-01-17 12:58:15 +01:00
Simon Pilgrim
a864906772 [X86] Fix logical operator warnings. NFC. 2025-01-17 11:55:22 +00:00