Commit Graph

431899 Commits

Author SHA1 Message Date
Nicolai Hähnle 2fe3589acd ManagedStatic: remove from PluginLoader
Differential Revision: https://reviews.llvm.org/D129123
2022-08-03 10:41:58 +02:00
Nicolai Hähnle 48c401a60e ManagedStatic: remove from TimeProfiler
Differential Revision: https://reviews.llvm.org/D129121
2022-08-03 10:41:58 +02:00
Timm Bäder 11e52ecf74 [clang] Short-circuit trivial constructors when evaluating arrays
VisitCXXConstructExpr() will later do something similar, but for large
arrays, we should try to do it once an not for every element.

Fixes #56774

Differential Revision: https://reviews.llvm.org/D130791
2022-08-03 10:38:15 +02:00
Dawid Jurczak 3d51e2727d [NFC] Remove some boilerplate from SmallVector unit tests
In SmallVector unit test, referring test suite members every time using 'this'
(due to how non-dependent name lookups works) is quite cumbersome and can be improved with aliases.
Some test cases already use this approach, in this change we expand that approach to whole test file.

Differential Revision: https://reviews.llvm.org/D129990
2022-08-03 10:32:15 +02:00
Jannik Silvanus d0bfebda5b [Docs] Improve cycle and closed path definitions
Improve the cycle definition, by avoiding usage of not yet defined
or only vaguely defined terminology inside definitions.
More precisely, the existing definition defined "outermost cycles",
and then proceeded to use the term "cycles" for further definitions,
which in turn were used to actually define "cycles".

Now, instead only define "cycles". This does not change the meaning
of a cycle, which depends on the chosen surrounding (subgraph) of a CFG.

Also mention the function CFG in the first definition, because later
later definitions require it anyways.

Also slightly improve the definition of a closed path, by explicitly
requiring the inner nodes to be distinct.

Differential Revision: https://reviews.llvm.org/D130891
2022-08-03 10:28:13 +02:00
Alexander Belyaev 3285f94244 [mlir] Disable `misc-const-correctness` clang-tidy check.
https://clang.llvm.org/extra/clang-tidy/checks/misc/const-correctness.html
2022-08-03 10:18:43 +02:00
Liu, Chen3 5bbb0a831f [X86] Using `X86MemOperand` instead of `Operand` for `i32mem_TC` and `i64mem_TC`
To fix build fail when X86_GEN_FOLD_TABLES is enabled.

Differential Revision: https://reviews.llvm.org/D131049
2022-08-03 16:17:51 +08:00
Nikita Popov b128e057c1 [AA] Make ModRefInfo a bitmask enum (NFC)
Mark ModRefInfo as a bitmask enum, which allows using normal
& and | operators on it. This supersedes various functions like
unionModRef() and intersectModRef(). I think this makes the code
cleaner than going through helper functions...

Differential Revision: https://reviews.llvm.org/D130870
2022-08-03 10:05:55 +02:00
Max Kazantsev 34ae308c73 [SCEV] Use context to strengthen flags of BinOps
Sometimes SCEV cannot infer nuw/nsw from something as simple as
```
  len in [0, MAX_INT]
...
  iv = phi(0, iv.next)
  guard(iv <s len)
  guard(iv <u len)
  iv.next = iv + 1
```
just because flag strenthening only relies on definition and does not use local facts.
This patch adds support for the simplest case: inference of flags of `add(x, constant)`
if we can contextually prove that `x <= max_int - constant`.

In case if it has negative CT impact, we can add an option to switch it off. I woudln't
expect that though.

Differential Revision: https://reviews.llvm.org/D129643
Reviewed By: apilipenko
2022-08-03 14:08:57 +07:00
Stanislav Gatev 817dd5e3fd [clang][dataflow] Rename member to make it clear that it isn't stable
Rename `DataflowAnalysisContext::getStableStorageLocation(QualType)`
to `createStorageLocation`, to make it clear that it doesn't return
a stable storage location.

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

Reviewed-by: ymandel, xazax.hun, gribozavr2
2022-08-03 06:25:02 +00:00
Utkarsh Saxena 9ef11616b2 Add foldings for multi-line comment.
Differential Revision: https://reviews.llvm.org/D130081
2022-08-03 08:19:12 +02:00
jacquesguan 752c9d0dab [mlir][Math] Add constant folder for AtanOp.
This patch adds constant folder for AtanOp which only supports single and double precision floating-point.

Differential Revision: https://reviews.llvm.org/D130983
2022-08-03 14:10:02 +08:00
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