458459 Commits

Author SHA1 Message Date
Matthias Springer
4c48f016ef [mlir][Affine][NFC] Wrap dialect in "affine" namespace
This cleanup aligns the affine dialect with all the other dialects.

Differential Revision: https://reviews.llvm.org/D148687
2023-04-20 11:19:21 +09:00
Jun Sha (Joshua)
fbc63e5658 [RISCV] Remove 'sx' when parsing arch string to match the latest ISA manual 2023-04-20 10:19:14 +08:00
Peiming Liu
7864d736cf [mlir][sparse] extend pack operation to support packing a batched COO type
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D148670
2023-04-20 01:35:30 +00:00
Manish Gupta
fc5c1a7676 [mlir][Memref] Fold nvgpu device cp.async on src memref to dst memref
Differential Revision: https://reviews.llvm.org/D148161
2023-04-20 01:09:44 +00:00
Chia-hung Duan
c5c0f9b400 [scudo] Support printing the status of cached blocks
The output looks like,
  Stats: SharedTSDs: 2 available; total 8
    Shared TSD[0]:
      00 (    64): cached:   10 max:   26
      32 ( 65552): cached:    1 max:    2
    Shared TSD[1]:
      No block is cached.

Differential Revision: https://reviews.llvm.org/D148755
2023-04-20 01:08:47 +00:00
Joseph Huber
eece195155 [libc] Fix not using the static library on amdgpu
Summary:
We have a CMake condition to not include this static library on NVPTX
because their linker doesn't support it. There was a typo that made this
trigger on all builds not just the NVPTX ones.
2023-04-19 20:05:30 -05:00
Joseph Huber
a080798fb2 [libc] Test the RPC interface with multiple blocks
The RPC interface can support multiple independent clients. This support
currently only supports many single-thread warps / workgroups
coordinating over a single lock. This patch uses the support added in
the previous patch to test the RPC interface with multiple blocks.

Note that this does not work with multiple threads currently because of
the effect of warps / workgroups executing in lockstep incorrectly. This
will be added later.

Depends on D148485

Reviewed By: lntue, sivachandra

Differential Revision: https://reviews.llvm.org/D148486
2023-04-19 20:02:33 -05:00
Joseph Huber
0bd564a259 [libc] Add a test to directly stimulate the RPC interface
Currently, the RPC interface with the loader is only tested if the other
tests fail. This test adds a direct test that runs a simple integer
increment over the RPC handshake 10000 times.

Depends on https://reviews.llvm.org/D148288

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D148342
2023-04-19 20:02:32 -05:00
Joseph Huber
d0ff5e4030 [libc] Update RPC interface for system utilities on the GPU
This patch reworks the RPC interface to allow more generic memory
operations using the shared better. This patch decomposes the entire RPC
interface into opening a port and calling `send` or `recv` on it.

The `send` function sends a single packet of the length of the buffer.
The `recv` function is paired with the `send` call to then use the data.
So, any aribtrary combination of sending packets is possible. The only
restriction is that the client initiates the exchange with a `send`
while the server consumes it with a `recv`.

The operation of this is driven by two independent state machines that
tracks the buffer ownership during loads / stores. We keep track of two
so that we can transition between a send state and a recv state without
an extra wait. State transitions are observed via bit toggling, e.g.

This interface supports an efficient `send -> ack -> send -> ack -> send`
interface and allows for the last send to be ignored without checking
the ack.

A following patch will add some more comprehensive testing to this interface. I
I informally made an RPC call that simply incremented an integer and it took
roughly 10 microsends to complete an RPC call.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D148288
2023-04-19 20:02:31 -05:00
Peiming Liu
abd66d918a [mlir][sparse] support iteration over compressed-hi dimension level in loop emitter
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D148668
2023-04-20 00:57:08 +00:00
Noah Goldstein
6f1a9ed072 [LIBC] Fix incorrect behavior with pthread_key_t when value was nullptr
We should not call destructor if value is nullptr.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148291
2023-04-19 19:54:56 -05:00
Jim Ingham
de27291e25 Add missing header guards so the modules build will succeed. 2023-04-19 17:24:11 -07:00
LLVM GN Syncbot
812a63a944 [gn build] Port 87cec865979c 2023-04-20 00:13:38 +00:00
Nico Weber
ec91c56102 [gn] Use clang/utils/bundle_resources.py for clang-pseudo too
See https://reviews.llvm.org/D146591#4281023 -- optimistically
assuming that gets done :)
2023-04-19 20:13:00 -04:00
Matt Arsenault
83adfc91e8 ValueTracking: uitofp/sitofp cannot return denormal results 2023-04-19 20:11:34 -04:00
Matt Arsenault
02f647f892 ValueTracking: Handle sign bit of constrained sitofp/uitofp
This is for parity with CannotBeNegativeZero which is close to
droppable.
2023-04-19 20:11:33 -04:00
Matt Arsenault
f6d79ad9eb ValueTracking: Implement computeKnownFPClass for fdiv for nan handling 2023-04-19 20:11:33 -04:00
Matt Arsenault
66a06e285b ValueTracking: Add baseline tests for computeKnownFPClass fdiv handling 2023-04-19 20:11:33 -04:00
Matt Arsenault
e7bcfea622 ValueTracking: Fix backwards handling of fpclass assumes
This was a bit confused because nofpclass expresses the opposite
from what an assume of class expresses. We need to assume
the intersection of assumed classes, which also needs to be inverted
to convert to nofpclass.
2023-04-19 20:11:32 -04:00
Matt Arsenault
11d7daaf03 Attributor: Add baseline tests for nofpclass changes 2023-04-19 20:11:32 -04:00
Matt Arsenault
677b5aca8e ValueTracking: Add more tests for trunc handling in computeKnownFPClass 2023-04-19 20:11:31 -04:00
Matt Arsenault
6dd1ba2061 ValueTracking: Add baseline test for computeKnownFPClass for sqrt 2023-04-19 20:11:31 -04:00
Julian Lettner
f4f588ab0b [TSan] Fix comment describing shadow memory layout
Differential Revision: https://reviews.llvm.org/D148648
2023-04-19 16:56:04 -07:00
Med Ismail Bennani
a4f160dfc1 [lldb] Fix bug to update process public run lock with process state
This patch should address an issue that caused the process public run
lock to not be updated during a process launch/attach when the process
stops.

That caused the public run lock to report its state as running while the
process state is stopped. This prevents the users to interact with the
process (through the command line or via the SBAPI) since it's
considered still running.

To address that, this patch refactors the name of the internal hijack
listeners to a specific pattern `lldb.internal.<action>.hijack` that
are used to ensure that we've attached to or launched a process successfully.

Then, when updating the process public state, after updating the state
value, if the process is not hijacked externally, meaning if the process
doens't have a hijack listener that matches the internal hijack
listeners pattern, we can update the public run lock accordingly.

rdar://108283017

Differential Revision: https://reviews.llvm.org/D148400

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2023-04-19 16:54:57 -07:00
MalavikaSamak
9516419c50 Revert "Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages""
This reverts commit 7bf5f4692ad6f9ba2d5c155f6b630049bb59876f and adding -frtti flag to support PS4/PS5 builds.
2023-04-19 16:53:34 -07:00
NAKAMURA Takumi
a2d1611b7b [CMake] Reduce deps 2023-04-20 08:45:38 +09:00
NAKAMURA Takumi
46f5aaa82c [Bazel] Introduce "//clang:bundle_resources" for D146591 2023-04-20 08:45:37 +09:00
Nathan Sidwell
c3368fbfe8 [BOLT][NFC] Remove exec permission from some tests
These files unnecessarily had execute permission.
2023-04-19 19:42:01 -04:00
Nathan Sidwell
0044647fdc [BOLT] Add bolt-runtime requirement to tests
These tests rely on the	X86 runtime, add the REQUIRES.

Differential Revision: https://reviews.llvm.org/D148737
2023-04-19 19:42:01 -04:00
Michael Jones
b5f0a87686 [libc] Fix strtod hex exponent overflow bug
Same issue as was fixed in commit 3d95323, but for hexadecimal floats.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D148545
2023-04-19 16:32:20 -07:00
Siva Chandra Reddy
9a579d62e8 [libc][math] Remove the unused dp_trig target and tests. 2023-04-19 23:11:34 +00:00
MalavikaSamak
7bf5f4692a Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages"
This reverts commit 777eb4bcfc3265359edb7c979d3e5ac699ad4641.
2023-04-19 16:09:21 -07:00
Butta
8f833f88ab
[CMake] Don't set absolute paths as install runpaths on ELF platforms in llvm_setup_rpath()
If any LLVM subprojects are built separately, the LLVM build directory
LLVM_LIBRARY_DIR is added to both the build and install runpaths in
llvm_setup_rpath(), which is incorrect when installed. Separate the
build and install runpaths on ELF platforms and finally remove the
incorrect call to this function for compiler-rt, as previously attempted
in 21c008d5a5b. That prior attempt was reverted in 959dbd1761c, where it
was said to break the build on macOS and Windows, so I made sure to keep
those platforms the same.

Two examples of incorrect runpaths that are currently added, one from
the latest LLVM 16 toolchain for linux x86_64:

  > readelf -d clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.*so | ag "File:|runpath"
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.asan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.dyndd.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan_aliases.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.hwasan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.memprof.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.scudo_standalone.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.tsan.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_minimal.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]
  File: clang+llvm-16.0.0-x86_64-linux-gnu-ubuntu-18.04/lib/clang/16/lib/x86_64-unknown-linux-gnu/libclang_rt.ubsan_standalone.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/tmp/llvm_release/final/Phase3/Release/llvmCore-16.0.0-final.obj/./lib]

Another is in the Swift toolchain, which builds lldb separately:

  > readelf -d swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/{bin/lldb*,lib/liblldb.so}|ag "File:|runpath"
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb-argdumper
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/bin/lldb-server
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib]
  File: swift-5.9-DEVELOPMENT-SNAPSHOT-2023-03-24-a-ubuntu20.04/usr/lib/liblldb.so
  0x000000000000001d (RUNPATH)            Library runpath: [$ORIGIN/../lib:/home/build-user/build/buildbot_linux/llvm-linux-x86_64/./lib:/home/build-user/build/buildbot_linux/swift-linux-x86_64/lib/swift/linux:$ORIGIN/../lib/swift/linux]

This patch should fix this problem of absolute paths from the build host
leaking out into the toolchain's runpaths.

Differential revision: https://reviews.llvm.org/D146918
2023-04-19 15:56:02 -07:00
MalavikaSamak
777eb4bcfc [-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages
This patch handles unevaluated contexts to ensure no warnings are produced by the machinery
for buffer access made within an unevaluated contexts. However, such accesses must be
considered by a FixableGadget and produce the necessary fixits.

Reviewed by: NoQ, ziqingluo-90, jkorous

Differential revision: https://reviews.llvm.org/D144905
2023-04-19 15:53:21 -07:00
Valentin Clement
376402bef1
[flang][openacc] Add basic lowering to new data operations for acc.enter_data
This is an initial patch that lowers acc.enter_data copyin/create/attach
clauses to the newly added data operand operations. Follow up patches will
add support for array section and derived type and derived type component
as well as support in other data operation.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D148721
2023-04-19 15:52:46 -07:00
Siva Chandra Reddy
2b4efd2a1a [libc][Obvious] Remove an unused "using" declaration. 2023-04-19 22:42:51 +00:00
Craig Topper
d34125a1a8 [TableGen] Use heap allocated arrays instead of vectors for TreePatternNode::Types and ResultPerm. NFC
These vectors are resized in the constructor and never change size.
We can manually allocate two arrays instead.

This reduces the size of TreePatternNode by removing the
unneeded capacity end pointer fields from the std::vector.
2023-04-19 15:22:58 -07:00
Vitaly Buka
3fb4d45866 Revert "[cmake] Explicitly disable download step"
This does not help. The build is broken because compiler-rt-clear
deletes cmake generated files in STAMP_DIR/

This reverts commit da89ed99a16920e5986b14853d297322ccf7109e.
2023-04-19 15:14:35 -07:00
Razvan Lupusoru
70bd2b8b35 [mlir][openacc] Refine data operation data clause attribute
The data operations added in D148389 hold two data clause fields:
"dataClause" and "decomposedFrom". However, in most cases, dataClause
field holds a default value (except for acc_copyin_readonly,
acc_create_zero, and acc_copyout_zero).

The decomposedFrom field holds the original clause specified by user.
As work began on lowering to these new operations [1], it seems that
having both fields adds a bit of ambiguity. There is only one scenario
where we actually intended to use both:
acc data copyout(zero:)

The original intent was that this clause would be decomposed to
the following operations:
acc.create {dataClause = acc_create_zero, decomposedFrom =
acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

However, we can encode the zero semantics like so without need of both:
acc.create {dataClause = acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

Thus get rid of the decomposedFrom field and update verifier checks
to check for all data clauses that can be decomposed to the particular
operation.

So now the dataClause holds the original user's clause which simplifies
understanding of the operation.

[1] https://reviews.llvm.org/D148721

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D148731
2023-04-19 15:06:21 -07:00
Alex Langford
96a800c07f [lldb] Change setting descriptions to use StringRef instead of ConstString
These probably do not need to be in the ConstString StringPool as they
don't really need any of the advantages that ConstStrings offer.
Lifetime for these things is always static and we never need to perform
comparisons for setting descriptions.

Differential Revision: https://reviews.llvm.org/D148679
2023-04-19 14:45:02 -07:00
Martin Storsjö
3125af2b6b [compiler-rt] [test] [profile] Avoid issues with an implicit .exe suffix
Mingw toolchains implicitly add an .exe suffix if the output linked
file doesn't have a suffix. In many cases the extra suffix doesn't
cause any issues, but in some tests, this discrepancy between expected
output file name and actual output file does affect the tests.

In one test, a rm command fails to remove the executable since it
doesn't have the expected name. By failing to remove the executable, the
later llvm-profdata command tries to read the executable as if it was
a profile data file.

In another test, when the Python executor executes commands, it can
resolve executable names without the extra .exe suffix for absolute
paths (when most binaries are executed as e.g. "%t/foo"), but it fails
to resolve the executables for relative paths such as "./foo". Making
the paths absolute by using %t here shouldn't affect what the test tries
to validate.

Differential Revision: https://reviews.llvm.org/D148169
2023-04-20 00:35:20 +03:00
Vasileios Porpodas
a72bcc1252 [SLP][NFC] Test showing a cost estimation issue caused by f82eb7e066f322a231627383fc80522d98ce6181
The buildvector cost for the case shown in the test should be 0 but it is -1, causing the code to get vectorized, whenit shouldn't.

Differential Revision: https://reviews.llvm.org/D148732
2023-04-19 14:32:16 -07:00
Louis Dionne
87cec86597 [libc++] Remove symbols for a std::allocator_arg & friends from the dylib
This patch removes the symbols defined in the library for std::allocator_arg,
std::defer_lock, std::try_to_lock, std::adopt_lock, and std::piecewise_construct.
Those were defined in the library because we provided them in C++03 as an
extension, and in C++03 it was impossible to define them as `constexpr`
variables, like in the spec.

This is technically an ABI break since we are removing symbols from the
library. However, in practice, only programs compiled in C++03 mode who
take the address of those objects (or pass them as a reference) will have
an undefined ref to those symbols. In practice, this is expected to be
rare. First, those are C++11 features that we happen to provide in C++03,
and only the C++03 definition can potentially lead to code referencing
the dylib definition. So any code that is using these objects but compiling
in C++11 mode (as they should) is not at risk. Second, all uses of these
types in the library is done by passing those types by value to a function
that can get inlined. Since they are empty types, the compiler won't
generate an undefined reference if passed by value, since there's nothing
to pass anyway.

Long story short, the risk for code actually containing an undefined
reference to one of these types is rather small (but non-zero). I also
couldn't find any app on the App Store that referenced these symbols,
which supports my impression that this won't be an issue in practice.

Differential Revision: https://reviews.llvm.org/D145587
2023-04-19 17:27:14 -04:00
Alex Langford
77e3914be7 [lldb][NFCI] Stop creating additional temporary string in Log::VAPrintf
Instead of creating a std::string from the `SmallString`,
let's just use a std::string from the start. I initially tried to make
`SmallString` work but getting it right proved complicated because
`LogHandler::Emit` will take its `StringRef` parameter and touch the raw
`const char *` from it directly, which isn't guaranteed to be
null-terminated with a `SmallString`.

I changed `WriteMessage` to take a `StringRef` instead of a
`const std::string &` for flexibility.

Differential Revision: https://reviews.llvm.org/D148676
2023-04-19 14:16:12 -07:00
Teresa Johnson
16036f6cc9 [MemProf] Fix bot failure about missing return value along all paths
Fixes warning treated as error from
https://lab.llvm.org/buildbot/#/builders/13/builds/34440:
  'llvm::LibCallSimplifier::optimizeNew': not all control paths return a value
after a35206d78280e0ebcf48cd21bc5fff5c3b9c73fa.

Change assert in default case to a return nullptr, so we have a
reasonable fallback if invoked on a different library function, and no
longer get the above warning.
2023-04-19 14:09:05 -07:00
Scott Linder
7f596bb509 [DebugInfo] printCompactDWARFExpr: don't assert on stack size
Gracefully handle non-1 stack sizes in printCompactDWARFExpr rather than
assert. Add support for DW_OP_nop and test the zero-sized stack case.

This is intended to be nearly NFC.

Differential Revision: https://reviews.llvm.org/D147269
2023-04-19 20:46:18 +00:00
Scott Linder
a4fb7f60e2 [HeterogeneousDWARF] Update encodings in AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst
Repurpose the DW_OP_LLVM_aspace_implicit_pointer encoding (0xe9) as the
encoding for a new operation DW_OP_LLVM_user which prefixes all other
new operations.

Differential Revision: https://reviews.llvm.org/D147265
2023-04-19 20:40:21 +00:00
Teresa Johnson
a35206d782 [MemProf] Optionally pass hot/cold hints to operator new
Optionally (off by default) replace operator new() calls marked with a
hot or cold memprof attribute with an operator new() call that takes a
hot_cold_t parameter.

Currently this is supported by the open source version of tcmalloc, see:
https://github.com/google/tcmalloc/blob/master/tcmalloc/new_extension.h

Differential Revision: https://reviews.llvm.org/D148718
2023-04-19 13:33:46 -07:00
Joseph Huber
24214832fd [libc] Fix nvptx_options variable not being reset in CMake
Summary:
This variable was not being reset, which caused the options to be
compounded when building multiple architectures. This was very
problematic as the architectures are not compatible.
2023-04-19 15:28:26 -05:00
Louis Dionne
59736ceb8d [libc++abi] Make the error message for recursive initialization of function-local statics more explicit
The new message is a bit verbose, but it makes it clearer that this isn't
a problem in libc++abi, but instead a problem in the user's code. Otherwise,
we get bugs sent down to libc++abi because people see this message in their
crash logs.

Differential Revision: https://reviews.llvm.org/D148630
2023-04-19 16:18:14 -04:00