Commit Graph

395529 Commits

Author SHA1 Message Date
Saleem Abdulrasool d6d0b6559e unwind: repair register restoration for OR1K
Currently, OR1K architecture put the program counter at offset 0x128 of
the current `or1k_thread_state_t`. However, the PC is restored after
updating the thread pointer in `r3`, which causes the PC to be fetched
incorrectly.

This patch swaps the order of restoration of `r9` and `r3`, such that
the PC is restored to `r9` using the current thread state.

Patch by Oi Chee Cheung!

Reviewed By: whitequark, compnerd

Differential Revision: https://reviews.llvm.org/D107042
2021-08-02 16:36:37 +00:00
Valeriy Savchenko 9e02f58780 [analyzer] Highlight arrows for currently selected event
In some cases, when the execution path of the diagnostic
goes back and forth, arrows can overlap and create a mess.
Dimming arrows that are not relevant at the moment, solves this issue.
They are still visible, but don't draw too much attention.

Differential Revision: https://reviews.llvm.org/D92928
2021-08-02 19:15:01 +03:00
Valeriy Savchenko 97bcafa28d [analyzer] Add control flow arrows to the analyzer's HTML reports
This commit adds a very first version of this feature.
It is off by default and has to be turned on by checking the
corresponding box.  For this reason, HTML reports still keep
control notes (aka grey bubbles).

Further on, we plan on attaching arrows to events and having all arrows
not related to a currently selected event barely visible.  This will
help with reports where control flow goes back and forth (eg in loops).
Right now, it can get pretty crammed with all the arrows.

Differential Revision: https://reviews.llvm.org/D92639
2021-08-02 19:15:00 +03:00
Sjoerd Meijer ea23f7fce5 [AArch64] Add shufflevector concat codegen tests. NFC. 2021-08-02 16:15:11 +01:00
Kazu Hirata d4a3ad70d5 [ADT] Remove PointerUnionTypeSelector (NFC)
The last use was removed on May 17, 2019 in commit
9b92875bbd.
2021-08-02 08:07:25 -07:00
Benjamin Kramer 1f04d8ed2e [tsan] Complete renaming kMaxSid to kThreadSlotCount
This was missing from 5c2b48fdb0
2021-08-02 16:52:29 +02:00
Pushpinder Singh 713a5d12cd [OpenMP][AMDGCN] Initial math headers support
With this patch, OpenMP on AMDGCN will use the math functions
provided by ROCm ocml library. Linking device code to the ocml will be
done in the next patch.

Reviewed By: JonChesterfield, jdoerfert, scchan

Differential Revision: https://reviews.llvm.org/D104904
2021-08-02 14:38:52 +00:00
Marshall Clow c4cd573b32 Change code owner of libc++ from Marshall to Louis 2021-08-02 06:57:43 -07:00
Simon Pilgrim f10d4cfc23 [VectorCombine] Fix PR30986 poison test case
Thanks @xbolva00!
2021-08-02 14:16:32 +01:00
Hans Wennborg 12dc13b73c prfchwintrin.h: Make _m_prefetchw take a pointer to volatile (PR49124)
For some reason, Microsoft declares _m_prefetch to take a const void*,
but _m_prefetchw to take a /volatile/ const void*.

Do the same for compatibility.

Differential revision: https://reviews.llvm.org/D106790
2021-08-02 15:16:04 +02:00
David Green c423a586a7 [ARM] Remove setPreservesCFG from ARMBlockPlacement
As of 2829391840 it no longer preserves the CFG, needing to
split blocks in order to add DLS instructions.
2021-08-02 14:15:45 +01:00
Justas Janickas b13fc7311e [OpenCL] __cpp_threadsafe_static_init is by default undefined in OpenCL mode.
Definition of `__cpp_threadsafe_static_init` macro is controlled by
language option Opts.ThreadsafeStatics. This patch sets language
option to false by default in OpenCL mode, resulting in macro
`__cpp_threadsafe_static_init` being undefined. Default value can be
overridden using command line option -fthreadsafe-statics.

Change is supposed to address portability because not all OpenCL
vendors support thread safe implementation of static initialization.

Fixes llvm.org/PR48012

Differential Revision: https://reviews.llvm.org/D107163
2021-08-02 14:10:15 +01:00
Florian Mayer cd2387b56d [hwasan] Commit missed REQUIRES: stable-runtime.
Differential Revision: https://reviews.llvm.org/D107268
2021-08-02 13:58:11 +01:00
Irina Dobrescu b01417d3c5 [AArch64] Optimise min/max lowering in ISel
Differential Revision: https://reviews.llvm.org/D106561
2021-08-02 13:40:21 +01:00
Justas Janickas 9988ab3989 [clang][NFC] Typo fixes. Test commit.
Fixed spelling of word "whether"
2021-08-02 13:25:08 +01:00
Kunwar Shaanjeet Singh Grover 7eeaa782c4 [MLIR] FlatAffineConstraints: Fixed bug where some divisions were not being detected
This patch fixes a bug in the existing implementation of detectAsFloorDiv,
where floordivs with numerator with non-zero constant term and floordivs with
numerator only consisting of a constant term were not being detected.

Reviewed By: vinayaka-polymage

Differential Revision: https://reviews.llvm.org/D107214
2021-08-02 17:51:48 +05:30
Dmitry Vyukov 03372e72d3 tsan: remove unbalanced mutex unlock
The mutex is now unlocked by the scoped Lock object.

Differential Revision: https://reviews.llvm.org/D107266
2021-08-02 14:17:12 +02:00
Guillaume Chatelet 59198d062f [libc] Add a Google Benchmark target to support continuous monitoring of memory operation performance
The next step is to be able to benchmark several implementations at once and compare which one performs best on a particular machine.

Differential Revision: https://reviews.llvm.org/D107265
2021-08-02 12:14:11 +00:00
Simon Pilgrim 7942e20fc8 [VectorCombine] Add PR30986 test case 2021-08-02 13:05:47 +01:00
Dmitry Vyukov 5c2b48fdb0 tsan: add new vector clock
Add new fixed-size vector clock for the new tsan runtime.
For now it's unused.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107167
2021-08-02 13:45:31 +02:00
Dmitry Vyukov 7bd81fe183 tsan: don't save creation stack for some sync objects
Currently we save the creation stack for sync objects always.
But it's not needed to some sync objects, most notably atomics.
We simply don't use atomic creation stack anywhere.
Allow callers to control saving of the creation stack
and don't save it for atomics.

Depends on D107257.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107258
2021-08-02 13:30:24 +02:00
Dmitry Vyukov 14c7507b9d tsan: add LIKELY/UNLIKELY to MetaMap::GetSync
MetaMap::GetSync shows up in profiles,
so add LIKELY/UNLIKELY annotations.

Depends on D107256.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107257
2021-08-02 13:29:55 +02:00
Dmitry Vyukov 9e3e97aa81 tsan: refactor MetaMap::GetAndLock interface
Don't lock the sync object inside of MetaMap methods.
This has several advantages:
 - the new interface does not confuse thread-safety analysis
   so we can remove a bunch of NO_THREAD_SAFETY_ANALYSIS attributes
 - this allows use of scoped lock objects
 - this allows more flexibility, e.g. locking some other mutex
   between searching and locking the sync object
Also prefix the methods with GetSync to be consistent with GetBlock method.
Also make interface wrappers inlinable, otherwise we either end up with
2 copies of the method, or with an additional call.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107256
2021-08-02 13:29:46 +02:00
Sjoerd Meijer 46a861af3d [CostModel][AArch64] Add some shuffle concat tests. NFC.
Test ported over from test/Analysis/CostModel/ARM/shuffle.ll.
2021-08-02 12:11:00 +01:00
Carl Ritson 675c942373 [AMDGPU] Disable NSA for BVH instructions when appropriate
Check maximum NSA size when selecting NSA or non-NSA BVH instructions.

Differential Revision: https://reviews.llvm.org/D103230
2021-08-02 20:09:26 +09:00
Petar Avramovic dc3fbe293f GlobalISel: Fix infinite loop in legalization artifact combiner
ArtifactValueFinder keeps trying to combine g_unmerge_values in some cases.
Fix is to skip combine attempt for dead defs.

Differential Revision: https://reviews.llvm.org/D106879
2021-08-02 12:58:10 +02:00
Simon Pilgrim 872a950033 [CostModel] Treat 'widen subvector' patterns as zero cost
As discussed on D107228, widening a subvector by inserting the whole subvector into the bottom a larger undef vector should always be cheap enough that we can treat it as zero cost.

NOTE: If this proves to cause issues we have the option of introducing a "SK_WidenSubvector" shuffle kind enum that targets could override the zero cost, but that doesn't seem necessary atm.

Differential Revision: https://reviews.llvm.org/D107228
2021-08-02 11:43:10 +01:00
Florian Mayer 66b4aafa2e [hwasan] Detect use after scope within function.
Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D105201
2021-08-02 11:34:12 +01:00
Simon Pilgrim 7397dcb403 [TTI] Add basic SK_InsertSubvector shuffle mask recognition
This patch adds an initial ShuffleVectorInst::isInsertSubvectorMask helper to recognize 2-op shuffles where the lowest elements of one of the sources are being inserted into the "in-place" other operand, this includes "concat_vectors" patterns as can be seen in the Arm shuffle cost changes. This also helped fix a x86 issue with irregular/length-changing SK_InsertSubvector costs - I'm hoping this will help with D107188

This doesn't currently attempt to work with 1-op shuffles that could either be a "widening" shuffle or a self-insertion.

The self-insertion case is tricky, but we currently always match this with the existing SK_PermuteSingleSrc logic.

The widening case will be addressed in a follow up patch that treats the cost as 0.

Masks with a high number of undef elts will still struggle to match optimal subvector widths - its currently bounded by minimum-width possible insertion, whilst some cases would benefit from wider (pow2?) subvectors.

Differential Revision: https://reviews.llvm.org/D107228
2021-08-02 11:23:44 +01:00
Simon Pilgrim 0579050116 Fix MSVC signed/unsigned comparison warning. NFCI. 2021-08-02 11:23:43 +01:00
Rosie Sumpter f117ed542f [LoopFlatten] Fix missed LoopFlatten opportunity
When the limit of the inner loop is a known integer, the InstCombine
pass now causes the transformation e.g. imcp ult i32 %inc, tripcount ->
icmp ult %j, tripcount-step (where %j is the inner loop induction
variable and %inc is add %j, step), which is now accounted for when
identifying the trip count of the loop. This is also an acceptable use
of %j (provided the step is 1) so is ignored as long as the compare
that it's used in is also the condition of the inner branch.

Differential Revision: https://reviews.llvm.org/D105802
2021-08-02 11:09:54 +01:00
Andrzej Warzynski 23d4c4f3fb [flang][nfc] Fix variable names in `FrontendOptions` & `PreprocessorOptions`
As all member variables in `FrontendOptions` and `PreprocessorOptions`
are public, we should be naming them as `variable` rather than
`variable_` [1]. This patch fixes that.

Also, `FrontendOptions` & `PreprocessorOptions` are re-defined as a
structs rather than classes (all fields are meant to be public).

[1]
https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md#naming

Differential Revision: https://reviews.llvm.org/D107062
2021-08-02 10:08:31 +00:00
David Green 2829391840 [ARM] Revert WLSTP to DLSTP if the target block is out of range
If the block target for a WLSTP instruction is known to be out of range,
and cannot be fixed by the ARMBlockPlacementPass, we can relax it to a
DLSTP (and cmp/branch) to still allow the creation of tail predicated
loops. That is what this patch does, adding extra revert code to the
fallback path of ARMBlockPlacementPass.

Due to the code produced when reverting, this creates a DLSTP between a
Bcc and a Br. As a DLS isn't necessarily a terminator we need to split
the block to move the DLS/Br into.

Differential Revision: https://reviews.llvm.org/D104709
2021-08-02 10:59:52 +01:00
Alex Zinenko 58cc5a4c9f [OpenMPIRBuilder] Add a constructor to ReductionInfo to appease gcc5
Otherwise, it produces wrong code for brace initializers.
2021-08-02 11:49:32 +02:00
Cullen Rhodes 7ed0120d84 [AArch64][AsmParser] NFC: Parser.Lex() -> Lex()
Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D107146
2021-08-02 09:48:41 +00:00
Andy Yankovsky 307b1fddd4 [clang-tidy] Always open files using UTF-8 encoding
The encoding used for opening files depends on the OS and might be different
from UTF-8 (e.g. on Windows it can be CP-1252). The documentation files use
UTF-8 and might be incompatible with other encodings. For example, right now
`clang-tools-extra/docs/clang-tidy/checks/abseil-no-internal-dependencies.rst`
has non-ASCII quotes and running `add_new_check.py` fails on Windows, because
it tries to read the file with incompatible encoding.

Use `io.open` for compatibility with both Python 2 and Python 3.

Reviewed By: kbobyrev

Differential Revision: https://reviews.llvm.org/D106792
2021-08-02 11:36:04 +02:00
Dmitry Vyukov 7c6cca4b6e tsan: minor IgnoreSet refactoring
1. Move kMaxSize declaration to private section.
2. Inline Reset, it's trivial and called semi-frequently.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107215
2021-08-02 11:13:51 +02:00
Dmitry Vyukov 8a49e053ca tsan: inline ProcessPendingSignals check
ProcessPendingSignals is called in all interceptors
and user atomic operations. Make the fast-path check
(no pending signals) inlinable.

Reviewed By: melver

Differential Revision: https://reviews.llvm.org/D107217
2021-08-02 11:05:45 +02:00
Matthias Springer 192e111e76 [mlir][linalg] Fix comments around ConstraintsSet
Differential Revision: https://reviews.llvm.org/D107018
2021-08-02 17:53:28 +09:00
David Spickett e517a2405f Revert "[libcxx][CI] Work around Arm buildkite failures"
This reverts commit f8bef47348.

Buildkite agent 3.32.0 includes a fix for the PATH issue.
https://github.com/buildkite/agent/releases/tag/v3.32.0

Differential Revision: https://reviews.llvm.org/D107172
2021-08-02 09:32:08 +01:00
Butygin 00a756d3f6 [mlir] Remove invalid DeallocOpLowering pattern insertion
It is inserted later under then condition.

Differential Revision: https://reviews.llvm.org/D107238
2021-08-02 11:27:44 +03:00
David Green 85455192e1 [ARM] Add trackLiveness to block-placement.mir. NFC
Also move the test to mve-wls-block-placement.mir, to better fit what it
tests.
2021-08-02 09:03:22 +01:00
Max Kazantsev c5b63714b5 [GC][NFC] Make getGCStrategy by name available in IR
We might want to use info from GC strategy in middle end analysis.
The motivation for this is provided in D99135: we may want to ask
a GC if it's going to work with a given pointer (currently this code
makes naive check by the method name).

Differetial Revision: https://reviews.llvm.org/D100559
Reviewed By: reames
2021-08-02 14:26:04 +07:00
Kirill Bobyrev e0f2d4af03
[clangd] Fix the crash in getQualification
Happens when DestContext is LinkageSpecDecl and hense CurContext happens to be
both not TagDecl and NamespaceDecl.

Minimal reproducer: trigger define outline in

```
namespace ns {
extern "C" {
typedef int foo;
}
foo Fo^o(int id) { return id; }
}
```

Reviewed By: kadircet

Differential Revision: https://reviews.llvm.org/D107047
2021-08-02 09:08:25 +02:00
Alina Sbirlea bd19ba9d6d [docs]Update meeeting frequency to match new cal entry 2021-08-01 23:48:25 -07:00
Lang Hames 07a5b7e5b1 [examples] Fix incomplete_type on ZLinux when compiling RemoteJITUtils.
When compiling on ZLinux, we got this error:

/llvm-project/llvm/examples/OrcV2Examples/LLJITWithRemoteDebugging/ \
RemoteJITUtils.h:80:65:   required from here...
/usr/include/c++/7/bits/unique_ptr.h:76:22: error: invalid application of
'sizeof' to incomplete type 'llvm::orc::RemoteExecutorProcessControl'
  static_assert(sizeof(_Tp)>0,

This patch just removes nullptr from the initialization of
std::unique_ptr<RemoteExecutorProcessControl> to avoid the issue.

Patch by Tung D. Le (tung@jp.ibm.com). Thanks Tung!

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D107247
2021-08-02 15:15:15 +10:00
Carl Ritson a441de6d94 [AMDGPU][GlobalISel] Add missing default mapping for BVH intrinsics
Application of default mapping to BVH intrinsics was missing.
Copy parts of SelectionDAG test to GlobalISel test as these would
have indicated this error.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D107211
2021-08-02 12:43:38 +09:00
Freddy Ye d268c20070 [X86] Support auto-detect for tigerlake and alderlake
Differential Revision: https://reviews.llvm.org/D107245
2021-08-02 11:01:01 +08:00
Muhammad Omair Javaid 97c6ef4ea6 [LLDB] Change pexpect timeout to 30 to 60
Test dependent on pexpect fail randomly with timeouts on Arm/AArch64 Linux
buildbots. I am setting pexpect timeout from 30 to 60.

I will revert this back if this doesnt improve random failures.
2021-08-02 06:34:11 +05:00
Muhammad Omair Javaid a94fbb25de Revert "Revert "[LLDB][GUI] Expand selected thread tree item by default""
This reverts commit fd18f0e84c.

I reverted this change to see its effect on failing GUI tests on LLDB
Arm/AArch64 Linux buildbots. I could not find any evidence against this
particular change so reverting it back.

Differential Revision: https://reviews.llvm.org/D100243
2021-08-02 05:29:32 +05:00