516869 Commits

Author SHA1 Message Date
Nico Weber
6d8d7a3acd [gn] disable building libc++ shared lib
It's currently broken by #91651. Stop buildling libcxx src files
until that is sorted out.
2024-10-24 10:57:44 -07:00
Thomas Fransham
1fe64fe046
[ORC] Add visibility macros to functions needed by lli and jitlink (#113271)
Annotating these symbols will fix missing symbols errors for lli and
llvm-jitlink when when the LLVM is built as shared library on windows
with explicit symbol visibility macros enabled.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and plugins on
window.
2024-10-24 10:41:34 -07:00
Helena Kotas
af872d5473
[HLSL] Add RWStructuredBuffer definition to HLSLExternalSemaSource (#113477)
Add tests for RWStructuredBuffer class definition. Use shared test files
for all structured buffers' constructor and subscript tests. Keep AST
and element-type tests separate for each buffer type because they longer
and failures would be harder to match.

Fixes #112775
2024-10-24 10:34:04 -07:00
Dimitry Andric
4bce21480f
Ensure !NDEBUG with LLVM_ENABLE_ABI_BREAKING_CHECKS does not segfault (#113588)
In SelectionDAG, `TargetTransformInfo::hasBranchDivergence()` can be
called when both `NDEBUG` and `LLVM_ENABLE_ABI_BREAKING_CHECKS` are
enabled. In that case, the class member `TTI` is still initialized to
`nullptr`, causing a segfault.

Fix this by ensuring that all the calls to `hasBranchDivergence` and
`VerifyDAGDivergence` only occur when `NDEBUG` is disabled, and
`LLVM_ENABLE_ABI_BREAKING_CHECKS` is enabled.
2024-10-24 19:30:38 +02:00
SpencerAbson
87b3c07ae6
[AArch64] Add assembly/disassembly for zeroing FRINT and FRECPX/FSQRT (#113543)
This patch adds assembly/disassembly support for the following
predicated SVE2.2 instructions

    - FRINT32X, FRINT32Z (zeroing)
    - FRINT64X, FRINT64Z (zeroing)
    - FRINT{N,P,M,Z,A,X,I} (zeroing)
    - FRECPX, FSQRT (zeroing)

- Updates the diagnostics tests for existing merging variants of these
instructions.
- In accordance with:
https://developer.arm.com/documentation/ddi0602/latest/
2024-10-24 18:29:05 +01:00
Haojian Wu
100582ed4f
Pass std::initializer_list by value to ArrayRef constructor. (#113590)
The std::initializer_list is a lightweight object, it is passed by value
in general.

This would also avoid a false positive when adding the lifetimebound
annotation (#113547)

```
ArrayRef<int> foo(std::initializer_list<int> list) {
  return ArrayRef<int>(list);
}
```
2024-10-24 19:27:38 +02:00
Krzysztof Parzyszek
e2e7d565bf
[flang][OpenMP] Make Symbol::OmpFlagToClauseName static (#113586)
It doesn't need the Symbol object for anything.
2024-10-24 12:10:18 -05:00
Shilei Tian
5d07162bba
[OpenMP] Fix the test issue when libomp is built as a static library (#113522) 2024-10-24 12:52:17 -04:00
Krzysztof Parzyszek
5d37415a58 Unsupport flang/test/Driver/embed.f90 on Windows
The test fails due to Windows' line-endings, and it's blocking
pre-checkin tests.
2024-10-24 11:45:27 -05:00
Fangrui Song
0ef90bbdef [MCParser] De-capitalize COFFAsmParser functions. NFC 2024-10-24 09:43:57 -07:00
Sander de Smalen
db0e376044
[AArch64] Fix failure with inline asm and svcount (#112537)
This fixes an issue where the compiler runs into an assertion failure
for the following example:

  register svcount_t pred asm("pn8") = svptrue_c8();
  asm("ld1w { z0.s, z4.s, z8.s, z12.s }, %[pred]/z, [x0]\n"
    :
    : [pred] "Uph" (pred)
    : "memory", "cc");

Here the register constraint that ends up in the LLVM IR is "{pn8}", but
the code in `TargetRegisterInfo::getRegForInlineAsmConstraint` that
parses that string, follows a path where it queries a suitable register
class for this register (<=> PPRorPNR regclass), for which it then
chooses `nxv16i1` as a suitable type. These choices individually are
correct, but the combined result isn't, because the type should be
`aarch64svcount`.
This then results in issues later on in SelectionDAGBuilder.cpp in
CopyToReg because the type of the actual value and the computed type
from the constraint don't match.

This PR pre-empts this issue by parsing the predicate explicitly and
returning the correct register class.
2024-10-24 17:41:07 +01:00
Nico Weber
9a8292f914 [gn build] Port 8a12e0131f3d 2024-10-24 09:20:06 -07:00
SpencerAbson
762e65cf84
[AArch64] Add assembly/disassembly for FRINT{32,64}{X,Z} (merging) (#113562)
This patch adds assembly/disassembly support for the following SVE2.2
instructions

    - FRINT32X (merging)
    - FRINT32Z (merging)
    - FRINT64X (merging)
    - FRINT64Z (merging)
- In accordance with:
https://developer.arm.com/documentation/ddi0602/latest/
2024-10-24 17:14:42 +01:00
Nico Weber
2646ce2a22 [gn] port 522f34cfff693fd3f (PPC AsmMatcher dep)
Similar to 4168a2e9de35f. See also comment on #113482.
2024-10-24 09:09:11 -07:00
Alexey Bataev
e914421d7f [SLP]Do correct signedness analysis for externally used scalars
If the scalars is used externally is in the root node, it may have
incorrect signedness info because of the conflict with the demanded bits
analysis. Need to perform exact signedness analysis and compute it
rather than rely on the precomputed value, which might be incorrect for
alternate zext/sext nodes.

Fixes #113520
2024-10-24 08:59:24 -07:00
Nico Weber
907c136388 [gn] port 6512a8d yet more
Follow-up to a21573bb9973 which had a typo.
2024-10-24 08:58:14 -07:00
Louis Dionne
460406affe
[libc++] Exclude C++03 frozen headers from the modulemap (#113572)
This is a temporary patch, eventually these headers should be included
in the modulemap as well.
2024-10-24 11:57:42 -04:00
Nico Weber
a21573bb99 [gn] port 6512a8d more
24293e690 added the files added there, but didn't do the tblgen changes.
2024-10-24 08:52:23 -07:00
Arthur Eubanks
3cec720449
Revert "[DSE] Apply initializes attribute to DSE" (#113589)
Reverts llvm/llvm-project#107282

Seems to be causing invalid analysis caching as mentioned in
https://github.com/llvm/llvm-project/pull/107282#issuecomment-2435083978.
2024-10-24 08:51:31 -07:00
Oliver Stannard
493529fbce Re-land: [ARM] Fix frame chains with M-profile PACBTI (#110285)
When using AAPCS-compliant frame chains with PACBTI return address
signing, there ware a number of bugs in the generation of the frame
pointer and function prologues. The most obvious was that we sometimes
would modify r11 before pushing it to the stack, so it wasn't preserved
as required by the PCS. We also sometimes did not push R11 and LR
adjacent to one another on the stack, or used R11 as a frame pointer
without pointing it at the saved value of R11, both of which are
required to have an AAPCS compliant frame chain.

The original work of this patch was done by James Westwood, reviewed as
 #82801 and #81249, with some tidy-ups done by Mark Murray and myself.
2024-10-24 16:44:16 +01:00
Endre Fülöp
3a2c957c4b
[clang][analyzer][doc] Update Clang SA www docs index.html (#112833)
Downloads and releases sections are removed, users are advised to use
the conventional ways of acquiring the analyzer.
2024-10-24 17:42:54 +02:00
Endre Fülöp
61a76f58eb
[clang][analyzer][doc] Migrate ClangSA www FAQ section (#112831)
The ClangSA documentation lives in RST format, and the FAQ section of
the old webpage is also migrated from HTML with this change.

---------

Co-authored-by: Donát Nagy <donat.nagy@ericsson.com>
2024-10-24 17:37:04 +02:00
Alexey Bataev
d2e7ee77d3 [SLP]Do not check for clustered loads only
Since SLP support "clusterization" of the non-load instructions, the
restriction for reduced values for loads only should be removed to avoid
compiler crash.

Fixes #113516
2024-10-24 08:16:42 -07:00
tltao
0aec4d2b78
[SystemZ] Update large ada tests after HLASM syntax change (#113578)
Fix buildbot failures seen on:
https://lab.llvm.org/buildbot/#/builders/42/builds/1597

caused by:  https://github.com/llvm/llvm-project/pull/113369

Co-authored-by: Tony Tao <tonytao@ca.ibm.com>
2024-10-24 11:02:36 -04:00
Alexey Bataev
cb5046da26 [SLP]Do not ignore undefs when trying to replace with "poisonous" shuffles
Need to consider undefs correctly, when trying to replace them with
potentially poisonous values in shuffles. Such elements should not be
silently replaced by poison values, instead complex analysis should be
implemented to see if it is safe to do it.

Fixes #113425
2024-10-24 07:47:23 -07:00
Eisuke Kawashima
0af6c304e4
[NFC][compiler-rt] fix(compiler-rt/**.py): fix comparison to None (#94015)
from PEP8
(https://peps.python.org/pep-0008/#programming-recommendations):

> Comparisons to singletons like None should always be done with is or
is not, never the equality operators.
2024-10-24 07:32:10 -07:00
Louis Dionne
cb445e8d1d
[cmake] Promote message when failing to find compiler-rt to warning (#111834)
This makes the message stand out a bit more, which can be helpful to
debug situations where compiler-rt is missing but shouldn't.
2024-10-24 10:27:51 -04:00
Louis Dionne
8a7318eb00
[libc++] Refactor vector::push_back to use vector::emplace (#113481)
This removes some duplicate code. I suspect this was originally written
that way because vector::emplace didn't exist in C++03 mode, which
stopped being relevant when Clang implemented rvalue references in
C++03.
2024-10-24 16:19:21 +02:00
Zaara Syeda
f3131c99bf
[GlobalMerge] Aggressively merge constants to reduce TOC entries (#111756)
Symbols that get mapped into the read-only section are loaded as part of
the text segment and will always need a TOC entry to be addressable. Add
an option to aggressively merge these read only globals to reduce TOC
usage.
2024-10-24 10:16:39 -04:00
Nikolas Klauser
2e686d6d17
[libc++] Remove workaround which allows setting _LIBCPP_OVERRIDABLE_FUNC_VIS externally (#113139)
`-fvisibility-global-new-delete` has been added in Clang 18, so there is
no more need to specify the visibility of new/delete via libc++-internal
macros.

Some people used a custom new/delete, which requires them to have
default visibility, but didn't want to leak any symbols otherwise. Since
the new/delete visibility can now be controlled by a compiler flag,
there is no reason to set it with out macro.

https://reviews.llvm.org/D128007 originally tried to remove the option
to override the macro, but was partially reverted because people
actually set this specific macro.
2024-10-24 16:11:34 +02:00
Lei Huang
522f34cfff
[PowerPC] Expand global named register support (#113482)
Enable all valid registers for intrinsics that read from and write
to global named registers.
2024-10-24 10:05:18 -04:00
Simon Tatham
c7aff2ab4c
[libc] Pass through LIBC_CONF_MATH_OPTIMIZATIONS correctly (#113540)
It's checked in a cmake function that builds up a list called
`config_options`. But the check was appending to a list called
`compile_options`, so the intended `-DLIBC_MATH=whatever` didn't end up
on the actual compile command lines.
2024-10-24 14:51:38 +01:00
Simon Pilgrim
b34d64921b [X86] ReplaceNodeResults - adjust assert to allow XOP or GFNI subtargets to split i64 BITREVERSE nodes on 32-bit targets
Fixes #113353
Fixes #113034
2024-10-24 06:39:07 -07:00
Simon Pilgrim
046b87fb3c Fix MSVC not all control paths return a value warning. NFC. 2024-10-24 06:39:07 -07:00
Abid Qadeer
37832d5de2
[flang][debug] Support fir.vector type. (#112951)
This PR converts the `fir.vector<>` to
`DICompositeTypeAttr(DW_TAG_array_type)` with `vector` flag set.
2024-10-24 13:37:32 +01:00
Adrian Kuegel
7e61d89373 [mlir] Apply ClangTidy performance finding
loop variable is copied but only used as const reference
2024-10-24 12:32:49 +00:00
Longsheng Mou
927559d27d
[mlir][vector] Fix a crash in VectorToGPU (#113454)
This PR fixes a crash in `VectorToGPU` when the operand of `extOp` is a
function argument, which cannot be retrieved using `getDefiningOp`.
Fixes #107967.
2024-10-24 20:28:42 +08:00
Abid Qadeer
47c1abf4af
[flang][debug] Fix array lower bounds in derived type members. (#113183)
The lower bound information for the array members of a derived type
can't be obtained from the `DeclareOp`. It has to be extracted from the
`TypeInfoOp`. That was left as FIXME in the code. This PR adds the
missing functionality to fix the issue.

I tried the following approaches before settling on the current one that
is to generate `DITypeAttr` for array members right where the components
are being processed.

1. Generate a temp XDeclareOp with the shift information obtained from
the `TypeInfoOp`. This caused a few issues mostly related to
`unrealized_conversion_cast`.

2. Change the shift operands in the `declOp` that was passed in the
function before calling `convertType`. The code can be seen in the
abcf031a8e5a02f0081e7f293858302e7bf47bec. It essentially looked like the
following. It works correctly but I was not sure if temporarily changing
the `declOp` is the safe thing to do.

```
mlir::OperandRange originalShift = declOp.getShift();
mlir::MutableOperandRange mutableOpRange = declOp.getShiftMutable();
mutableOpRange.assign(shiftOpers);
elemTy = convertType(fieldTy, fileAttr, scope, declOp);
mutableOpRange.assign(originalShift);
```

Fixes #113178.
2024-10-24 13:22:28 +01:00
Stefan Gränitz
76edf72501 Reland: [lldb] Fix crash missing MSInheritanceAttr with DWARF on Windows (#112928)
Member pointers refer to data or function members of a `CXXRecordDecl`,
which require a `MSInheritanceAttr` in order to be complete. Without that
we cannot calculate the size of a member pointer in memory. The attempt
has been causing a crash further down in the clang AST context. In order
to implement the feature, DWARF will need a new attribtue to convey the
information. For the moment, this patch teaches LLDB to handle to
situation and avoid the crash.
2024-10-24 13:47:15 +02:00
Balazs Benics
4affb2d59a
[analyzer] Use dynamic type when invalidating by a member function call (#111138)
When instantiating "callable<T>", the "class CallableType" nested type
will only have a declaration in the copy for the instantiation - because
it's not refereed to directly by any other code that would need a
complete definition.

However, in the past, when conservative eval calling member function, we
took the static type of the "this" expr, and looked up the CXXRecordDecl
it refereed to to see if it has any mutable members (to decide if it
needs to refine invalidation or not). Unfortunately, that query needs a
definition, and it asserts otherwise, thus we crashed.

To fix this, we should consult the dynamic type of the object, because
that will have the definition.
I anyways added a check for "hasDefinition" just to be on the safe side.

Fixes #77378
2024-10-24 13:22:19 +02:00
Krzysztof Parzyszek
ea3534b385
[flang][OpenMP] Parse AFFINITY clause, lowering not supported yet (#113485)
Implement parsing of the AFFINITY clause on TASK construct, conversion
from the parser class to omp::Clause.
Lowering to HLFIR is unsupported, a TODO message is displayed.
2024-10-24 05:54:35 -05:00
Lukacma
9575ab28c1
[AArch64] Update feature dep. for Armv9.6 extensions (#113466)
Co-authored-by: Jonathan Thackray <jonathan.thackray@arm.com>
Co-authored-by: SpencerAbson <Spencer.Abson@arm.com>
2024-10-24 11:52:24 +01:00
Abid Qadeer
c07abf7272
[flang][debug] Support fir::ReferenceType. (#113480) 2024-10-24 11:38:17 +01:00
Benjamin Maxwell
cd0373e029
[AArch64] Allow single-element vector FP converts with +sme2p2 (#112905)
Follow up to #112213 now that the +sme2p2 feature flag has landed. The
single-element vector variants of FCVTZS, FCVTZU, UCVTF, and SCVTF are
allowed in streaming SVE mode with +sme2p2.

Reference:
-
https://developer.arm.com/documentation/ddi0602/2024-09/SIMD-FP-Instructions/FCVTZS--vector--integer---Floating-point-convert-to-signed-integer--rounding-toward-zero--vector--
-
https://developer.arm.com/documentation/ddi0602/2024-09/SIMD-FP-Instructions/UCVTF--vector--integer---Unsigned-integer-convert-to-floating-point--vector--
-
https://developer.arm.com/documentation/ddi0602/2024-09/SIMD-FP-Instructions/SCVTF--vector--integer---Signed-integer-convert-to-floating-point--vector--
2024-10-24 11:21:17 +01:00
David Spickett
76f4f950f6 [lldb][AArch64] Add release note for AArch64 Linux FPMR register 2024-10-24 11:05:21 +01:00
David Spickett
f52b89561f
[lldb][AArch64] Read fpmr register from core files (#110104)
https://developer.arm.com/documentation/ddi0601/2024-06/AArch64-Registers/FPMR--Floating-point-Mode-Register
for details of the register.
2024-10-24 10:27:56 +01:00
Jay Foad
4dd55c567a
[clang] Use {} instead of std::nullopt to initialize empty ArrayRef (#109399)
Follow up to #109133.
2024-10-24 10:23:40 +01:00
Nashe Mncube
e37d736def
Recommit: [llvm][ARM][GlobalOpt]Add widen global arrays pass (#113289)
This is a recommit of #107120 . The original PR was approved but failed
buildbot. The newly added tests should only be run for compilers that
support the ARM target. This has been resolved by adding a config file
for these tests.

- Pass optimizes memcpy's by padding out destinations and sources to a
  full word to make ARM backend generate full word loads instead of
  loading a single byte (ldrb) and/or half word (ldrh). Only pads
  destination when it's a stack allocated constant size array and source
  when it's constant string. Heuristic to decide whether to pad or not
  is very basic and could be improved to allow more examples to be
  padded.
- Pass works at the midend level
2024-10-24 10:12:01 +01:00
Oleksandr T.
61a456bd5a
[Clang] prevent assertion failure in value-dependent initializer expressions (#112612)
Fixes #112140

--- 

```
CXXConstructExpr 0x14209e580 'const S':'const struct S' contains-errors 'void (const int &)' list
`-CXXDefaultArgExpr 0x14209e500 'const int' contains-errors
  `-RecoveryExpr 0x14209daf0 'const int' contains-errors
```

This change resolves an issue with evaluating `ArrayFiller` initializers
in _dependent_ contexts, especially when they involve a `RecoveryExpr`.
In certain cases, `ArrayFiller` initializers containing a `RecoveryExpr`
from earlier errors are incorrectly passed to `EvaluateInPlace`, causing
evaluation failures when they are value-dependent.

When this is the case, the initializer is processed through
`EvaluateDependentExpr`, which prevents unnecessary evaluation attempts
and ensures proper handling of value-dependent initializers in
`ArrayFillers`.
2024-10-24 10:34:58 +02:00
SpencerAbson
17bfd21391
[AArch64] Add assembly/disassembly for multi-vector AES instructions (#113307)
This patch adds assembly/disassembly for the following multi-vector SVE
instructions

      - AESE (two/four registers)
      - AESD (two/four registers)
      - AESDIMC (two/four registers)
      - AESEMC (two/four registers)

- Introduce assembler extension tests for the new Armv9.6 sve-aes2 and
ssve-aes features
- In accordance with:
https://developer.arm.com/documentation/ddi0602/latest/
2024-10-24 09:05:58 +01:00