492475 Commits

Author SHA1 Message Date
Michael Maitland
2f400a2fd7
[GISEL] Add G_VSCALE instruction (#84542) 2024-03-12 20:22:49 -04:00
Jason Molenda
e2468bf16a [lldb][debugserver] Update flags past to app launch request
rdar://117421999
2024-03-12 17:19:46 -07:00
Zahi Moudallal
accfbf4e49
[MLIR][ROCDL] Add BallotOp and lit test (#84856) 2024-03-12 17:07:16 -07:00
Petr Hosek
bb5921e2a2
[libc] Include FP_* macros in math.h (#84996)
These are used unconditionally by libc++ math.h.

This is related to issue #84879.
2024-03-12 17:01:29 -07:00
Adrian Prantl
64111831ed Relax test to work with newer versions of lldb 2024-03-12 17:01:15 -07:00
Peiming Liu
94e27c265a
[mlir][sparse] reuse tensor.insert operation to insert elements into … (#84987)
…a sparse tensor.
2024-03-12 16:59:17 -07:00
Aiden Grossman
1c3b15e9f5 [llvm-exegesis] Use LLVM Support to get thread ID
This patch switches from manually using the Linux syscall to get the
current thread ID to using the relevant LLVM Support libraries that
abstract over the low level system details.
2024-03-12 16:55:01 -07:00
Aiden Grossman
8003f553a0 Reland "[llvm-exegesis] Add thread IDs to subprocess memory names (#84451)"
This reverts commit aefad27096bba513f06162fac2763089578f3de4.

This relands commit 6bbe8a296ee91754d423c59c35727eaa624f7140.

This patch was casuing build failures on non-Linux platforms due to the
default implementations for the functions not being updated. This ended
up causing out-of-line definition errors. Fixed for the relanding.
2024-03-12 16:35:05 -07:00
anbbna
65f07b804c
[MIPS] Introduce NAL instruction support for Mipsr6 and prer6 (#84429)
NAL is an assembly idiom on Pre-R6 instruction sets (which is
implemented in binutils), or an actual instruction on Release 6
instruction set, and is used to read the PC, due to the nature of the
MIPS architecture.

Since we can't read the PC directly, on pre-R6 we use a always-not-taken
Branch and Link operation to the address of the next instruction, which
effectively writes the address to $31, thus PC is read with offset +8.

MIPS Release 6 removed the conventional Branch and Link instructions,
but kept NAL as an actual instruction for compatibility on the assembly
level. The instruction has the same encoding of the pre-R6 ones, and
with the same behavior: PC + 8 -> $31.
2024-03-13 07:27:18 +08:00
Adrian Prantl
418f0066eb Modernize llgdb script and make it easier to debug. 2024-03-12 16:12:19 -07:00
Adrian Prantl
422d240dc9 Relax tests to also work with newer versions of lldb.
- result variables are optional
- static members may print their values
- public/protected shows up in ptype output
2024-03-12 16:12:19 -07:00
Maksim Panchenko
fd32e744a5
[BOLT] Add support for Linux kernel PCI fixup section (#84982)
.pci_fixup section contains a table with entries allowing to invoke a
fixup hook whenever a problem is encountered with a PCI device. The
hookup code typically points to the start of a function. As we are not
relocating functions in the kernel (at least not yet), verify this
assumption while reading the table and ignore any functions with a fixup
code in the middle.
2024-03-12 15:52:27 -07:00
Dave Clausen
47625e47db
Fix race in the implementation of __tsan_acquire() (#84923)
`__tsan::Acquire()`, which is called by `__tsan_acquire()`, has a
performance optimization which attempts to avoid acquiring the atomic
variable's mutex if the variable has no associated memory model state.

However, if the atomic variable was recently written to by a
`compare_exchange_weak/strong` on another thread, the memory model state
may be created *after* the atomic variable is updated. This is a data
race, and can cause the thread calling `Acquire()` to not realize that
the atomic variable was previously written to by another thread.

Specifically, if you have code that writes to an atomic variable using
`compare_exchange_weak/strong`, and then in another thread you read the
value using a relaxed load, followed by an
`atomic_thread_fence(memory_order_acquire)`, followed by a call to
`__tsan_acquire()`, TSAN may not realize that the store happened before
the fence, and so it will complain about any other variables you access
from both threads if the thread-safety of those accesses depended on the
happens-before relationship between the store and the fence.

This change eliminates the unsafe optimization in `Acquire()`. Now,
`Acquire()` acquires the mutex before checking for the existence of the
memory model state.
2024-03-12 15:36:48 -07:00
Michael Buch
88bf64097e
[lldb][test] TestExprCompletion.py: add tests for completion of reserved identifiers (#84890) 2024-03-12 22:19:27 +00:00
Michael Buch
beb47e78be
[clang][CodeCompletion] Allow debuggers to code-complete reserved identifiers (#84891) 2024-03-12 22:19:09 +00:00
Mehdi Amini
76f3a084e7
Update GettingStarted.rst doc with negative refspec to filter user branches (#75015)
This allows to keep fetching release branches as well.
2024-03-12 15:18:47 -07:00
Stefan Gränitz
d73c2d5df2 Fix unittest after #84460: only applicable if the platform supports JIT 2024-03-12 23:14:23 +01:00
Daniel Paoliello
1a6ec906fb
[Arm64EC] Copy import descriptors to the EC Map (#84834)
As noted in <https://github.com/llvm/llvm-project/pull/78537>, MSVC
places import descriptors in both the EC and regular map - that PR moved
the descriptors to ONLY the regular map, however this causes linking
errors when linking as Arm64EC:

```
bcryptprimitives.lib(bcryptprimitives.dll) : error LNK2001: unresolved external symbol __IMPORT_DESCRIPTOR_bcryptprimitives (EC Symbol)
```

This change copies import descriptors from the regular map to the EC
map, which fixes this linking error.
2024-03-12 14:10:49 -07:00
Changpeng Fang
498b7d2f86
AMDGPU: Copy TSFlags from Pseudo to DS_Real (#84977)
We need TSFalgs from pseudo to real.
2024-03-12 14:02:20 -07:00
Jason Eckhardt
e9492ccae0
[TableGen] DecoderEmitter clean-ups and modernization. (#84832)
The decoder emitter is showing some signs of age. This patch makes a few
kinds of clean-ups:
- Use ranged-for more widely, including using enumerate() for those
loops maintaining a loop index along with the items.
- Reduce the number of arguments to fieldFromInsn (removes an out
reference parameter: CodingStandards). The insn_t argument to insnWithID
can/should probably be removed soon too since modern C++ allows us to
return a local container without a copy.
- Use raw strings for the large emitted code segments. This enhances
both readability and modifiability.
2024-03-12 16:01:58 -05:00
S. Bharadwaj Yadavalli
54f631d116
[DirectX][NFC] Model precise overload type specification of DXIL Ops (#83917)
Implement an abstraction to specify precise overload types supported by
DXIL ops. These overload types are typically a subset of LLVM
intrinsics.

Implement the corresponding changes in DXILEmitter backend.

Add tests to verify expected errors for unsupported overload types at
code generation time.

Add tests to check for correct overload error output.
2024-03-12 16:51:18 -04:00
Daniel Thornburgh
2377beba8d [Fuchsia] Add LLDB_TEST_USE_VENDOR_PACKAGES to boostrap passthrough 2024-03-12 13:33:12 -07:00
Alexey Bataev
97fb91ee66 [SLP][NFC]Add a test with non-profitable alternate vectorized
instructions.
2024-03-12 12:56:35 -07:00
Justin Lebar
6095f8bbc4
Get rid of noisy debug log in verifyOpAndAdjustFlags. (#84677)
This debug log adds noise to a large fraction of *other* debug logs when
you run with -debug, because it prints "Verifying operation: blah blah\n"
whenever those other debug logs dump an op.

You can use -debug-only to get around this, but sometimes -debug really
is what's called for!
2024-03-12 12:52:31 -07:00
Arthur Eubanks
6bbb73b4cb
[X86] Fix determining if globals with size <8 bits are large (#84975)
Previously any global under 8 bits would accidentally be considered 0
sized, which is considered a large global.
2024-03-12 12:43:29 -07:00
Cyndy Ishida
a38b7a432d
[InstallAPI] Break up headers and add common header for TextAPI types (#84960)
Before it gets too unwieldy, add a common header for all MachO types
that are used across InstallAPI. Also, break up the types in
`InstallAPI/Frontend`. This both avoids circular dependencies and is
logically easier to maintain as more functionality gets added.
2024-03-12 12:37:17 -07:00
Arthur Eubanks
45219702e7 [test][X86] Precommit test for large data threshold and i1 global 2024-03-12 19:08:40 +00:00
Han-Chung Wang
7c83d1bd61
[mlir][vector] Use inferRankReducedResultType for subview type inference. (#84395)
Fixes https://github.com/openxla/iree/issues/16475
2024-03-12 11:46:05 -07:00
Jonathan Peyton
6272500e0b
[OpenMP] Remove unused logical/physical CPUID information (#83298) 2024-03-12 11:37:01 -07:00
Jonathan Peyton
3303be63fc
[OpenMP] Make sure mask is set to nullptr (#83299) 2024-03-12 11:36:43 -07:00
Jonathan Peyton
f5334f5da5
[OpenMP] Add debug checks for divide by zero (#83300) 2024-03-12 11:36:19 -07:00
David Blaikie
9ac0315898 Add comment to assert from a843f26 2024-03-12 18:28:30 +00:00
Noah Goldstein
5ca325e49c [InstCombine] Detect (x ^ -x) as a ~Mask
Proof: https://alive2.llvm.org/ce/z/TAFmPw

This is a lemma for clearing up some of the regressions that #84688
causes.

Closes #84868
2024-03-12 13:26:18 -05:00
Noah Goldstein
377da51546 [InstCombine] Add test for detecting (x ^ -x) as a ~Mask; NFC 2024-03-12 13:26:18 -05:00
David Blaikie
a843f26a77
[NFC] SLVectorizer comparator refactoring that preserves behavior (#84966)
Spinning off from #79321 / 35f4592 - looked like the comparator could be
simplified & made more clear/less risk of leaving hidden bugs.
2024-03-12 11:25:12 -07:00
amilendra
42ecccfe34
[libcxx] Fix incorrect type in the has-1024-bit-atomics feature test (#84904) 2024-03-12 14:17:13 -04:00
Adrian Prantl
536e0ebaaa Remove XFAIL from tests passing on green dragon 2024-03-12 11:06:23 -07:00
Fangrui Song
f1ca2a0967
[ELF] Add --compress-section to compress matched non-SHF_ALLOC sections
--compress-sections <section-glib>=[none|zlib|zstd] is similar to
--compress-debug-sections but applies to broader sections without the
SHF_ALLOC flag. lld will report an error if a SHF_ALLOC section is
matched. An interesting use case is to compress `.strtab`/`.symtab`,
which consume a significant portion of the file size (15.1% for a
release build of Clang).

An older revision is available at https://reviews.llvm.org/D154641 .
This patch focuses on non-allocated sections for safety. Moving
`maybeCompress` as D154641 does not handle STT_SECTION symbols for
`-r --compress-debug-sections=zlib` (see `relocatable-section-symbol.s`
from #66804).

Since different output sections may use different compression
algorithms, we need CompressedData::type to generalize
config->compressDebugSections.

GNU ld feature request: https://sourceware.org/bugzilla/show_bug.cgi?id=27452

Link: https://discourse.llvm.org/t/rfc-compress-arbitrary-sections-with-ld-lld-compress-sections/71674

Pull Request: https://github.com/llvm/llvm-project/pull/84855
2024-03-12 10:56:14 -07:00
Simon Pilgrim
c1af6ab505 [X86] getFauxShuffleMask - recognise CONCAT(SUB0, SUB1) style patterns
Handles the INSERT_SUBVECTOR(INSERT_SUBVECTOR(UNDEF,SUB0,0),SUB1,N) pattern

Currently limited to v8i64/v8f64 cases as only AVX512 has decent cross lane 2-input shuffles, the plan is to relax this as I deal with some regressions
2024-03-12 17:40:19 +00:00
Jun Wang
c4e517f59c
[AMDGPU] Adding the amdgpu_num_work_groups function attribute (#79035)
A new function attribute named amdgpu_num_work_groups is added. This
attribute, which consists of three integers, allows programmers to let
the compiler know the number of workgroups to be launched in each of the
three dimensions and do optimizations based on that information.

---------

Co-authored-by: Jun Wang <jun.wang7@amd.com>
2024-03-12 10:30:39 -07:00
Hiroshi Yamauchi
93503aafcd
Fix MSVC build issues (#84362)
MSVC fails when there is ambiguity (multiple options) around implicit
type conversion operators.

Make ConstString's conversion operator to string_view explicit to avoid
ambiguity with one to StringRef and remove an unused local variable that
MSVC also fails on.
2024-03-12 10:26:44 -07:00
Diego A. Estrada Rivera
7bee91fadf
[analyzer][NFC] Turn NodeBuilderContext into a class (#84638)
From issue #73088. I changed `NodeBuilderContext` into a class.
Additionally, there were some other mentions of the former being a
struct which I also changed into a class. This is my first time working
with an issue so I will be open to hearing any advice or changes that
need to be done.
2024-03-12 18:21:31 +01:00
Simon Pilgrim
683a9ac803 [X86] combineVectorPack - use APInt::truncSSat for PACKSS constant folding. NFC.
Unfortunately PACKUS can't use APInt::truncUSat
2024-03-12 17:10:27 +00:00
Mark de Wever
e09761944c
[libc++] Improves UB handling in ios_base destructor. (#76525)
Destroying an ios_base object before it is properly initialized is
undefined behavior. Unlike typical C++ classes the initialization is not
done in the constructor, but in a dedicated init function. Due to
virtual inheritance of the basic_ios object in ostream and friends this
undefined behaviour can be triggered when inheriting from classes that
can throw in their constructor and inheriting from ostream.

Use the __loc_ member of ios_base as sentinel to detect whether the
object has or has not been initialized.

Addresses https://github.com/llvm/llvm-project/issues/57964
2024-03-12 18:04:14 +01:00
Matt Arsenault
bd72ebd8d1
AMDGPU: Add some more mfma hazard recognizer tests (#84727) 2024-03-12 22:05:47 +05:30
XChy
c8cc7903b3
[SelectionDAG] Replace some basic patterns in visitADDLike with SDPatternMatch (#84759)
Resolves #84745.

Based on SDPatternMatch introduced by #78654, this patch replaces some
of basic patterns in `visitADDLike` with corresponding patterns in
SDPatternMatch.

This patch only replaces original folds, instead of introducing new ones.
2024-03-13 00:33:50 +08:00
Balazs Benics
fe8cf2fc90
[clang][ASTMatchers] Fix forEachArgumentWithParam* for deducing "this" operator calls (#84887)
This is a follow-up commit of #84446.
In this patch, I demonstrate that `forEachArgumentWithParam` and
`forEachArgumentWithParamType` did not correctly handle the presence of
the explicit object parameter for operator calls.

Prior to this patch, the matcher would skip the first (and only)
argument of the operator call if the explicit object param was used.

Note that I had to move the definition of
`isExplicitObjectMemberFunction`, to be declared before the matcher I
fix to be visible.

I also had to do some gymnastics for passing the language standard
version command-line flags to the invocation as
`matchAndVerifyResultTrue` wasn't really considered for non-c++11 code.
See the that it always prepends `-std=gnu++11` to the command-line
arguments. I workarounded it by accepting extra args, which get
appended, thus possibly overriding the hardcoded arguments.

I'm not sure if this qualifies for backporting to clang-18 (probably not
because its not a crash, but a semantic problem), but I figure it might
be useful for some vendors (like us).
But we are also happy to cherry-pick this fix to downstream. Let me know
if you want this to be backported or not.

CPP-5074
2024-03-12 17:31:22 +01:00
Mark de Wever
af21659c8c
[libc++][CI] Installs tzdata package in Docker. (#84643)
This allows testing the time zone information in the CI. This is needed
to let https://github.com/llvm/llvm-project/pull/82108 pass the CI.
2024-03-12 17:28:15 +01:00
Mark de Wever
65eea3e5dc
[libc++][TZDB] Fixes parsing interleaved rules. (#84808)
Typically the rules in the database are contiguous, but that is not a
requirement. This fixes the case when they are not.

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2024-03-12 17:26:39 +01:00
Jake Egan
fa1d13590c [AIX][tests] Disable failing tests on AIX
These new tests are failing on the AIX bot because the -I option isn't supported.

Disable these tests for now until they can be fixed.
2024-03-12 12:11:18 -04:00