Commit Graph

432037 Commits

Author SHA1 Message Date
Stanislav Gatev c44c71843f [clang][dataflow] Make the type of the post visit callback consistent
Make the types of the post visit callbacks in `transferBlock` and
`runTypeErasedDataflowAnalysis` consistent.

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

Reviewed-by: ymandel, xazax.hun, gribozavr2
2022-08-03 05:58:38 +00:00
LLVM GN Syncbot 7e8bf0a320 [gn build] Port 68264b6494 2022-08-03 05:46:25 +00:00
Nikolas Klauser 68264b6494 [libc++][ranges] Implement `ranges::{prev, next}_permutation`.
Co-authored-by: Konstantin Varlamov <varconst@apple.com>

Differential Revision: https://reviews.llvm.org/D129859
2022-08-02 22:46:15 -07:00
cpplearner 8a78b72289 [libc++][test] Replace `_LIBCPP_STD_VER` with `TEST_STD_VER`
Differential Revision: https://reviews.llvm.org/D130979
2022-08-03 13:54:04 +08:00
LLVM GN Syncbot 75f6a10d52 [gn build] Port 6bdb642234 2022-08-03 05:36:28 +00:00
Konstantin Varlamov 6bdb642234 [libc++][ranges] Implement `ranges::sample`.
Differential Revision: https://reviews.llvm.org/D130865
2022-08-02 22:34:23 -07:00
Nikolas Klauser 93172c1c2b [libc++][ranges] Implement `ranges::replace_copy{,_if}`.
Co-authored-by: Konstantin Varlamov <varconst@apple.com>

Differential Revision: https://reviews.llvm.org/D129806
2022-08-02 22:32:01 -07:00
Konstantin Varlamov f537a01d39 [libc++][ranges] Fix the return value of `{copy,move}_backward`.
The return value for both of these algorithms is specified as
```
`{last, result - N}` for the overloads in namespace `ranges`.
```
But the current implementation instead returns `{first, result - N}`.

Also add both algorithms to the relevant "robust" tests.

Differential Revision: https://reviews.llvm.org/D130968
2022-08-02 22:22:59 -07:00
Nikolas Klauser 760d2b462c [libc++][ranges] Implement `ranges::remove_copy{, _if}`.
Co-authored-by: Hui Xie <hui.xie1990@gmail.com>

Differential Revision: https://reviews.llvm.org/D130599
2022-08-02 22:19:13 -07:00
Kazu Hirata dc860d55eb [mlir] Add has_value and value to OptionalParseResult
llvm::Optional is in the process of switching to the
std::optional-like interface with has_value/value as opposed to
hasValue/getValue.

This patch adds has_value and value to enable the same transition.

Differential Revision: https://reviews.llvm.org/D130819
2022-08-02 22:16:55 -07:00
John Regehr d469f136be oops-- I pushed previous commit from a fresh checkout and forgot to
git add the new test case, here it is

Differential Revision: https://reviews.llvm.org/D131026
2022-08-02 22:27:28 -06:00
John Regehr 1116fa4765 avoid a bug where we remove a BB and then the next one becomes the
entry block and is illegal due to having more then one predecessor
block

Differential Revision: https://reviews.llvm.org/D131026
2022-08-02 22:23:12 -06:00
Tom Stellard be3587ae9a workflows: Fix typo from 2d3d0f50ce 2022-08-02 21:20:13 -07:00
Craig Topper f19497f7b0 [RISCV] Use InstVisitor in RISCVCodeGenPrepare. NFC
Makes it easy to add new instructions to look at without dispatching
manually.
2022-08-02 21:19:30 -07:00
Walter Erquinigo d179ea12fd [NFC][trace] format source files
Cleanup formatting diff
2022-08-02 21:16:31 -07:00
Tom Stellard 2d3d0f50ce workflows: Remove symbol versions from libclang.so in the libclang ABI test
Now that the symbol version for libclang.so changes for each release again,
we need to remove the symbol versions from the shared library in order
for the ABI checker to be able to compare with an older version of the
shared library.
2022-08-02 21:15:39 -07:00
Chuanqi Xu ce1b24cca8 [IRBuilder] Handle constexpr-bitcast for IRBuilder::CreateThreadLocalAddress
In case that opaque pointers not enabled, there may be some constexpr
bitcast uses for thread local variables and the design of llvm allow
people to sink constant arbitrarily. This breaks the assumption of
IRBuilder::CreateThreadLocalAddress. This patch tries to handle the
case.
2022-08-03 11:13:49 +08:00
Walter Erquinigo d8602bcdfa fix f9b4ea0ce9
This fixes https://lab.llvm.org/buildbot/#/builders/68/builds/37077.
2022-08-02 19:23:28 -07:00
Michał Górny 39d4e169d3 [libc++][test] Propagate host environment to libc++ test suite
Propagate the complete host environment to the tests run via the new
testconfig. This ensures that all envvars needed e.g. for the compiler
to work correctly are present. This mimics the behavior explicitly
implemented in the legacy config.

https://github.com/llvm/llvm-project/issues/56816

Differential Revision: https://reviews.llvm.org/D130843
2022-08-02 21:53:03 -04:00
Igor Zhukov 495519e5f8 [libc++][NFC] Don't rely on `<algorithm>` transitively including `<memory>` in tests
Found by @cpplearner (https://github.com/microsoft/STL/pull/2976#discussion_r935440806)

Differential Revision: https://reviews.llvm.org/D130997
2022-08-02 20:46:05 -04:00
Igor Zhukov db0ac307c9 [libc++] Fix warning C4244 in std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/eval.pass.cpp
frederick-vs-ja noticed that https://github.com/microsoft/STL/pull/2976#issuecomment-1201926893
while we are working on updating LLVM submodule for MS STL:

    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): error C2220: the following warning is treated as an error
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(287): note: see reference to function template instantiation 'void tests<__int64>(void)' being compiled
    [...]\std\numerics\rand\rand.dist\rand.dist.samp\rand.dist.samp.discrete\eval.pass.cpp(33): warning C4244: 'argument': conversion from '__int64' to 'const unsigned int', possible loss of data

Differential Revision: https://reviews.llvm.org/D130963
2022-08-02 20:44:46 -04:00
Paul Kirth d434e40f39 [llvm][NFC] Refactor code to use ProfDataUtils
In this patch we replace common code patterns with the use of utility
functions for dealing with profiling metadata. There should be no change
in functionality, as the existing checks should be preserved in all
cases.

Reviewed By: bogner, davidxl

Differential Revision: https://reviews.llvm.org/D128860
2022-08-03 00:09:45 +00:00
Katherine Rasmussen 6ac30fa6e9 [flang] Add stopped_images to list of intrinsics and add test
Add stopped_images to the list of intrinsic functions. Add a
semantics test for stopped_images.

Reviewed By: klausler, ngeorge1098

Differential Revision: https://reviews.llvm.org/D129513
2022-08-02 17:01:32 -07:00
LLVM GN Syncbot 3ddc280c03 [gn build] Port f9b4ea0ce9 2022-08-02 23:57:33 +00:00
Jakob Johnson f9b4ea0ce9 [trace] Add SBTraceCursor bindings
Add bindings for the `TraceCursor` to allow for programatic traversal of
traces.
This diff adds bindings for all public `TraceCursor` methods except
`GetHwClock` and also adds `SBTrace::CreateNewCursor`. A new unittest
has been added to TestTraceLoad.py that uses the new `SBTraceCursor` API
to test that the sequential and random access APIs of the `TraceCursor`
are equivalent.

This diff depends on D130925.

Test Plan:
`ninja lldb-dotest && ./bin/lldb-dotest -p TestTraceLoad`

Differential Revision: https://reviews.llvm.org/D130930
2022-08-02 16:55:33 -07:00
Austin Kerbow 3dfa562643 [AMDGPU] Add CL option for max-ilp scheduler.
When compiling for multiple targets the scheduler that is selected via the
-misched option is applied globally. This patch adds a target CL option instead.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D131022
2022-08-02 16:52:14 -07:00
Andrey Tretyakov 4bd9d98bc2 [SPIRV] Fix style of LIT tests and remove metadata
Fix style, indentation, comments of LIT tests
and remove unnecessary metadata and attributes.

Differential Revision: https://reviews.llvm.org/D130664
2022-08-03 02:33:24 +03:00
Jason Molenda 63725ebc18 [NFC] Remove no-op code from x86AssemblyInspectionEngine::jmp_to_reg_p
Slava Gurevich noticed this dead code I wrote in jmp_to_reg_p
is never executed, is duplicated, and has comments that seem to
describe the opposite behavior.  Remove the dead code that cannot
be executed.

Differential Revision: https://reviews.llvm.org/D131029
2022-08-02 16:28:10 -07:00
Jonas Devlieghere c7bd61d4a7
Revert "[lldb][modules] Disable Clang Modules in source/Host directory on macOS"
This reverts commit 7cf4ab13af as it was a
temporary workaround that's no longer needed.
2022-08-02 16:14:02 -07:00
Slava Gurevich 4502e3531f [LLDB][NFC] Fix incorrect return status Some functions always return 'false' for both success and fail return paths.
Differential Revision: https://reviews.llvm.org/D131013
2022-08-02 15:56:23 -07:00
Jakob Johnson 6cbc6e9a6d [LLDB] Add SBInstruction::GetControlFlowKind()
D128477 adds the control flow kind for `Instruction` and displays this
in the `thread trace dump instruction -k` command.

This diff exposes the control flow kind via the new
`SBInstruction::GetControlFlowKind` method.

I've expanded `TestDisassembleRawData` to test this method, but please
let me know if there are any other unittests that should also be updated.

Test Plan:
`./bin/lldb-dotest -p TestDisassembleRawData`

Differential Revision: https://reviews.llvm.org/D131005
2022-08-02 15:42:45 -07:00
Mehdi Amini 4f0262c164 Fix use-after-free in SymbolTable::replaceAllSymbolUses
In some cases the recursion will grow the `visited` hash table and
invalidate the cached iterator.
(caught with ASAN)

Differential Revision: https://reviews.llvm.org/D131027
2022-08-02 22:30:17 +00:00
Craig Topper a5605f1f68 [RISCV] Fix operand number in debug message in RISCVMergeBaseOffset.
This used to print from the ADDI where the operand number was
correct. It recently changed to print from the LUI or AUIPC which
needs to use operand 1 instead of 2.

This shows up as a crash with -debug.
2022-08-02 15:27:23 -07:00
Joseph Huber 2b7203a359 [Libomptarget] Deinitialize AMDGPU global state more intentionally
A previous patch made the destruction of the HSA plugin more
deterministic. However, there were still other global values that are not
handled this way. When attempting to call a destructor kernel, the
device would have already been uninitialized and we could not find the
appropriate kernel to call. This is because they were stored in global
containers that had their destructors called already. Merges this global
state into the rest of the info state by putting those global values
inside of the global pointer already allocated and deallocated by the
constructor and destructor. This should allow the AMDGPU plugin to
correctly identify the destructors if we were to run them.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D131011
2022-08-02 18:24:39 -04:00
Jonathan Peyton 9cf6511bff [OpenMP][libomp] Detect if test compiler has omp.h
omp50_taskdep_depobj.c relies on the test compiler's omp.h file.
If the test compiler does not have an omp.h file, then use the one
within the build tree.

Fixes: https://github.com/llvm/llvm-project/issues/56820
Differential Revision: https://reviews.llvm.org/D131000
2022-08-02 17:05:56 -05:00
Chris Bieneman ee4d815008 [DX] Remove IntrNoMem from create handle intrinsic
The create handle intrinsic calls can't be removed, so it was incorrect
to mark them as IntrNoMem.
2022-08-02 16:57:22 -05:00
Nicolai Hähnle f7872cdce1 CommandLine: add and use cl::SubCommand::get{All,TopLevel}
Prefer using these accessors to access the special sub-commands
corresponding to the top-level (no subcommand) and all sub-commands.

This is a preparatory step towards removing the use of ManagedStatic:
with a subsequent change, these global instances will be moved to
be regular function-scope statics.

It is split up to give downstream projects a (albeit short) window in
which they can switch to using the accessors in a forward-compatible
way.

Differential Revision: https://reviews.llvm.org/D129118
2022-08-02 23:49:16 +02:00
Naje George e8468ddebc [flang] Add semantics test for ERROR STOP statement
Reviewed By: ktras

Differential Revision: https://reviews.llvm.org/D130530
2022-08-02 14:46:23 -07:00
Jason Molenda 318454a8e5 Inline my uuid_is_null() implementation in a header file
This either needs to be static, or forced inline, or in a separate
source file.  Given that we only have one function in this
UuidCompatibility.h, I think forced inline for the handful of uses
of it may be best.
2022-08-02 14:24:11 -07:00
Martin Storsjö 59c6f418fa [LLD] [MachO] Fix GCC build warnings
This fixes the following warnings produced by GCC 9:

    ../tools/lld/MachO/Arch/ARM64.cpp: In member function ‘void {anonymous}::OptimizationHintContext::applyAdrpLdr(const lld::macho::OptimizationHint&)’:
    ../tools/lld/MachO/Arch/ARM64.cpp:448:18: warning: comparison of integer expressions of different signedness: ‘int64_t’ {aka ‘long int’} and ‘uint64_t’ {aka ‘long unsigned int’} [-Wsign-compare]
      448 |   if (ldr.offset != (rel1->referentVA & 0xfff))
          |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../tools/lld/MachO/UnwindInfoSection.cpp: In function ‘bool canFoldEncoding(compact_unwind_encoding_t)’:
    ../tools/lld/MachO/UnwindInfoSection.cpp:404:44: warning: comparison between ‘enum<unnamed>’ and ‘enum<unnamed>’ [-Wenum-compare]
      404 |   static_assert(UNWIND_X86_64_MODE_MASK == UNWIND_X86_MODE_MASK, "");
          |                                            ^~~~~~~~~~~~~~~~~~~~
    ../tools/lld/MachO/UnwindInfoSection.cpp:405:49: warning: comparison between ‘enum<unnamed>’ and ‘enum<unnamed>’ [-Wenum-compare]
      405 |   static_assert(UNWIND_X86_64_MODE_STACK_IND == UNWIND_X86_MODE_STACK_IND, "");
          |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D130970
2022-08-03 00:14:39 +03:00
Jason Molenda 96d12187b3 Allow firmware binaries to be specified only by load address
Add support to Mach-O corefiles and to live gdb remote serial protocol
connections for the corefile/remote stub to provide a list of load
addresses of binaries that should be found & loaded by lldb, and nothing
else.  lldb will try to parse the binary out of memory, and if it can
find a UUID, try to find a binary & its debug information based on the
UUID, falling back to using the memory image if it must.

A bit of code unification from three parts of lldb that were loading
individual binaries already, so there is a shared method in
DynamicLoader to handle all of the variations they were doing.

Re-landing this with a uuid_is_null() implementation added to
Utility/UuidCompatibility.h for non-Darwin systems.

Differential Revision: https://reviews.llvm.org/D130813
rdar://94249937
rdar://94249384
2022-08-02 14:14:16 -07:00
Tom Stellard 560efad701 workflows: Release Workflow - Avoid selecting random reviewers when no phab review
If you pass a NULL reivew ID to the differential.revision.search API,
it returns all revisions and we were just taking the first one and
assuming it was associated with the commit in the PR.

We need to exit early if we can't find a Phabricator review associated
with a commit.
2022-08-02 14:07:22 -07:00
LLVM GN Syncbot 577840bc7a [gn build] Port 95a92995d4 2022-08-02 21:01:56 +00:00
Krzysztof Drewniak c2fc8d9b95 [mlir][GPU] Allow bare pointer memrefs when calling GPU kernels
In the ROCm runtime (and probably CUDA as well), all kernel arguments
are aligned. Therefore, enable using bare pointers for memref
arguments to kernels when these memrefs have static shape and a
trivial layout.

This is a substantial optimization to launching kernels that use
memrefs with known, static sizes, since it causes the kernel launch
packet to no longer include information already known to the kernel,
which can enable packing the kernel launch arguments into launch
packets instead of having to allocate an entire separate structure to
hold unneeded memref information.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D130716
2022-08-02 20:58:34 +00:00
Rashmi Mudduluru 95a92995d4 Adds the NSDateFormatter checker to clang-tidy
Differential Revision: https://reviews.llvm.org/D126097
2022-08-02 13:57:44 -07:00
Jason Molenda 803386da2f Revert "Allow firmware binaries to be specified only by load address"
This reverts commit d8879fba88.

Debian bot failure; I included <uuid/uuid.h> to get uuid_is_null() but
don't get it there.  Will memcmp or whatever & recommit.
2022-08-02 13:53:34 -07:00
Jason Molenda d8879fba88 Allow firmware binaries to be specified only by load address
Add support to Mach-O corefiles and to live gdb remote serial protocol
connections for the corefile/remote stub to provide a list of load
addresses of binaries that should be found & loaded by lldb, and nothing
else.  lldb will try to parse the binary out of memory, and if it can
find a UUID, try to find a binary & its debug information based on the
UUID, falling back to using the memory image if it must.

A bit of code unification from three parts of lldb that were loading
individual binaries already, so there is a shared method in
DynamicLoader to handle all of the variations they were doing.

Differential Revision: https://reviews.llvm.org/D130813
rdar://94249937
rdar://94249384
2022-08-02 13:49:30 -07:00
Austin Kerbow 40eec27618 [AMDGPU] Add llvm_unreachable to switch statement added in d7100b398. 2022-08-02 13:45:38 -07:00
Mircea Trofin 4146c1756d [nfc] Remove unused parameter in TailDuplicator::duplicateSimpleBB
Differential Revision: https://reviews.llvm.org/D131008
2022-08-02 13:39:34 -07:00
Ben Langmuir 54110b8aa0 Fix use-after-free in clang-apply-replacements
Accidentally introduced a dangling StringRef in b4c6dc2e66.

Differential Revision: https://reviews.llvm.org/D131017
2022-08-02 13:34:20 -07:00