Commit Graph

455395 Commits

Author SHA1 Message Date
Johannes Doerfert
f2c385934b [OpenMP] Remove shadow pointer map and introduce consistent locking
The shadow pointer map was problematic as we scanned an entire list if
an entry had shadow pointers. The new scheme stores the shadow pointers
inside the entries. This allows easy access without any search. It also
helps us, but also makes it necessary, to define a consistent locking
scheme. The implicit locking of entries via TargetPointerResultTy makes
this pretty effortless, however one has to:

- Lock HDTTMap before locking an entry.
- Do not lock HDTTMap while holding an entry lock.
- Hold the entry lock to read or modify an entry.

The changes to submitData and retrieveData have been made to ensure 2
when the LIBOMPTARGET_INFO flag is used. Most everything else happens by
itself as TargetPointerResultTy acts as a lock_guard for the entry. It
is a little complicated when we deal with multiple entries, especially
as they can be equal. However, one can still follow the rules with
reasonable effort.

LookupResult are now finally also locking the entry before it is
inspected. This is good even if we haven't run into a problem yet.

Differential Revision: https://reviews.llvm.org/D123446
2023-03-21 19:16:27 -07:00
Johannes Doerfert
0153ab6dbc [OpenMP] Remove restriction on the thread count for parallel regions
Differential Revision: https://reviews.llvm.org/D112194
2023-03-21 19:16:13 -07:00
Johannes Doerfert
de9edf4afe [OpenMP] Avoid zero size copies to the device
This unblocks one of the XFAIL tests for AMD, though we need to work
around the missing printf still.

Differential Revision: https://reviews.llvm.org/D146592
2023-03-21 19:16:13 -07:00
Joseph Huber
ebcc6dba5f [libc] Don't install the GPU startup code for now
Summary:
This startup code is only intended to be used internally, we shouldn't
export it under a conflicting name. In the future we may package this in
an exportable format.
2023-03-21 21:01:27 -05:00
Craig Topper
8e43c22d30 [RISCV] Use LBU for extloadi8.
The Zcb extension has c.lbu, but not c.lb. This patch makes us
prefer LBU over LB if we have a choice which will enable more
compression opportunities.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D146270
2023-03-21 18:52:05 -07:00
Jon Chesterfield
78e6818049 [amdgpu][nfc] clang-format AMDGPULowerModuleLDS for easier merging 2023-03-22 01:49:53 +00:00
Philip Reames
c49e56a295 [SCEV] Add coverage for a missing flag inference case 2023-03-21 18:41:18 -07:00
Jon Chesterfield
d70e7ea0d1 [amdgpu][nfc] Extract more functions in LowerModuleLDS, mark more methods static 2023-03-22 01:25:28 +00:00
Kazu Hirata
b9c4b95b11 [llvm] Use ConstantInt::{isZero,isOne} (NFC) 2023-03-21 17:40:35 -07:00
Peiming Liu
2b21327fee [mlir][sparse] fix crash when using pure constant index in indexing mapping (fixes #61530)
To address https://github.com/llvm/llvm-project/issues/61530

Reviewed By: aartbik, wrengr

Differential Revision: https://reviews.llvm.org/D146563
2023-03-21 23:45:20 +00:00
Jon Chesterfield
e8ad2a051c [amdgpu][nfc] Comment and extract two functions in LowerModuleLDS 2023-03-21 23:39:20 +00:00
Alex Langford
5499b026d2 [lldb][CMake] Enforce not linking against plugin libs in core libs
Non-plugin lldb libraries should generally not be linking against lldb
plugin libraries. Enforce this in CMake.

Differential Revision: https://reviews.llvm.org/D146553
2023-03-21 16:24:36 -07:00
wren romano
13e9afd16d [mlir][sparse] Adding new Merger::addLat overload
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D146559
2023-03-21 16:22:04 -07:00
Craig Topper
087b5f3277 [RISCV] Improve validation of opcode for .insn.
The lower 2 bits of the opcode must be 0x3. If the lower 2 bits are
0-2, it's a compressed instruction.

Merge 3 slightly different error messages into 1 to reduce code. The
messages differed slightly depending on whether we parsed a string
or an expression. The message gets a little more generic, but is no
more generic than what binutils prints.
2023-03-21 16:20:30 -07:00
Congcong Cai
696fdece49 [WebAssembly] Fix i64_i64_func_i64_i64_i32 type signature when multivalue feature is enabled
Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D146533
2023-03-22 06:53:54 +08:00
Vitaly Buka
a09283a551 [NFC][tsan] Add __tsan_default_{options,suppressions} into interface header 2023-03-21 15:46:34 -07:00
Artem Belevich
2aa90da012 [CUDA] Update cached kernel handle when the function instance changes.
Fixes clang crash caused by a stale function pointer.

The bug has been present for a pretty long time, but we were lucky not to
trigger it until  D140663.

Differential Revision: https://reviews.llvm.org/D146448
2023-03-21 15:36:12 -07:00
Anlun Xu
c5f6339c12 Add missing dependency for TransformDialect
Differential Revision: https://reviews.llvm.org/D146589
2023-03-21 15:23:23 -07:00
Dave Lee
c327f99254 [lldb] Refactor deduction of the instance variable's name (NFC)
Move responsibility of providing the instance variable name (`this`, `self`) from
`TypeSystem` to `Language`.

`Language` the natural place for this, but also has downstream benefits. Some languages
have multiple `TypeSystem` implementations (ex Swift), and by placing this logic in the
`Language`, redundancy is avoided.

This change relies on the tests from D145348 and D146320.

Differential Revision: https://reviews.llvm.org/D146548
2023-03-21 15:22:07 -07:00
Craig Topper
abe0362dd8 [RISCV] Remove 'rs1' field from RVInst16 class. NFC 2023-03-21 14:58:53 -07:00
yijia1212
51c8c1e1e5 Fix dep error for transform dialect in bazel
Fix dep error for transform dialect in bazel

Reviewed By: anlunx

Differential Revision: https://reviews.llvm.org/D146566
2023-03-21 14:40:43 -07:00
TatWai Chong
08b0977a19 [mlir][tosa] Add check if the operand of the operations is constant.
Some uses of TOSA rely on the constant operands of particular operations,
e.g. paddings and pad_const in pad op. Add a verification pattern in the
validation pass, and this is optionally enabled.

Change-Id: I1628c0840a27ab06ef91150eee56ad4f5ac9543d

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D145412
2023-03-21 20:54:47 +00:00
Aart Bik
a2c63d7f0b [mlir][sparse][gpu] end-to-end test for 2:4 sparsity on NVidia GPUs
Example of using 2:4 sparsity on NVidia GPU

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D145447
2023-03-21 13:32:43 -07:00
Snehasish Kumar
cef71d0105 [memprof] Support symbolization of PIE binaries.
Support symolization of PIE binaries in memprof. We assume that the
profiled binary has one executable text segment for simplicity. Update
the memprof-pic test to now expect the same output as the memprof-basic test.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D146181
2023-03-21 20:13:18 +00:00
Andrew Litteken
e240e6b8b7 [IRSim] Check largest sections first when analyzing similarity
When we check for similarity, right now there is no order to how it is checked, except for via the suffix tree ordering.

We can reduce how much structural analysis we perform by checking the the regions in decreasing size. In doing so, we know that if two large sections match, each of their contained regions also match. This allows us to skip the structural checking for each smaller section. IT does require that we use the large regions as a "bridge" to create the canonical mapping between the two regions.

This reduces compile time significantly for some benchmarks. It will not perform as well for programs with many small items.

Recommit fixes the IRSimilarity tests.

Recommit of: 805ec19d7d

Recommit fixes llvm-sim tests

Recommit of: 082ec26758

Reviewer: paquette
Differential Revision: https://reviews.llvm.org/D139338
2023-03-21 14:49:41 -05:00
Slava Zakharin
ee7b6fd4c1 [flang] Set proper source location for the main function.
Take the source position for the anonymous program from its scope.
If the first evaluation is a construct or directive, then it has
null source position.

Author: vdonaldson
Differential Revision: https://reviews.llvm.org/D146445
2023-03-21 12:32:42 -07:00
Blue Gaston
ae484c21c0 [TSAN][Darwin] Forward declare spinlock functions on darwin for TSAN interceptors
Spinlock symbols are removed from headers in MacOS version 10.12 and greater.
Even though they are deprecated, the symbols remain available on the system.

The TSAN interceptors currently cause a build failure after this version because
of the change in availability of the symbol.

We want to continue intercepting the symbols available on the OS.
So we add forward declarations so that the TSAN interceptors can build.

This is tested with the existing osspinlock_norace test.

Differential Revision: https://reviews.llvm.org/D146537
2023-03-21 12:16:19 -07:00
Arthur Eubanks
852cfc2ed3 [NFC] Fix incorrect comment for simplifyRightShift 2023-03-21 12:05:37 -07:00
Shoaib Meenai
22b5fe7478 [llvm-libtool-darwin] Fix test when libfile.a exists
This can be a valid system library, as reported in
https://reviews.llvm.org/D85540#inline-1415298
2023-03-21 11:20:24 -07:00
Kevin P. Neal
2bd4130362 Update checks in advance of an update to D68233.
In the past, the IR Verifier would bail out at the first broken function
it found. This required trickery with sed to put multiple broken functions
in a single test file.

Now, the Verifier allows for multiple broken functions. The sed trickery
is no longer needed. I've eliminated it.

I've also split the test into two since one of them passes verification
and we need to look at the output IR from 'opt'. The other fails and we
need to look at the diagnostics printed by the Verifier.
2023-03-21 14:15:15 -04:00
Craig Topper
a37df84f99 [SelectionDAG][RISCV] Remove code for handling too small shift type from SimplifyDemandedBits.
This code detected that the type returned from getShiftAmountTy was
too small to hold the constant shift amount. But it used the full
type size instead of scalar type size leading it to crash for
scalable vectors.

This code was necessary when getShiftAmountTy would always
return the target preferred shift amount type for scalars even when
the type was an illegal type larger than the target supported. For
vectors, getShiftAmountTy has always returned the vector type.

Fortunately, getShiftAmountTy was fixed a while ago to detect that
the target's preferred size for scalars is not large enough for the
type. So we can delete this code.

Switched to use getShiftAmountConstant to further simplify the code.

Fixs PR61561.
2023-03-21 11:08:19 -07:00
Hristo Hristov
83542e4764 [libc++][spaceship] Implement operator<=> for duration
Implements parts of [[ https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html | P1614R2 ]]
Implemented `operator<=>` for `std::chrono::duration`

Reviewed By: #libc, Mordante

Differential Revision: https://reviews.llvm.org/D145881
2023-03-21 20:06:42 +02:00
Stefan Gränitz
32baf5c1c2 [lldb][expr] Propagate ClangDynamicCheckerFunctions::Install() errors to caller
I came accross this, because a lot of regression tests were saying:
```
(lldb) p argc
error: expression failed to parse:
error: couldn't install checkers, unknown error
```

With this change, error messages provide more detail:
```
(lldb) p argc
error: expression failed to parse:
error: couldn't install checkers:
error: Couldn't lookup symbols:
  __objc_load
```

I didn't find a case where `Diagnostics()` is not empty. Also it looks like this isn't covered in any test (yet).

Reviewed By: bulbazord, Michael137

Differential Revision: https://reviews.llvm.org/D146541
2023-03-21 19:05:23 +01:00
Arthur Eubanks
fa6ea7a419 [AlwaysInliner] Make legacy pass like the new pass
The legacy pass is only used in AMDGPU codegen, which doesn't care about running it in call graph order (it actually has to work around that fact).

Make the legacy pass a module pass and share code with the new pass.

This allows us to remove the legacy inliner infrastructure.

Reviewed By: mtrofin

Differential Revision: https://reviews.llvm.org/D146446
2023-03-21 11:04:22 -07:00
Alex Langford
2356bf27f7 [lldb][CMake] Enforce not letting lldbUtility link against any other lldb libs
lldbUtility is not supposed to depend on anything else in lldb. Let's
enforce that constraint in CMake rather than hoping something doesn't
slip in under the radar.

Differential Revision: https://reviews.llvm.org/D146473
2023-03-21 11:03:51 -07:00
Arthur Eubanks
2b34d59858 [test] Change DAG to NEXT in pipeline tests
These were made consistent in 951a980dc7.
2023-03-21 10:44:33 -07:00
Dave Lee
3854963854 Recommit [lldb] Change dwim-print to default to disabled persistent results
Change `dwim-print` to now disable persistent results by default, unless requested by
the user with the `--persistent-result` flag.

Ex:

```
(lldb) dwim-print 1 + 1
(int) 2
(lldb) dwim-print --persistent-result on -- 1 + 1
(int) $0 = 2
```

Users who wish to enable persistent results can make and use an alias that includes
`--persistent-result on`.

Updates: To recommit this, both TestPersistentResult.py and TestPAlias.py needed to be
updated, as well as the changes in D146230.

Differential Revision: https://reviews.llvm.org/D145609
2023-03-21 10:42:24 -07:00
Paul Kirth
c819257b7f [llvm][support] Fix ScopedPrinterTest on AIX
The test strings we used for infinity and NAN were not correct on AIX.
This patch creates those dynamically instead of hard-coded.

Reviewed By: abhina.sreeskantharajan

Differential Revision: https://reviews.llvm.org/D146542
2023-03-21 17:36:20 +00:00
Simon Pilgrim
651b4054a0 [DAG] visitABS - use FoldConstantArithmetic to perform constant folding.
Avoid needing to perform extra isConstantIntBuildVectorOrConstantInt checks
2023-03-21 17:23:27 +00:00
Dave Lee
75fdf7fd15 [lldb] Test direct ivar access in objc++ (NFC)
Add an Objective-C++ specific test for direct ivar access. This adds to the existing C++ and ObjC tests, and tests against regression for future refactoring.

Differential Revision: https://reviews.llvm.org/D146320
2023-03-21 10:14:42 -07:00
Arthur Eubanks
006230e10d [test] Remove redundant check prefix from new-pm-thinlto-prelink-pgo-defaults.ll 2023-03-21 10:12:09 -07:00
Jakub Kuderski
2981832501 [ADT] Add llvm::range_size function for generic ranges
This function follows `std::ranges::size` from C++20. It is intended
mainly for generic code that does not know the exact range type.
I did not modify the existing `llvm::size` function because it has a strict
guarantee of O(1) running time, and we cannot guarantee that when we delegate
size check to user-defined size functions.

Use `range_size` to optimize size checks in `zip`* and `enumerate`
functions. Before that, we would have to perform linear scans for ranges
without random access iterators.

This is the last change I have planned in the series that overhauls
`zip`* and `enumerate`.

Reviewed By: dblaikie, zero9178

Differential Revision: https://reviews.llvm.org/D146231
2023-03-21 12:58:18 -04:00
Aaron Ballman
b904e68f13 No longer issue static lambda pedantic warning for pre-c++2b compat
We were accidentally issuing "static lambdas are incompatible with C++
standards before C++2b" with -pedantic because it was an ExtWarn
diagnostic rather than a Warning. This corrects the diagnostic category
and adds some test coverage.

Fixes #61582
2023-03-21 12:49:45 -04:00
Craig Topper
24caf0196d [IndVarSimplify] Remove duplicate call to getSCEV. NFC
We already did this same call on the line before.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D146444
2023-03-21 09:47:07 -07:00
Mark de Wever
fb855eb941 [libc++] Qualifies size_t.
This has been done using the following command

  find libcxx/test -type f -exec perl -pi -e 's|^([^/]+?)((?<!::)size_t)|\1std::\2|' \{} \;

And manually removed some false positives in std/depr/depr.c.headers.

The `std` module doesn't export `::size_t`, this is a preparation for that module.

Reviewed By: ldionne, #libc, EricWF, philnik

Differential Revision: https://reviews.llvm.org/D146088
2023-03-21 17:41:36 +01:00
Philip Reames
00fdd2cb6c [LSR] Don't crash on non-branch terminator in -lsr-term-fold
Reported in https://reviews.llvm.org/D146415.  I rewrote the patch and aded the test case.  Per that report, spec2006.483.xalancbmk crashes without this fix.
2023-03-21 09:30:01 -07:00
Philip Reames
e9df5d62c8 [LSR] Remove a couple stale comments in lsr-term-fold 2023-03-21 09:21:30 -07:00
Arthur Eubanks
511ddfe265 [test] Split up new-pm-thinlto-defaults.ll into prelink and postlink pipelines
They're becoming different enough that it's getting annoying to figure out how allocate check prefixes.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D146486
2023-03-21 09:18:09 -07:00
Congcong Cai
ec2a726a63 [Webassembly][multivalue] update libcall signature for f128 when multivalue feature enabled
further update for [D146271](https://reviews.llvm.org/D146271)

Reviewed By: tlively

Differential Revision: https://reviews.llvm.org/D146499
2023-03-22 00:16:29 +08:00
Andrew Litteken
9baaf4fb26 Revert "[IRSim] Check largest sections first when analyzing similarity"
llvm-sim test still misbehaving on other platforms.

This reverts commit 082ec26758.
2023-03-21 11:12:06 -05:00