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
Martin Storsjö [Wed, 12 Apr 2023 09:12:28 +0000 (09:12 +0000)]
[compiler-rt] [test] [ubsan] Mark failing tests as unsupported for mingw configs
All of these are already unsupported for MSVC style configs. For
some cases, simplify the regex to match any windows triple, while
for others, mention windows-msvc and windows-gnu specifically,
if they are separate cases that happen to fail for different reasons.
-fsanitize=function is unsupported both in mingw and MSVC modes.
The vptr tests expect to get demangled C++ type info names, but
Itanium C++ typenames don't get demangled by ubsan on Windows.
The test that tries to build a .so doesn't work as such on
Windows.
While mingw toolchains do support weak symbols, the relevant
sanitizer symbols aren't made weak on Windows.
Differential Revision: https://reviews.llvm.org/D148163
Itay Bookstein [Fri, 23 Dec 2022 09:35:47 +0000 (11:35 +0200)]
[OpenMP] Prefix outlined and reduction func names with original func's name
This patch prefixes omp outlined helpers and reduction funcs
with the original function's name.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D140722
Tom Stellard [Wed, 19 Apr 2023 19:58:59 +0000 (12:58 -0700)]
workflows/release-binaries: Add missing output variable
Reviewed By: thieta
Differential Revision: https://reviews.llvm.org/D148734
Vitaly Buka [Wed, 19 Apr 2023 19:51:00 +0000 (12:51 -0700)]
[cmake] Explicitly disable download step
Fixes the following on cmake version 3.24.2:
'tools/clang/runtime/compiler-rt-stamps/compiler-rt-source_dirinfo.txt',
needed by 'tools/clang/runtime/compiler-rt-stamps/compiler-rt-download',
missing and no known rule to make it
Maybe related to https://cmake.org/cmake/help/latest/release/3.24.html#modules
Nathan Sidwell [Tue, 18 Apr 2023 22:14:21 +0000 (18:14 -0400)]
[BOLT][NFC] Move phdr typedef to cpp file
This typedef is only used inside the RewriteInstance source file, let's not
expose it in the header file -- even if private.
Differential Revision: https://reviews.llvm.org/D148667
Nathan Sidwell [Tue, 18 Apr 2023 22:13:16 +0000 (18:13 -0400)]
[BOLT] Adjust Shdr alignment
Shdr's are not necesarily size 2^n, and there is no reason to align to
that boundary if they are.
Differential Revision: https://reviews.llvm.org/D148666
Louis Dionne [Tue, 18 Apr 2023 13:25:16 +0000 (13:25 +0000)]
[libc++] Add helper script libcxx-lit for running tests
Differential Revision: https://reviews.llvm.org/D148632
Daniel Woodworth [Wed, 19 Apr 2023 19:23:57 +0000 (15:23 -0400)]
[InferAttrs] Mark frexp and modf as memory(argmem: write)
These two math library functions can't write to errno, but they do
produce two results and store the second result to a pointer passed as
their second argument. Appropriately marking them as
memory(argmem: write) enables more optimizations on calls to them.
Reviewed By: xbolva00
Differential Revision: https://reviews.llvm.org/D148043
Daniel Thornburgh [Mon, 17 Apr 2023 22:54:11 +0000 (15:54 -0700)]
[CMake] Switch back to -fPIC for Fuchsia Toolchain
This reverts commit
1fab236e6e4575d5af4f4722216df4dd6a872795.
Shipping LLDB means distributing libLLDB.so, which will need to be built
with PIC. Disabling PIC also removes the libLTO target, which is a hard
dependency of the LLDB test suite.
Reviewed By: abrachet
Differential Revision: https://reviews.llvm.org/D148577
Johannes de Fine Licht [Tue, 18 Apr 2023 15:17:13 +0000 (15:17 +0000)]
[MLIR][LLVM] Realign allocas to avoid dynamic realignment in inliner.
When the natural stack alignment is not set or is larger than or equal
to the target alignment required by a read-only byval argument defined
by an alloca, avoid the copy by just realigning the alloca to the target
alignment.
The code to check existing alignment is reorganized a bit to avoid
redundant casts.
This also includes a bugfix for passing a null DataLayoutInterface to
the DataLayout constructor when no parent op defines
DataLayoutInterface, and will now pass ModuleOp instead in this case.
Reviewed By: gysit
Differential Revision: https://reviews.llvm.org/D148557
Sam McCall [Wed, 19 Apr 2023 18:38:15 +0000 (20:38 +0200)]
[pseudo] Use shared copy of bundle_resources.py
OCHyams [Wed, 19 Apr 2023 18:16:40 +0000 (19:16 +0100)]
Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit
89d27854ec7f5e8bd83e72fa574740bf3d06355b.
See https://reviews.llvm.org/D146987 for issues.
Nico Weber [Wed, 19 Apr 2023 17:52:40 +0000 (13:52 -0400)]
[gn build] Port
a443b3d18ef4 (HTMLLogger.inc)
Similar to
374db8fc2e49f.
Jakub Kuderski [Wed, 19 Apr 2023 17:51:13 +0000 (13:51 -0400)]
[mlir] Allow to specify target type in `convertType`
Add a new helper function for the type converter that takes care of
casting to the target type.
This is to avoid bugs where an incorrect cast function is used after
type conversion, e.g., `dyn_cast` or `cast`. These are not guaranteed to
work when type conversion fails, or when type conversion succeeds but
the provided type converted returned a type that a conversion pattern
did not expect.
I saw this being an issue in some SPIR-V passes and in mlir-hlo.
Exercise the new function in a couple of passes. As a side-effect, this
also made the code more concise.
Reviewed By: rriddle, mehdi_amini
Differential Revision: https://reviews.llvm.org/D148725
Med Ismail Bennani [Wed, 19 Apr 2023 17:46:17 +0000 (10:46 -0700)]
Revert "[lldb] Fix bug to update process public run lock with process state"
This reverts commit
14f00213b202a82b895a6ab749262d4382435012.
Valentin Clement [Wed, 19 Apr 2023 17:27:15 +0000 (10:27 -0700)]
[mlir][openacc] Keep region when applying data operand conversion
Keep the region when the operation has one. The previous code
was throwing away the region when creating the new version
of the operation.
Reviewed By: razvanlupusoru
Differential Revision: https://reviews.llvm.org/D148039
Christopher Di Bella [Wed, 19 Apr 2023 00:58:43 +0000 (00:58 +0000)]
[clang] makes `__is_trivially_equality_comparable` available as a struct
Since this was originally a name in library, it needs an escape hatch
for versions of Clang that are slightly out-of-sync with libc++.
Differential Revision: https://reviews.llvm.org/D148677
Hiroshi Yamauchi [Tue, 18 Apr 2023 20:05:52 +0000 (13:05 -0700)]
[docs] Remove a duplicate or unnecessary 'to' in a sentence.
Differential Revision: https://reviews.llvm.org/D148657
Med Ismail Bennani [Wed, 19 Apr 2023 06:35:45 +0000 (23:35 -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.
Differential Revision: https://reviews.llvm.org/D148400
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Paul Robinson [Wed, 19 Apr 2023 16:57:17 +0000 (09:57 -0700)]
[Header][doc] Tweak wording for MWAIT[X] intrinsics
Itay Bookstein [Wed, 19 Apr 2023 16:08:11 +0000 (19:08 +0300)]
Revert "[OpenMP] Prefix outlined and reduction func names with original func's name"
This reverts commit
029bfc311d4d7d3cd90be81bb08c046848796d02.
Paul Robinson [Tue, 18 Apr 2023 19:37:49 +0000 (12:37 -0700)]
[Headers][doc] Add/revise MONITOR/MWAIT descriptions
Differential Revision: https://reviews.llvm.org/D148653
Peter Klausler [Mon, 10 Apr 2023 18:05:03 +0000 (11:05 -0700)]
[flang] Semantics for !DIR$ IGNORE_TKR
Implement semantics for the IGNORE_TKR directive as it is interpreted
by the PGI / NVFORTRAN compiler.
Differential Revision: https://reviews.llvm.org/D148643
Itay Bookstein [Fri, 23 Dec 2022 09:35:47 +0000 (11:35 +0200)]
[OpenMP] Prefix outlined and reduction func names with original func's name
This patch attempts to prefix omp outlined helpers and reduction funcs
with the original function's name.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D140722
Martin Storsjö [Wed, 12 Apr 2023 11:45:41 +0000 (11:45 +0000)]
[compiler-rt] [test] [profile] Generalize existing MSVC XFAILs to cover mingw too
Differential Revision: https://reviews.llvm.org/D148167
Martin Storsjö [Fri, 14 Apr 2023 20:58:34 +0000 (20:58 +0000)]
[compiler-rt] [test] Don't override config.unsupported in TestCases/Windows
This is a leftover from when these tests were added in
2bdca2006941a3a7de8e16ea9af9a758b367ee32 in 2014 (when the toplevel
asan/lit.cfg set "config.unsupported = True" on Windows). When the
common tests were included on Windows in
89d994367a597134fa7e1724314044e217718165 in 2015, that commit should
have removed the now unnecessary "config.unsupported = False" line here.
Differential Revision: https://reviews.llvm.org/D148442
Martin Storsjö [Wed, 5 Apr 2023 12:25:09 +0000 (15:25 +0300)]
[libcxx] [ci] Run the libcxxabi and libunwind tests in mingw configurations
The check-runtimes function runs check-cxx, check-cxxabi and check-unwind.
Differential Revision: https://reviews.llvm.org/D148267
Yonghong Song [Mon, 17 Apr 2023 18:11:59 +0000 (11:11 -0700)]
[TTI][BPF] Ensure ArgumentPromotion Not Exceeding Target MaxArgs
With LLVM patch https://reviews.llvm.org/D148269, we hit a linux kernel
bpf selftest compilation failure like below:
...
progs/test_xdp_noinline.c:739:8: error: too many args to t8: i64 = GlobalAddress<ptr @encap_v4> 0, progs/test_xdp_noinline.c:739:8
if (!encap_v4(xdp, cval, &pckt, dst, pkt_bytes))
^
...
progs/test_xdp_noinline.c:321:6: error: defined with too many args
bool encap_v4(struct xdp_md *xdp, struct ctl_value *cval,
^
...
Note that bpf selftests are compiled with -O2 which is
the recommended flag for bpf community.
The bpf backend calling convention is only allowing 5
parameters in registers and does not allow pass arguments
through stacks. In the above case, ArgumentPromotionPass
replaced parameter '&pckt' as two parameters, so the total
number of arguments after ArgumentPromotion pass becomes 6
and this caused later compilation failure during instruction
selection phase.
This patch added a TargetTransformInfo hook getMaxNumArgs()
which returns 5 for BPF and UINT_MAX for other targets.
Differential Revision: https://reviews.llvm.org/D148551
David Sherwood [Tue, 11 Apr 2023 12:10:33 +0000 (12:10 +0000)]
[NFC][AArch64] Add cost model tests for extending loads
Differential Revision: https://reviews.llvm.org/D148122
Mark de Wever [Tue, 18 Apr 2023 17:19:48 +0000 (19:19 +0200)]
[libc++] Adds missing includes.
This patch makes are code less dependant on transitive includes.
This was part of D145800. This patch will be abandoned, but these
changes are still useful. I manually verified declarations of the new
includes are used in these files.
Reviewed By: #libc, philnik
Differential Revision: https://reviews.llvm.org/D148645
Joe Nash [Mon, 17 Apr 2023 21:22:43 +0000 (17:22 -0400)]
[AMDGPU] NFC. Refactor GISel for cmp intrinsics
Combine the logic for fcmp and icmp intrinsics and use operand presence
instead.
Reviewed By: kosarev, foad
Differential Revision: https://reviews.llvm.org/D148716
Jay Foad [Wed, 19 Apr 2023 14:26:32 +0000 (15:26 +0100)]
[AMDGPU] Fix some check prefixes
Jay Foad [Wed, 19 Apr 2023 14:23:55 +0000 (15:23 +0100)]
[AMDGPU] Remove unused check lines from tests
Arash Taheri-Dezfouli [Wed, 19 Apr 2023 15:09:29 +0000 (15:09 +0000)]
[MLIR] Fix missing ::mlir namespace
Add a missing ::mlir namespace for MixedContainerType
that only triggers if the user is not using namespace mlir.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D147956
Scott Linder [Wed, 19 Apr 2023 15:02:08 +0000 (15:02 +0000)]
[dwarfdump][AMDGPU] Support EF_AMDGPU_MACH_NONE
A quirk of the AMDGPU backend is EF_AMDGPU_MACH_NONE, which is not
specific to the r600 or amdgcn architecture, but can be combined with
either.
AMDGPU ELF code objects with this mach value cannot be mapped back to a
Triple architecture, as it could be either r600 or amdgcn. For
llvm-dwarfdump this means the normal method of inspecting
ObjectFile::getArch to determine how to handle relocations is
insufficient.
This patch adds an extra check for ELF code objects which would
otherwise be categorized as UnknownArch, making it possible to use
llvm-dwarfdump with them. For completeness it also adds support for
known r600 machines.
This also adds specific tests for llvm-dwarfdump for amdgcn and r600,
both with known and unknown mach values.
Reviewed By: jhenderson
Differential Revision: https://reviews.llvm.org/D144301
Razvan Lupusoru [Tue, 18 Apr 2023 22:42:16 +0000 (15:42 -0700)]
[flang][openacc] Add OpenACC pointer interface to FIR pointer types
The OpenACC dialect data clauses require for variables appearing in data
operations to implement the `PointerLikeType` interface (similarly to
OpenMP dialect). Thus, this interface needs attached to FIR types.
Two of the FIR types, HeapType and LLVMPointerType, did not provide
getElementType - now they do by calling getEleTy. This cleans up the
interface attachment for both OpenACC and OpenMP dialects.
Reviewed By: clementval, jeanPerier
Differential Revision: https://reviews.llvm.org/D148560
Dinar Temirbulatov [Wed, 19 Apr 2023 14:17:32 +0000 (14:17 +0000)]
[AArch64][CodeGen] Allow vectors larger than hardware support to use SVE's load zero/sign-extend for fixed vectors.
Prefer to fold LOAD + SIGN/ZEROEXTEND to SVE load and sign extend instructions
for fixed-length-vectors even if a type is not representable on a hardware.
Differential Revision: https://reviews.llvm.org/D147533
OCHyams [Wed, 19 Apr 2023 14:14:18 +0000 (15:14 +0100)]
Remove unused ValueTracking.h include from DebugInfo.cpp
Buildbot: https://buildkite.com/llvm-project/upstream-bazel/builds/
59967#
01879985-8d44-4041-9cd0-
a1e41371208e
See https://reviews.llvm.org/D148536
Jay Foad [Wed, 19 Apr 2023 14:12:50 +0000 (15:12 +0100)]
[AMDGPU] Remove unused check lines from GlobalISel IR tests
Sam McCall [Wed, 19 Apr 2023 14:11:58 +0000 (16:11 +0200)]
[dataflow] add missing clangLex dep after
a443b3d18ef4d01e7
Benjamin Kramer [Wed, 19 Apr 2023 13:31:34 +0000 (15:31 +0200)]
[SCF] Clean up ForOpTensorCastFolder and harden it against nop tensor casts
The code was inserting a new cast, discarding it, then inserting it
again.
The self-cast issue is the root of #62135 because it would end up
dropping the loop and inserting an invalid cast to itself. As far as I
can tell tensor.cast with the same src and dst types is not invalid but
it can't really be tested in isolation as it's immediately folded.
Fixes #62135
Differential Revision: https://reviews.llvm.org/D148714
Jay Foad [Wed, 19 Apr 2023 13:54:50 +0000 (14:54 +0100)]
[AMDGPU] Remove unused check lines from GlobalISel MIR tests
Sam McCall [Wed, 8 Mar 2023 15:13:28 +0000 (16:13 +0100)]
[dataflow] add HTML logger: browse code/cfg/analysis timeline/state
With -dataflow-log=/dir we will write /dir/0.html etc for each
function analyzed.
These files show the function's code and CFG, and the path through
the CFG taken by the analysis. At each analysis point we can see the
lattice state.
Currently the lattice state dump is not terribly useful but we can
improve this: showing values associated with the current Expr,
simplifying flow condition, highlighting changes etc.
(Trying not to let this patch scope-creep too much, so I ripped out the
half-finished features)
Demo: https://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/
1746985bf13406bd19181af281aea9ff/raw/
9718fdd48406dabccb3092acd983b4bd55da9dfa/analysis.html
Differential Revision: https://reviews.llvm.org/D146591
Andrew Gozillon [Wed, 19 Apr 2023 13:21:24 +0000 (08:21 -0500)]
[OpenMP][MLIR] Add lowering of omp::FlagsAttr to LLVM-IR
The omp::FlagsAttr contains OpenMP RTL flags
given by a user to the compiler and a frontend
(flang currently) then populates the omp::FlagsAttr
which will then lower these to LLVM globals
which are utilised by the OpenMP runtime.
Reviewers: jdoerfert
Differential Revision: https://reviews.llvm.org/D147344
David Green [Wed, 19 Apr 2023 13:26:27 +0000 (14:26 +0100)]
[AArch64] Remove dead tryMLAV64LaneV128 and tryMULLV64LaneV128 code.
As far as I can tell this code is never used, as the pattern recognised by
checkHighLaneIndex (an duplane with insert_subvec and extract_subvec) will not
be generated any more. There are no tests that change from removing it
(including the clang neon tests), and it didn't appear to come up in any
benchmarks I ran. There are already existing tablegen patterns for MLA with
index and s/umull with index.
Removing it also prevents it from causing problems for SVE, as in #62151.
Differential Revision: https://reviews.llvm.org/D148646
Dinar Temirbulatov [Wed, 19 Apr 2023 13:24:58 +0000 (13:24 +0000)]
[DAGCombine][AArch64] Allow transformable to legal vectors to be used for MULH lowering.
It looks like it is still profitable to accept a transformable to a legal vector
type, not just a legal vector, as long as vector elements are the same between
two of those types.
Differential Revision: https://reviews.llvm.org/D148229
OCHyams [Wed, 19 Apr 2023 12:59:08 +0000 (13:59 +0100)]
Reapply D146987 "[Assignment Tracking] Enable by default"
This reverts commit
7674ae7231c4e286b93eb399e475765630666f8b which
reverts D146987.
See https://reviews.llvm.org/D146987 for issues.
Joseph Huber [Mon, 17 Apr 2023 20:08:59 +0000 (15:08 -0500)]
[libc] Add the '--threads' and '--blocks' option to the GPU loaders
We will want to test the GPU `libc` with multiple threads in the future.
This patch adds the `--threads` and `--blocks` option to set the `x`
dimension of the kernel. Using CUDA terminology instead of OpenCL for
familiarity.
Depends on D148288 D148342
Reviewed By: jdoerfert, sivachandra, tra
Differential Revision: https://reviews.llvm.org/D148485
Joseph Huber [Tue, 18 Apr 2023 14:44:27 +0000 (09:44 -0500)]
[libc] Add a support library for GPU utilities
The GPU has many features that can only be accessed through builtin or
intrinsic functions. Furthermore, these functions are unique for each
GPU target. This patch outlines an interface to create a common `libc`
interface to access these. Currently I only implement a function for the
CUDA equivalent of `blockIdx.x`. More will be added in the future.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D148635
Alexey Bataev [Fri, 14 Apr 2023 16:35:03 +0000 (09:35 -0700)]
[SLP]Fix cost estimation for buildvectors with extracts and/or constants.
If the partial matching is found and some other scalars must be
inserted, need to account the cost of the extractelements, transformed
to shuffles, and/or reused entries and calculate the cost of inserting
constants properly into the non-poison vectors.
Also, fixed the cost calculation for final gather/buildvector sequence.
Differential Revision: https://reviews.llvm.org/D148362
Marco Elver [Wed, 19 Apr 2023 12:46:42 +0000 (14:46 +0200)]
[SanitizerBinaryMetadata] Respect no_sanitize("thread") function attribute
To avoid false positives, respect no_sanitize("thread") when atomics
metadata is enabled.
Reviewed By: dvyukov
Differential Revision: https://reviews.llvm.org/D148694
LLVM GN Syncbot [Wed, 19 Apr 2023 12:38:32 +0000 (12:38 +0000)]
[gn build] Port
bf47c1ed8556
OCHyams [Wed, 19 Apr 2023 12:11:22 +0000 (13:11 +0100)]
Reapply "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"
This reverts commit
6db6ab4815a44bfcaabfcdd84a0ff458394f6f52 which reverts
D148536.
Build issues addressed in D148698.
Sam McCall [Mon, 17 Apr 2023 18:35:20 +0000 (20:35 +0200)]
[dataflow] Extract arena for Value/StorageLocation out of DataflowAnalysisContext
DataflowAnalysisContext has a few too many responsibilities, this narrows them.
It also allows the Arena to be shared with analysis steps, which need to create
Values, without exposing the whole DACtx API (flow conditions etc).
This means Environment no longer needs to proxy all these methods.
(For now it still does, because there are many callsites to update, and maybe
if we separate bool formulas from values we can avoid churning them twice)
In future, if we untangle the concepts of Values from boolean formulas/atoms,
Arena would also be responsible for creating formulas and managing atom IDs.
Differential Revision: https://reviews.llvm.org/D148554
Matt Arsenault [Thu, 13 Apr 2023 01:33:02 +0000 (21:33 -0400)]
ValueTracking: Handle shufflevector in computeKnownFPClass
Matt Arsenault [Tue, 18 Apr 2023 14:28:39 +0000 (10:28 -0400)]
ValueTracking: Add baseline tests for shufflevector computeKnownFPClass handling
Matt Arsenault [Wed, 12 Apr 2023 23:21:49 +0000 (19:21 -0400)]
ValueTracking: Handle insertelement in computeKnownFPClass
Matt Arsenault [Thu, 13 Apr 2023 13:48:08 +0000 (09:48 -0400)]
ValueTracking: sitofp cannot return -0
Matt Arsenault [Sat, 8 Apr 2023 23:29:53 +0000 (19:29 -0400)]
ValueTracking: Add baseline test for computeKnownFPClass for minnum/maxnum
Matt Arsenault [Mon, 17 Apr 2023 23:12:18 +0000 (19:12 -0400)]
ValueTracking: Add more fpext and fptrunc tests
David Spickett [Wed, 19 Apr 2023 11:42:14 +0000 (11:42 +0000)]
[lldb][RISCV] Add missing flags pointer to register infos
efd64c2f2506df3e2ed6d9da68e49f03fc31763c added these.
Enna1 [Wed, 19 Apr 2023 11:27:26 +0000 (19:27 +0800)]
[hwasan] provide a runtime flag for printing remaining threads in error report as an extra information
This patch adds a runtime flag `print_live_threads_info`, which defaults to true, controls whether or not prints remaining threads in error report as an extra information.
We(ByteDance) are in the process of enabling hwasan for our server-side applications on AArch64/Linux, these server-side applications have thousands of threads, so it is nice to have this option.
Reviewed By: fmayer
Differential Revision: https://reviews.llvm.org/D148513
OCHyams [Wed, 19 Apr 2023 10:59:37 +0000 (11:59 +0100)]
[NFC] Rename isPointerOffset to getPointerOffsetFrom and move to Value.h
Linking LLVMCore failed when building D148536 with shared libs enabled:
https://lab.llvm.org/buildbot/#/builders/121/builds/29766
Make isPointerOffset a Value method and rename it to getPointerOffsetFrom.
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D148698
Martin Storsjö [Thu, 30 Mar 2023 11:40:17 +0000 (14:40 +0300)]
[libcxxabi] [test] Fix the mingw test config
Don't link libc++abi separately in addition to the main -lc++; in
mingw build configs, libc++abi is always bundled into libc++
(via LIBCXX_ENABLE_STATIC_ABI_LIBRARY).
In the case of a shared linked libc++, linking a separate static
libc++abi leads to linker errors.
Differential Revision: https://reviews.llvm.org/D147638
Martin Storsjö [Sat, 1 Apr 2023 22:45:07 +0000 (01:45 +0300)]
[libcxxabi] [test] Avoid mingw warnings about missing a return statement
With current versions of mingw-w64 headers, code following
assert(false) isn't considered unreachable - thus add a dummy
"return nullptr;", to avoid warnings (treated as errors) for a
missing return statement.
The root cause does get fixed further upstream in mingw-w64 in
https://github.com/mingw-w64/mingw-w64/commit/
1690994f515910a31b9fb7c7bd3a52d4ba987abe
though.
Differential Revision: https://reviews.llvm.org/D147860
Martin Storsjö [Sat, 15 Apr 2023 21:58:51 +0000 (21:58 +0000)]
[libcxxabi] Omit dllimport in public headers in MinGW mode
This matches the corresponding change to libcxx headers in
dfa88927ae1411ccc3b248b7e624f2acf623d947.
This avoids needing to define _LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
when building libcxxabi tests, for two reasons:
- It defaults to normal linkage (as opposed to dllimport), fixing
linking of a static library version of libcxx/libcxxabi
- It avoids issues with using dllimport declarations on symbols when
including cxxabi implementations into the testcase itself
Differential Revision: https://reviews.llvm.org/D148441
Hassnaa Hamdi [Wed, 19 Apr 2023 09:23:13 +0000 (09:23 +0000)]
[AArch64][CostModel]: Add costs for zero/sign extend.
Add cost for extending to illegal scalable vector types.
Add testing file for the extend operations.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D142456
Martin Liska [Wed, 19 Apr 2023 09:47:43 +0000 (11:47 +0200)]
Make use of '#pragma clang diagnostic' only with __clang__.
Otherwise one gets the following warning with GCC:
warning: ignoring ‘#pragma clang diagnostic’ [-Wunknown-pragmas]
Differential Revision: https://reviews.llvm.org/D148695
pvanhout [Tue, 18 Apr 2023 12:22:45 +0000 (14:22 +0200)]
[AMDGPU] Add more verbose logs to PromoteAlloca
More specifically make it more talkative when it's looking at the users of
an alloca to promote it to a vector.
A common failure point of the pass is unknown or weird users of the alloca.
While debugging issues related to this pass one of the first thing I usually
did was to add logs to see how the users were being handled.
Having such logs in directly seems to be a nice addition.
Reviewed By: arsenm, rampitec
Differential Revision: https://reviews.llvm.org/D148629
David Spickett [Mon, 17 Apr 2023 13:36:03 +0000 (13:36 +0000)]
[compiler-rt][ASAN] Replace find_executable with shtuil.which in script
distutils is deprecated and shutil.which is the suggested
replacement for this function.
https://peps.python.org/pep-0632/#migration-advice
https://docs.python.org/3/library/shutil.html#shutil.which
which was added in 3.3 (https://docs.python.org/3/library/shutil.html#shutil.which)
and LLVM requires at least 3.6 (https://llvm.org/docs/GettingStarted.html#software).
Reviewed By: delcypher, vitalybuka
Differential Revision: https://reviews.llvm.org/D148528
OCHyams [Wed, 19 Apr 2023 09:02:24 +0000 (10:02 +0100)]
Revert "[Assignment Tracking] Fix fragment error for some DSE-shortened stores"
This reverts commit
fca3e8e024f0015604d21e6f76f3e199345679c5.
Buildbot: https://lab.llvm.org/buildbot/#/builders/121/builds/29766
OCHyams [Wed, 19 Apr 2023 09:01:40 +0000 (10:01 +0100)]
Revert D146987 "[Assignment Tracking] Enable by default"
This reverts commit
107b307bd61e51aa66ea41f1a2c92c1459b39c7e due
to build errors in a parent commit
fca3e8e024f0015604d21e6f76f3e199345679c5
Jay Foad [Wed, 12 Apr 2023 13:22:40 +0000 (14:22 +0100)]
[AMDGPU] Don't transform illegal intrinsics to V_ILLEGAL
This reverts parts of D123693. The functionality of allowing unsupported
intrinsics to select has been superseded by D139000 "Remove function
with incompatible features".
Retain assembler/disassembler support for v_illegal on GFX10+ only,
where it is documented.
Differential Revision: https://reviews.llvm.org/D148127
terrydang [Wed, 19 Apr 2023 08:45:05 +0000 (09:45 +0100)]
[docs] Fix the CMAKE_BUILD_TYPE option in the cmake command in GettingStarted.rst
The cmake command contained a duplicate CMAKE_BUILD_TYPE option in the
section "Compiling the LLVM Suite Source Code".
Guillaume Chatelet [Tue, 18 Apr 2023 15:16:20 +0000 (15:16 +0000)]
[reland][libc] handle memset sequence as a separate struct
These sequence of calls don't really make sense for head_tail and loop_and_tail.
Luke Lau [Thu, 6 Apr 2023 14:26:31 +0000 (15:26 +0100)]
[RISCV] Combine concat_vectors of loads into strided loads
If we're concatenating several smaller loads separated by a stride, we
can try and increase the element size and perform a strided load.
For example:
```
concat_vectors (load v4i8, p+0), (load v4i8, p+n), (load v4i8, p+n*2), (load v4i8, p+n*3)
=>
vlse32 p, stride=n, VL=4
```
This pattern can be produced by the SLP vectorizer.
A special case is when the stride is exactly equal to the width of the
vector, in which case it can be converted into a single consecutive
vector load. For example:
```
concat_vectors (load v4i8, p), (load v4i8, p+4), (load v4i8, p+8), (load v4i8, p+12)
=>
vle8 p, VL=16
```
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D147713
Luke Lau [Thu, 6 Apr 2023 13:48:37 +0000 (14:48 +0100)]
[RISCV] Add tests for concats of vectors that could become strided loads
These patterns of concat_vector nodes of loads can be combined into
widened vector loads or a strided vector loads.
Co-authored-by: Philip Reames <preames@rivosinc.com>
Differential Revision: https://reviews.llvm.org/D147712
OCHyams [Wed, 19 Apr 2023 08:20:58 +0000 (09:20 +0100)]
Reapply D146987 "[Assignment Tracking] Enable by default"
This reverts commit
efc8b52cbd942f4bd5ffe8f64da5fb8a3b7adc32
which reverts D146987.
See https://reviews.llvm.org/D146987 for issues.
OCHyams [Wed, 19 Apr 2023 07:43:02 +0000 (08:43 +0100)]
[Assignment Tracking] Fix fragment error for some DSE-shortened stores
`shortenAssignment` inserts dbg.assigns with fragments describing the dead part
of a shortened store after each dbg.assign linked to the store.
Without this patch it doesn't take into account that the dead part of a
shortened store may be outside the bounds of a variable of a linked
dbg.assign. It also doesn't correctly account for a non-zero offset in the
address modifying `DIExpression` of the dbg.assign (which is possible for
fragments now even though whole variables currently cannot have a non-zero
offset in their alloca).
Fix this by moving the dead slice into variable-space and performing an
intersect of that adjusted slice with the existing fragment.
This fixes a verifier error reported when building fuchsia with assignment
tracking enabled:
https://ci.chromium.org/ui/p/fuchsia/builders/ci/
clang_toolchain.ci.core.x64-release/
b8784000953022145169/overview
Reviewed By: jmorse
Differential Revision: https://reviews.llvm.org/D148536
Krasimir Georgiev [Wed, 19 Apr 2023 08:26:38 +0000 (08:26 +0000)]
Revert "Reapply [SimplifyCFG][LICM] Preserve nonnull, range and align metadata when speculating"
This reverts commit
6f7e5c0f1ac6cc3349a2e1479ac4208465b272c6.
Seems to expose a miscompile in rust, possibly exposing a bug in LLVM
somewhere. Investigation thread over at:
https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/LLVM.
20D146629.20breakage
Emmmer [Mon, 6 Feb 2023 08:17:14 +0000 (16:17 +0800)]
[LLDB][RISCV] Add RVV register infos
RVV stands for "RISC-V V Extension", which adds 32 vector registers, and seven unprivileged CSRs (vstart, vxsat, vxrm, vcsr, vtype, vl, vlenb) to a base scalar RISC-V ISA.
The base vector extension is intended to provide general support for data-parallel execution within the 32-bit instruction encoding space, with later vector extensions supporting richer functionality for certain domains.
This patch adds the definitions of RVV registers in `RegisterInfos_riscv64.h`, whose purpose is to provide support (such as reading, writing, and calculating the offsets) for future register-related functions.
Reviewed By: kito-cheng
Differential Revision: https://reviews.llvm.org/D143374
Pavel Kosov [Wed, 19 Apr 2023 07:59:07 +0000 (10:59 +0300)]
[llvm-exegesis] Allow setting dump file name
This will be used for writing test cases.
~~
Huawei RRI, OS Lab
Reviewed By: courbet
Differential Revision: https://reviews.llvm.org/D147700
Jean Perier [Wed, 19 Apr 2023 07:00:51 +0000 (09:00 +0200)]
[flang][hlfir] Apply component lower bounds in hlfir.designate codegen
The array component indices in the "path" of a fir.slice are zero based
because FIR does not know about the component lower bounds.
When lowering hlfir.designate to FIR for `array%x(i, j)`, convert `i` and
`j` to zero based indices before generating the fir.slice.
Differential Revision: https://reviews.llvm.org/D148627
Chen Zheng [Mon, 9 Jan 2023 04:07:52 +0000 (04:07 +0000)]
[GlobalISelEmitter] handle operand without MVT/class
There are some patterns in td files without MVT/class set
for some operands in target pattern that are from the source
pattern. This prevents GlobalISelEmitter from adding them as
a valid rule, because the target child operand is an
unsupported kind operand. For now, for a leaf child, only
IntInit and DefInit are handled in GlobalISelEmitter.
This issue can be workaround by adding MVT/class to the
patterns in the td files, like the workarounds for patterns
anyext and setcc in PPCInstrInfo.td in D140878.
To avoid adding the same workarounds for other patterns in
td files, this patch tries to handle the UnsetInit case in
GlobalISelEmitter.
Adding the new handling allows us to remove the workarounds
in the td files and also generates many selection rules for
PPC target.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D141247
Matthias Springer [Wed, 19 Apr 2023 06:49:20 +0000 (15:49 +0900)]
[mlir][linalg] ValueBoundsOpInterface: Add support for linalg.index
Differential Revision: https://reviews.llvm.org/D148598
Timm Bäder [Wed, 19 Apr 2023 06:10:13 +0000 (08:10 +0200)]
[clang][Interp][NFC] Small State.cpp refactoring