LLVM GN Syncbot [Thu, 20 Apr 2023 14:25:08 +0000 (14:25 +0000)]
[gn build] Port
4bc6499f8843
Aaron Ballman [Thu, 20 Apr 2023 14:20:54 +0000 (10:20 -0400)]
[C11] Allow casting to an _Atomic-qualified type
We were failing to strip off atomic qualification when forming the cast
destination type, but properly stripping off cvr qualification. Now we
accept atomic, qualified, or unqualified destination types.
Note: the semantics of the cast still drop the qualifier, so such a
cast does not result in an atomic rvalue.
Fixes https://github.com/llvm/llvm-project/issues/39596
Matt Arsenault [Thu, 20 Apr 2023 12:00:02 +0000 (08:00 -0400)]
AMDGPU: Fix assertion with multiple uses of f64 fneg of select
A bitcast needs to be inserted back to the original type. Just
skip the multiple use case for a safer quick fix. Handling
the multiple use case seems to be beneficial in some but not
all cases.
OCHyams [Thu, 20 Apr 2023 13:51:58 +0000 (14:51 +0100)]
Reapply D146987 "[Assignment Tracking] Enable by default"
See https://discourse.llvm.org/t/rfc-enable-assignment-tracking/69399
This sets the -Xclang -fexperimental-assignment-tracking flag to the value
enabled which means it will be enabled so long as none of the following are
true: it's an LTO build, LLDB debugger tuning has been specified, or it's an O0
build (no work is done in any case if -g is not specified or -gmlt is used).
This reverts commit
a65ca4546b9ee042d6c40149d3f820893edbd766 which reverts
https://reviews.llvm.org/D146987
Nikolas Klauser [Sun, 16 Apr 2023 15:22:02 +0000 (17:22 +0200)]
[libc++][NFC] Remove one apply_cv implementation
Reviewed By: #libc, ldionne
Spies: arichardson, libcxx-commits
Differential Revision: https://reviews.llvm.org/D148468
zhangyi1357 [Thu, 20 Apr 2023 10:13:44 +0000 (12:13 +0200)]
[Clangd] Make the type hint length limit configurable
This commit is about clangd's type name hint length limit. The past behavior was 32 characters fixed limit. It is now configurable.
Projects can now add the following config fragment to their .clangd:
```
InlayHints:
TypeNameLimit: 34
```
Ref: [[ https://github.com/clangd/clangd/issues/1357 | Make the type hint length limit configurable ]]
Reviewed By: hokein
Differential Revision: https://reviews.llvm.org/D147395
OCHyams [Thu, 20 Apr 2023 12:51:06 +0000 (13:51 +0100)]
[NFC] Return unique dbg intrinsics from findDbgValues and findDbgUsers
The out-param vector from findDbgValues and findDbgUsers should not include
duplicates, which is possible if the debug intrinsic uses the value multiple
times. This filter is already in place for multiple uses in a `DIArgLists`;
extend it to cover dbg.assigns too because a Value may be used in both the
address and value components.
Additionally, refactor the duplicated functionality between findDbgValues and
FindDbgUsers into a new function findDbgIntrinsics.
Reviewed By: jmorse, StephenTozer
Differential Revision: https://reviews.llvm.org/D148788
Nikita Popov [Thu, 20 Apr 2023 12:33:06 +0000 (14:33 +0200)]
[LangRef] Update list of supported constant expressions (NFC)
For binary ops explicitly list all supported ops, as it's no
longer all of them.
Nikita Popov [Thu, 20 Apr 2023 12:20:43 +0000 (14:20 +0200)]
Revert "[ORC][LLJIT] Use JITLink by default on ELF/x86-64."
This reverts commit
85c649bc02a6605f541b09b33a200a78275ed90f.
Has been causing test failures in OrcV2Examples for the past few
days.
Nikita Popov [Wed, 22 Mar 2023 10:53:01 +0000 (11:53 +0100)]
Reapply [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating
This exposed another miscompile in GVN, which was fixed by
20e9b31f88149a1d5ef78c0be50051e345098e41.
-----
After D141386, violation of nonnull, range and align metadata
results in poison rather than immediate undefined behavior,
which means that these are now safe to retain when speculating.
We only need to remove UB-implying metadata like noundef.
This is done by adding a dropUBImplyingAttrsAndMetadata() helper,
which lists the metadata which is known safe to retain on speculation.
Differential Revision: https://reviews.llvm.org/D146629
Andrew Gozillon [Thu, 20 Apr 2023 12:05:17 +0000 (07:05 -0500)]
[Flang][MLIR] Alter Fir.GlobalOp to print and lower external attributes
Fir.GlobalOp's currently do not respect attributes that
are applied to them, this change will do two things:
- Allow lowering of arbitrary attributes applied to
Fir.GlobalOp's to LLVMGlobalOp's during CodeGen
- Allow printing and parsing of arbitrarily applied attributes
This allows applying other dialects attributes (or other
fir attributes) to fir.GlobalOps on the fly and have them
exist in the resulting LLVM dialect IR or FIR IR.
Reviewer: jeanPerier
Differential Revision: https://reviews.llvm.org/D148352
Aaron Ballman [Thu, 20 Apr 2023 12:01:23 +0000 (08:01 -0400)]
[C11] Allow initialization of an atomic-qualified pointer from a null pointer constant
The relevant language rule from C11 is 6.5.16.1p1: "the left operand is
an atomic, qualified, or unqualified pointer, and the right is a null
pointer constant; or". We correctly handled qualified or unqualified
pointer types, but failed to handle atomic-qualified pointer types. Now
we look through the atomic qualification before testing the constraint
requirements.
Fixes https://github.com/llvm/llvm-project/issues/49563
Differential Revision: https://reviews.llvm.org/D148730
Louis Dionne [Wed, 19 Apr 2023 19:56:06 +0000 (15:56 -0400)]
[libc++] Adjust D_LIBCPP_ENABLE_ASSERTIONS defines in exception_guard tests
For the assert.FOO.pass.cpp test, we should be passing _LIBCPP_ENABLE_ASSERTIONS=1
for consistency, even though -D_LIBCPP_ENABLE_ASSERTIONS is equivalent.
For the other test, we shouldn't be forcing assertions to be enabled,
since we already have a CI job that enables assertions by default and
will do the right thing.
Differential Revision: https://reviews.llvm.org/D148736
Guillaume Chatelet [Thu, 20 Apr 2023 11:35:43 +0000 (11:35 +0000)]
[libc] use -O3 to compile memory functions
Tobias Gysi [Thu, 20 Apr 2023 11:27:33 +0000 (11:27 +0000)]
[mlir][llvm] Improve access group import handling.
In particular, do not drop all access groups of a loop annotation
if one of them is unused. This change makes the access group import
robust against stale access group references in loop metadata.
Reviewed By: Dinistro
Differential Revision: https://reviews.llvm.org/D148791
Owen Pan [Thu, 20 Apr 2023 03:10:00 +0000 (20:10 -0700)]
[clang-format] Hanlde leading whitespaces for JSON files
Fixes #62228.
Fixes #62229.
Differential Revision: https://reviews.llvm.org/D148777
Momchil Velikov [Thu, 20 Apr 2023 10:51:23 +0000 (11:51 +0100)]
[FuncSpec] Relax restrictions on candidates for specialisation
Allow a function to be specialised even if it has its address taken or
it's global. For such functions, consider all of the arguments as
overdefined. Don't delete the functions even if all the apparent calls
were redirected to specialised instances.
Reviewed By: labrinea, ChuanqiXu
Differential Revision: https://reviews.llvm.org/D148345
Matt Arsenault [Sun, 8 Jan 2023 17:05:27 +0000 (12:05 -0500)]
AMDGPU: Really invert handling of enqueued block detection
Remove the broken call graph analysis in the block enqueue lowering
pass. The previous iteration was reverted due to a runtime bug when
the completion action was unconditionally enabled.
Nikita Popov [Thu, 20 Apr 2023 10:23:36 +0000 (12:23 +0200)]
[GVN] Fix metadata combining for non-local loads
Make MaterializeAdjustedValue() responsible for adjusting load
metadata in all cases, so it also covers the non-local case.
In conjunction with that, we no longer need to call
patchReplacementInstruction() for the local case, which would
unnecessarily drop metadata if the replacement value just happened
to be a load (without actual load CSE).
Timm Bäder [Wed, 19 Apr 2023 07:59:03 +0000 (09:59 +0200)]
[clang][Sema][NFC] Make a bunch of things const if possible
And some general code style cleanup.
Differential Revision: https://reviews.llvm.org/D148696
Jay Foad [Thu, 20 Apr 2023 10:17:24 +0000 (11:17 +0100)]
[IR] Remove dead code for unsupported ConstantExpr binops
Nikita Popov [Thu, 20 Apr 2023 10:17:31 +0000 (12:17 +0200)]
[GVN] Add additional metadata combining tests (NFC)
Timm Bäder [Wed, 19 Apr 2023 11:24:48 +0000 (13:24 +0200)]
[clang][Lex][NFC] Use a range for loop in StringLiteralParser
Simon Pilgrim [Thu, 20 Apr 2023 09:35:51 +0000 (10:35 +0100)]
[DAG] SimplifyVCastOp - ensure we select the correct value type from an SDValue operand
As reported on Issue #62234 - we weren't correctly using the SDValue operand to get its value type, resulting in a failure when it came from a SDNode with multiple results
We haven't been able to create a suitable upstream regression test, but its been confirmed by inspection by both myself and @topperc
Fixes #62234
Timm Bäder [Wed, 19 Apr 2023 12:38:36 +0000 (14:38 +0200)]
[clang][Sema][NFC] Use existing TargetInfo local variable
David Sherwood [Wed, 5 Apr 2023 12:58:03 +0000 (12:58 +0000)]
[AArch64][CostModel] Make sext/zext free if folded into a masked load
The BasicTTIImpl implementation of getCastInstrCost ensures
that the cost of zext/sext is 0 when following a load if we
know the combined extending load is legal. For SVE we can do
the same for masked loads too, since they use exactly the
same underlying instruction.
Differential Revision: https://reviews.llvm.org/D148123
Matthias Springer [Thu, 20 Apr 2023 08:30:04 +0000 (17:30 +0900)]
[mlir][linalg][transform] PackGreedilyOp/TileToForallOp: Store payload ops in SmallVector
The TrackingListener removes ops from the internal transform dialect state when they are erased. At the same time, the `apply` interface method is iterating over all payload ops. Elements may not be removed from the state while iterating over the state.
Differential Revision: https://reviews.llvm.org/D148771
David Spickett [Wed, 19 Apr 2023 13:20:06 +0000 (13:20 +0000)]
[LLDB] Discard register flags where the size doesn't match the register
In the particular case I was looking at I autogenerated a 128 bit set
of flags that is only 64 bit. This doesn't crash lldb but it was certainly
not expected.
I suspect that we would have crashed if the top 64 bits weren't
marked as unused (or at least invoked some very undefined behaviour).
When this happens, log the details and ignore the flags. Like this:
```
Size of register flags TTBR0_EL1_flags (16 bytes) for register TTBR0_EL1 does not match the register size (8 bytes). Ignoring this set of flags.
```
Turns out a few of the tests relied on this bug so I have updated
them and added a specific test for this case.
Reviewed By: jasonmolenda
Differential Revision: https://reviews.llvm.org/D148715
Florian Hahn [Thu, 20 Apr 2023 08:31:16 +0000 (09:31 +0100)]
Recommit "[VPlan] Switch to checking sinking legality for recurrences in VPlan."
This reverts the revert commit
3d8ed8b5192a59104bfbd5bf7ac84d035ee0a4a5.
The new version of the patch adds a set to avoid duplicating work in
isFixedOrderRecurrence, which was previously done through the removed
SinkAfter map.
Original commit message:
Building on D142885 and D142589, retire the SinkAfter map from the
recurrence handling code. It is replaced by checking whether it is
possible to sink all users of a recurrence directly in VPlan. This
results in simpler code overall and allows to handle additional cases
(see the improvements in @test_crash).
Depends on D142885.
Depends on D142589.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D142886
Martin Dinkov [Tue, 8 Nov 2022 14:15:38 +0000 (09:15 -0500)]
[MsgPack] Add support for writing binary ELF doc nodes
Will be used for a front-end compiler
https://github.com/GPUOpen-Drivers/llpc
to insert a binary blob value into AMDGPU PAL metadata.
Differential Revision: https://reviews.llvm.org/D148607
Change-Id: I90685883d1478335937218e6b1a569b1b26dc05a
Craig Topper [Thu, 20 Apr 2023 07:20:19 +0000 (00:20 -0700)]
[RISCV] Remove VConstraintType enum and getConstraint. NFC
Fold the 3 flag defines into the enum that defines TSFlags. Then
we don't have to extract them we can just test the bits directly
in TSFlags.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D148765
Craig Topper [Thu, 20 Apr 2023 07:19:24 +0000 (00:19 -0700)]
[RISCV] Let assembler accept vector memory operands that have an explicit 0 offset.
Binutils allows vector instructions with memory operands that
have an explicit 0 offset like 'vle8.v v0, 0(a0)'.
We already have support for this in the parser because the same
thing is allowed for atomics.
This patch changes the AsmOperand and AsmString for the vector
memory instructions to allow this.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D148733
Viktoriia Bakalova [Fri, 31 Mar 2023 14:28:57 +0000 (14:28 +0000)]
[clangd] Implement cross reference request for #include lines.
Differential Revision: https://reviews.llvm.org/D147044
Haojian Wu [Thu, 20 Apr 2023 07:02:29 +0000 (09:02 +0200)]
[bazel] Fix the bazel build for the "analysis" target for
a443b3d18ef4.
A followup of the fix
46f5aaa82ca6fe2a307504444754ac535fb4760d
Kavitha Natarajan [Thu, 20 Apr 2023 05:48:26 +0000 (11:18 +0530)]
[Flang][OpenMP] Add support for OpenMP MIN reduction
This patch adds support for reduction of min-intrinsic for scalar
types. Min is lowered as a compare-select in the default lowering
flow for Flang. This pattern is matched and replaced with the
OpenMP dialect reduction operation.
Note: This is a temporary flow. The plan is to move to a flow
where the OpenMP reduction operation is inserted during lowering.
Jun Sha (Joshua) [Thu, 20 Apr 2023 05:46:34 +0000 (13:46 +0800)]
[RISCV] Add scheduling for Zfa instructions
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D148686
Tue Ly [Thu, 20 Apr 2023 05:03:41 +0000 (01:03 -0400)]
[libc][math] Remove placeholder implementations of asin and pow.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D148781
Pravin Jagtap [Thu, 20 Apr 2023 04:27:47 +0000 (00:27 -0400)]
[NewPM][AMDGPU] Port amdgpu-atomic-optimizer
Reviewed By: arsenm, sameerds, gandhi21299
Differential Revision: https://reviews.llvm.org/D148628
Mehdi Amini [Thu, 20 Apr 2023 04:12:46 +0000 (22:12 -0600)]
[mlir][doc] Fix build after D148389
The doc aren't part of the usual build, so this got unnoticed.
In
c184dcb458 a dependency was added from the OpenACC on the LLVM
and Memref dialects, to generate the dialect doc we need to explicitly
ask for the `acc` dialect now.
Akshay Khadse [Thu, 20 Apr 2023 02:03:36 +0000 (10:03 +0800)]
Fix uninitialized class members
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D148692
Shengchen Kan [Thu, 20 Apr 2023 03:07:18 +0000 (11:07 +0800)]
[X86][Tablgen] Rename IgnoresVEX_W to IgnoresW, VEX_WIG to WIG, NFCI
We no longer distinguish REX.W from VEX.W in .td.
Peter Rong [Mon, 17 Apr 2023 20:57:29 +0000 (13:57 -0700)]
[FuzzMutate] InsertFunctionStrategy
InsertFunctionStrategy does two things:
1. Add a random function declaration or definition to the module. This would replace previously used `createEmptyFunction`.
2. Add a random function call between instructions.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D148568
Petr Hosek [Wed, 19 Apr 2023 23:55:20 +0000 (23:55 +0000)]
[Driver] Support response file on baremetal driver
All officially supported linkers should support response files and
this avoids issues when compiling on platforms such as Windows.
Differential Revision: https://reviews.llvm.org/D148760
Petr Hosek [Thu, 20 Apr 2023 00:03:30 +0000 (00:03 +0000)]
[Driver] Support response file in Fuchsia driver
All officially supported linkers should support response files and
this avoids issues when compiling on platforms such as Windows.
Differential Revision: https://reviews.llvm.org/D148763
Xiang1 Zhang [Tue, 11 Apr 2023 06:57:01 +0000 (14:57 +0800)]
[X86] combineConcatVectorOps - remove FADD/FSUB/FMUL handling
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D147996
Jun Sha (Joshua) [Thu, 20 Apr 2023 02:32:24 +0000 (10:32 +0800)]
[RISCV] Remove 'sx' when parsing arch string to match the latest ISA manual
In order to match the latest ISA manual, we need to remove sx prefix.
Reviewed By: asb
Differential Revision: https://reviews.llvm.org/D148617
Jun Sha (Joshua) [Thu, 20 Apr 2023 02:27:02 +0000 (10:27 +0800)]
Revert '[RISCV] Remove 'sx' when parsing arch string to match the latest ISA manual'
This reverts commit
fbc63e5658f67036d4ea57940459074d9ecdd2d8
Matthias Springer [Thu, 20 Apr 2023 02:02:05 +0000 (11:02 +0900)]
[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
Jun Sha (Joshua) [Thu, 20 Apr 2023 02:19:14 +0000 (10:19 +0800)]
[RISCV] Remove 'sx' when parsing arch string to match the latest ISA manual
Peiming Liu [Tue, 18 Apr 2023 22:33:25 +0000 (22:33 +0000)]
[mlir][sparse] extend pack operation to support packing a batched COO type
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D148670
Manish Gupta [Wed, 12 Apr 2023 01:00:58 +0000 (01:00 +0000)]
[mlir][Memref] Fold nvgpu device cp.async on src memref to dst memref
Differential Revision: https://reviews.llvm.org/D148161
Chia-hung Duan [Wed, 19 Apr 2023 22:58:36 +0000 (22:58 +0000)]
[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
Joseph Huber [Thu, 20 Apr 2023 01:05:30 +0000 (20:05 -0500)]
[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.
Joseph Huber [Mon, 17 Apr 2023 12:09:59 +0000 (07:09 -0500)]
[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
Joseph Huber [Fri, 14 Apr 2023 14:24:00 +0000 (09:24 -0500)]
[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
Joseph Huber [Fri, 14 Apr 2023 02:27:51 +0000 (21:27 -0500)]
[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
Peiming Liu [Tue, 18 Apr 2023 22:05:31 +0000 (22:05 +0000)]
[mlir][sparse] support iteration over compressed-hi dimension level in loop emitter
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D148668
Noah Goldstein [Thu, 20 Apr 2023 00:33:32 +0000 (19:33 -0500)]
[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
Jim Ingham [Thu, 20 Apr 2023 00:23:43 +0000 (17:23 -0700)]
Add missing header guards so the modules build will succeed.
LLVM GN Syncbot [Thu, 20 Apr 2023 00:13:38 +0000 (00:13 +0000)]
[gn build] Port
87cec865979c
Nico Weber [Wed, 19 Apr 2023 18:06:53 +0000 (14:06 -0400)]
[gn] Use clang/utils/bundle_resources.py for clang-pseudo too
See https://reviews.llvm.org/D146591#4281023 -- optimistically
assuming that gets done :)
Matt Arsenault [Thu, 13 Apr 2023 14:53:27 +0000 (10:53 -0400)]
ValueTracking: uitofp/sitofp cannot return denormal results
Matt Arsenault [Thu, 13 Apr 2023 14:15:15 +0000 (10:15 -0400)]
ValueTracking: Handle sign bit of constrained sitofp/uitofp
This is for parity with CannotBeNegativeZero which is close to
droppable.
Matt Arsenault [Sun, 9 Apr 2023 11:20:25 +0000 (07:20 -0400)]
ValueTracking: Implement computeKnownFPClass for fdiv for nan handling
Matt Arsenault [Wed, 12 Apr 2023 14:48:33 +0000 (10:48 -0400)]
ValueTracking: Add baseline tests for computeKnownFPClass fdiv handling
Matt Arsenault [Tue, 11 Apr 2023 18:03:42 +0000 (14:03 -0400)]
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.
Matt Arsenault [Tue, 11 Apr 2023 18:20:05 +0000 (14:20 -0400)]
Attributor: Add baseline tests for nofpclass changes
Matt Arsenault [Mon, 17 Apr 2023 14:15:30 +0000 (10:15 -0400)]
ValueTracking: Add more tests for trunc handling in computeKnownFPClass
Matt Arsenault [Sun, 9 Apr 2023 02:38:59 +0000 (22:38 -0400)]
ValueTracking: Add baseline test for computeKnownFPClass for sqrt
Julian Lettner [Tue, 18 Apr 2023 17:39:00 +0000 (10:39 -0700)]
[TSan] Fix comment describing shadow memory layout
Differential Revision: https://reviews.llvm.org/D148648
Med Ismail Bennani [Wed, 19 Apr 2023 23:53:19 +0000 (16:53 -0700)]
[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>
MalavikaSamak [Wed, 19 Apr 2023 23:42:15 +0000 (16:42 -0700)]
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.
NAKAMURA Takumi [Wed, 19 Apr 2023 23:33:34 +0000 (08:33 +0900)]
[CMake] Reduce deps
NAKAMURA Takumi [Wed, 19 Apr 2023 23:23:56 +0000 (08:23 +0900)]
[Bazel] Introduce "//clang:bundle_resources" for D146591
Nathan Sidwell [Wed, 19 Apr 2023 19:53:52 +0000 (15:53 -0400)]
[BOLT][NFC] Remove exec permission from some tests
These files unnecessarily had execute permission.
Nathan Sidwell [Wed, 19 Apr 2023 19:53:17 +0000 (15:53 -0400)]
[BOLT] Add bolt-runtime requirement to tests
These tests rely on the X86 runtime, add the REQUIRES.
Differential Revision: https://reviews.llvm.org/D148737
Michael Jones [Mon, 17 Apr 2023 17:30:28 +0000 (10:30 -0700)]
[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
Siva Chandra Reddy [Wed, 19 Apr 2023 23:11:10 +0000 (23:11 +0000)]
[libc][math] Remove the unused dp_trig target and tests.
MalavikaSamak [Wed, 19 Apr 2023 23:08:55 +0000 (16:08 -0700)]
Revert "[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages"
This reverts commit
777eb4bcfc3265359edb7c979d3e5ac699ad4641.
Butta [Wed, 19 Apr 2023 22:55:05 +0000 (15:55 -0700)]
[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
MalavikaSamak [Wed, 19 Apr 2023 22:52:12 +0000 (15:52 -0700)]
[-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
Valentin Clement [Wed, 19 Apr 2023 22:52:24 +0000 (15:52 -0700)]
[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
Siva Chandra Reddy [Wed, 19 Apr 2023 22:42:25 +0000 (22:42 +0000)]
[libc][Obvious] Remove an unused "using" declaration.
Craig Topper [Wed, 19 Apr 2023 22:22:42 +0000 (15:22 -0700)]
[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.
Vitaly Buka [Wed, 19 Apr 2023 22:13:23 +0000 (15:13 -0700)]
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.
Razvan Lupusoru [Wed, 19 Apr 2023 17:59:41 +0000 (10:59 -0700)]
[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
Alex Langford [Wed, 19 Apr 2023 01:45:03 +0000 (18:45 -0700)]
[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
Martin Storsjö [Wed, 12 Apr 2023 11:17:48 +0000 (11:17 +0000)]
[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
Vasileios Porpodas [Wed, 19 Apr 2023 00:47:18 +0000 (17:47 -0700)]
[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
Louis Dionne [Mon, 6 Mar 2023 21:14:06 +0000 (16:14 -0500)]
[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
Alex Langford [Tue, 18 Apr 2023 23:46:12 +0000 (16:46 -0700)]
[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
Teresa Johnson [Wed, 19 Apr 2023 21:05:26 +0000 (14:05 -0700)]
[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.
Scott Linder [Wed, 8 Feb 2023 20:01:42 +0000 (20:01 +0000)]
[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
Scott Linder [Thu, 23 Feb 2023 19:53:47 +0000 (19:53 +0000)]
[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
Teresa Johnson [Wed, 19 Apr 2023 15:21:52 +0000 (08:21 -0700)]
[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
Joseph Huber [Wed, 19 Apr 2023 20:27:33 +0000 (15:27 -0500)]
[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.
Louis Dionne [Tue, 18 Apr 2023 12:46:49 +0000 (12:46 +0000)]
[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
Fangrui Song [Wed, 19 Apr 2023 20:15:33 +0000 (13:15 -0700)]
[Driver] Make -fsanitize=kcfi,function incompatible
A -fsanitize=kcfi instrumented function has a special instruction/data
before the function entry at a fixed offset.
A -fsanitize=function instrumented function has special instruction/data
after the function entry at a fixed offset (may change to *before* in D148665).
The two instrumentations are not intended to be used together and will become
incompatible after D148665.
Reviewed By: samitolvanen
Differential Revision: https://reviews.llvm.org/D148671
Fangrui Song [Wed, 19 Apr 2023 20:10:46 +0000 (13:10 -0700)]
[Driver] -fsanitize=kcfi doesn't need RequiresPIE
As mentioned on D148671: this is unneeded. This commit is a no-op for most Linux
builds since CLANG_DEFAULT_PIE_ON_LINUX defaults to 1.
Martin Storsjö [Tue, 18 Apr 2023 12:04:57 +0000 (15:04 +0300)]
[libunwind] [SEH] Add debug logging in __libunwind_seh_personality
Differential Revision: https://reviews.llvm.org/D148659