platform/upstream/llvm.git
3 years ago[Inline] Fix incorrectly dropped noalias metadata
Nikita Popov [Wed, 18 Nov 2020 20:08:54 +0000 (21:08 +0100)]
[Inline] Fix incorrectly dropped noalias metadata

This is the same fix as 23aeadb89df38406dc4d929d08286f7ce31040eb,
just for CloneScopedAliasMetadata rather than PropagateCallSiteMetadata.

In this case the previous outcome was incorrectly dropped metadata,
as it was not part of the computed metadata map.

The real change in the test is that the first load now retains
metadata, the rest of the changes are due to changes in metadata
numbering.

3 years ago[Inline] Expand test to show dropped metadata (NFC)
Nikita Popov [Wed, 18 Nov 2020 20:01:56 +0000 (21:01 +0100)]
[Inline] Expand test to show dropped metadata (NFC)

The metadata from the %c load gets dropped.

3 years agoRevert "Expand existing loopsink testing to also test loopsinking using new pass...
Jamie Schmeiser [Wed, 18 Nov 2020 20:17:53 +0000 (15:17 -0500)]
Revert "Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug."

This reverts commit d4ba28bddc89a14885218b9eaa4fbf6654c2a5bd.

3 years agoRevert "[tsan] Add pthread_cond_clockwait interceptor"
Wolfgang Pieb [Wed, 18 Nov 2020 18:15:43 +0000 (10:15 -0800)]
Revert "[tsan] Add pthread_cond_clockwait interceptor"

This reverts commit 16eb853ffdd1a1ad7c95455b7795c5f004402e46.

The test is failing on some Linux build bots. See the review for
an example.

3 years ago[modules] Fix crash in call to `FunctionDecl::setPure()`
Andrew Gallagher [Wed, 18 Nov 2020 19:54:34 +0000 (11:54 -0800)]
[modules] Fix crash in call to `FunctionDecl::setPure()`

In some cases, when deserializing a `CXXMethodDecl` of a `CXXSpecializationTemplateDecl`,
the call to `FunctionDecl::setPure()` happens before the `DefinitionData` member has been
populated (which appears to happen lower down in a `mergeRedeclarable` call), causing a
crash (https://reviews.llvm.org/P8228).

This diff fixes this by deferring the `FunctionDecl::setPure()` till after the `DefinitionData` has
been filled in.

Reviewed By: lxfind

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

3 years ago[Inline] Fix incorrect noalias metadata application (PR48209)
Nikita Popov [Wed, 18 Nov 2020 19:48:45 +0000 (20:48 +0100)]
[Inline] Fix incorrect noalias metadata application (PR48209)

The VMap also contains a mapping from Argument => Instruction,
where the instruction is part of the original function, not the
inlined one. The code was assuming that all the instructions in
the VMap were inlined.

This was a pre-existing problem for the loop access metadata, but
was extended to the more common noalias metadata by
27f647d117087ca11959e232e6443f4aee31e966, thus causing miscompiles.

There is a similar assumption inside CloneAliasScopeMetadata(), so
that one likely needs to be fixed as well.

3 years ago[Inline] Add test for PR48209 (NFC)
Nikita Popov [Wed, 18 Nov 2020 19:45:40 +0000 (20:45 +0100)]
[Inline] Add test for PR48209 (NFC)

The test shows noalias metadata being incorrectly applied to the
instruction producing the argument for the call.

3 years ago[libc][NFC][Obvious] Remove few unnecessary pieces from ilogb tests.
Siva Chandra Reddy [Wed, 18 Nov 2020 19:02:24 +0000 (11:02 -0800)]
[libc][NFC][Obvious] Remove few unnecessary pieces from ilogb tests.

3 years agoExpand existing loopsink testing to also test loopsinking using new pass manager...
Jamie Schmeiser [Wed, 18 Nov 2020 19:08:42 +0000 (14:08 -0500)]
Expand existing loopsink testing to also test loopsinking using new pass manager and fix LICM bug.
Summary:
Expand existing loopsink testing to also test loopsinking using new pass
manager.  Enable memoryssa for loopsink with new pass manager.  This
combination exposed a bug that was previously fixed for loopsink
without memoryssa.  When sinking an instruction into a loop, the source
block may not be part of the loop but still needs to be checked for
pointer invalidation.  This is the fix for bugzilla #39695 (PR 54659)
expanded to also work with memoryssa.

Respond to review comments.  Enable Memory SSA in legacy Loop Sink pass
under EnableMSSALoopDependency option control.  Update tests accordingly.

Respond to review comments.  Add options controlling whether memoryssa is
used for loop sink, defaulting to off.  Expand testing based on these
options.

Respond to review comments.  Properly indicated preserved analyses.

Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: asbirlea (Alina Sbirlea)
Differential Revision: https://reviews.llvm.org/D90249

3 years ago[BasicAA] Remove assert in AA evaluator
Nikita Popov [Wed, 18 Nov 2020 18:06:32 +0000 (19:06 +0100)]
[BasicAA] Remove assert in AA evaluator

As reported in https://reviews.llvm.org/D91383#2401825, this
assert breaks external -aa-eval tests. We'll have to fix this
case before re-enabling it.

3 years ago[GWP-ASan] Respect GWP_ASAN_DEFAULT_ENABLED compile-time macro
Roland McGrath [Wed, 18 Nov 2020 17:29:30 +0000 (09:29 -0800)]
[GWP-ASan] Respect GWP_ASAN_DEFAULT_ENABLED compile-time macro

If the containing allocator build uses -DGWP_ASAN_DEFAULT_ENABLED=false
then the option will default to false.  For e.g. Scudo, this is simpler
and more efficient than using -DSCUDO_DEFAULT_OPTIONS=... to set gwp-asan
options that have to be parsed from the string at startup.

Reviewed By: hctim

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

3 years ago[MLIR][SPIRV] Rename `spv._reference_of` to `spv.mlir.referenceof`
ergawy [Wed, 18 Nov 2020 17:43:06 +0000 (12:43 -0500)]
[MLIR][SPIRV] Rename `spv._reference_of` to `spv.mlir.referenceof`

This commit does the renaming mentioned in the title in order to bring
'spv' dialect closer to the MLIR naming conventions.

Reviewed By: antiagainst

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

3 years ago[clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly.
Yitzhak Mandelbaum [Mon, 16 Nov 2020 14:30:21 +0000 (14:30 +0000)]
[clang-tidy] Allow `TransformerClangTidyCheck` clients to set the rule directly.

Adds support for setting the `Rule` field. In the process, refactors the code that accesses that field and adds a constructor that doesn't require a rule argument.

This feature is needed by checks that must set the rule *after* the check class
is constructed. For example, any check that maintains state to be accessed from
the rule needs this support. Since the object's fields are not initialized when
the superclass constructor is called, they can't be (safely) captured by a rule
passed to the existing constructor.  This patch allows constructing the check
superclass fully before setting the rule.

As a driveby fix, removed the "optional" from the rule, since rules are just a
set of cases, so empty rules are evident.

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

3 years agoRevert "[build] normalize components dependencies"
serge-sans-paille [Wed, 18 Nov 2020 18:19:36 +0000 (19:19 +0100)]
Revert "[build] normalize components dependencies"

This reverts commit c6ef6e1690d517b3401ea06b1fe46871eb67434d.

Basically, publicly linked libraries have a different semantic than components,
which link libraries privately.

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

3 years ago[NFC][LoopIdiom] Left-shift-until-bittest: revisit test coverage
Roman Lebedev [Wed, 18 Nov 2020 17:53:19 +0000 (20:53 +0300)]
[NFC][LoopIdiom] Left-shift-until-bittest: revisit test coverage

3 years agoRevert "Revert "[clangd] Implement textDocument/implementation (Xref layer)""
Utkarsh Saxena [Wed, 18 Nov 2020 17:13:11 +0000 (18:13 +0100)]
Revert "Revert "[clangd] Implement textDocument/implementation (Xref layer)""

This reverts commit 0016ab6f3632968e52eb83de021908f0c94bbb10.

Fix: Consume error from Expected<T>.

3 years ago[VP] Non-signalling llvm.vp.* intrinsics are speculatable
Simon Moll [Wed, 18 Nov 2020 16:51:46 +0000 (17:51 +0100)]
[VP] Non-signalling llvm.vp.* intrinsics are speculatable

This is specifically required by the upcoming ExpandVectorPredication
pass (D78203) to recognize llvm.vp.* intrinsics that may ignore their
predicates.

3 years agolld/MachO: Move MachOOptTable to DriverUtils.cpp, remove DriverUtils.h
Nico Weber [Wed, 18 Nov 2020 17:31:47 +0000 (12:31 -0500)]
lld/MachO: Move MachOOptTable to DriverUtils.cpp, remove DriverUtils.h

This makes lld/MachO look more like lld/COFF and lld/ELF, as discussed
in D91640.

3 years ago[AMDGPU] Fix v3f16 interaction with image store workaround
Sebastian Neubauer [Thu, 5 Nov 2020 14:09:56 +0000 (15:09 +0100)]
[AMDGPU] Fix v3f16 interaction with image store workaround

In some cases, the wrong amount of registers was reserved.

Also enable more v3f16 tests.

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

3 years ago[libc++] Implements multiline regex support.
Mark de Wever [Wed, 18 Nov 2020 17:09:13 +0000 (18:09 +0100)]
[libc++] Implements multiline regex support.

This resolves LWG2503.

3 years agoRevert "[clangd] Implement textDocument/implementation (Xref layer)"
Utkarsh Saxena [Wed, 18 Nov 2020 17:04:20 +0000 (18:04 +0100)]
Revert "[clangd] Implement textDocument/implementation (Xref layer)"

This reverts commit 43243208fa6fafe8b91e42c82bc56db9d99f76d3.

3 years agoHazardRecognizer - Fix definition/declaration argument name mismatches. NFCI.
Simon Pilgrim [Wed, 18 Nov 2020 16:45:25 +0000 (16:45 +0000)]
HazardRecognizer - Fix definition/declaration argument name mismatches. NFCI.

Consistently use SUnit *SU (or drop the argname entirely if not used like the other HazardRecognizer methods).

Silences cppcheck warnings.

3 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Wed, 18 Nov 2020 16:23:04 +0000 (16:23 +0000)]
Fix unused variable warning. NFCI.

We're just performing a null pointer check, we don't need the actual variable.

3 years ago[SystemZ][NFC] Group SystemZ tests in SystemZ folder
Abhina Sreeskantharajan [Wed, 18 Nov 2020 16:48:28 +0000 (11:48 -0500)]
[SystemZ][NFC] Group SystemZ tests in SystemZ folder

This patch creates a SystemZ folder in clang/test/CodeGen to contain systemz-related lit tests.

Reviewed By: muiez

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

3 years ago[OpenMP] [DOCS] Update OMP5.1 feature status table [NFC]
dreachem [Wed, 18 Nov 2020 16:43:43 +0000 (10:43 -0600)]
[OpenMP] [DOCS] Update OMP5.1 feature status table [NFC]

Adding features in OpenMP 5.1 specification, as documented in feature change history, to the 5.1 table. I alphabetized the rows of the table according to the category. For deprecating master construct, I just used 'other' as the category.

Reviewed By: jdoerfert

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

3 years agolld: Make tests depend on llvm-symbolizer after bc98034040
Nico Weber [Wed, 18 Nov 2020 16:42:46 +0000 (11:42 -0500)]
lld: Make tests depend on llvm-symbolizer after bc98034040

Fixes test failures when building just `check-lld` in a clean build dir.

3 years ago[llvm] fix global_downgraded_to_static test
Mikhail Goncharov [Wed, 18 Nov 2020 16:19:03 +0000 (17:19 +0100)]
[llvm] fix global_downgraded_to_static test

after 9aa789820027 https://reviews.llvm.org/D90930

3 years ago[NFC] Use [MC]Register for Hexagon target
Gaurav Jain [Thu, 5 Nov 2020 03:10:29 +0000 (19:10 -0800)]
[NFC] Use [MC]Register for Hexagon target

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

3 years ago[clangd] Implement textDocument/implementation (Xref layer)
Utkarsh Saxena [Wed, 18 Nov 2020 10:57:36 +0000 (11:57 +0100)]
[clangd] Implement textDocument/implementation (Xref layer)

Xref layer changes for textdocument/implementation (https://microsoft.github.io/language-server-protocol/specification#textDocument_implementation)

This currently shows all functions (implementations) that overrides a virtual function.

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

3 years agoSpeculativeExecution: Allow speculating more instruction types
Piotr Sobczak [Wed, 18 Nov 2020 09:01:25 +0000 (10:01 +0100)]
SpeculativeExecution: Allow speculating more instruction types

Support more instructions in SpeculativeExecution pass:
- ExtractValue
- InsertValue
- Trunc
- Freeze

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

3 years ago[DAGCombiner] Precommit Sext Tests for D91589
Simon Pilgrim [Wed, 18 Nov 2020 15:55:52 +0000 (15:55 +0000)]
[DAGCombiner] Precommit Sext Tests for D91589

Patch by: @laytonio (Layton Kifer)

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

3 years ago[OPENMP]Fix PR48174: compile-time crash with target enter data on a global struct.
Alexey Bataev [Tue, 17 Nov 2020 21:55:59 +0000 (13:55 -0800)]
[OPENMP]Fix PR48174:  compile-time crash with target enter data on a global struct.

The compiler should treat array subscript with base pointer as a first
pointer in complex data, it is used only for member expression with base
pointer.

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

3 years ago[libc][obvious] Fix fdim[f|l] signatures in stdc spec.
Siva Chandra Reddy [Wed, 18 Nov 2020 15:28:51 +0000 (07:28 -0800)]
[libc][obvious] Fix fdim[f|l] signatures in stdc spec.

3 years ago[AMDGPU] Fix and extend vccz workarounds
Jay Foad [Tue, 17 Nov 2020 11:52:52 +0000 (11:52 +0000)]
[AMDGPU] Fix and extend vccz workarounds

We have workarounds for two different cases where vccz can get out of
sync with the value in vcc. This fixes them in two ways:

1. Fix the case where the def of vcc was in a previous basic block, by
pessimistically assuming that vccz might be incorrect at a basic block
boundary.

2. Fix the handling of pre-existing waitcnt instructions by calling
generateWaitcntInstBefore before examining ScoreBrackets to determine
whether there's an outstanding smem read operation.

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

3 years ago[Reassociate] Don't convert add-like-or's into add's if they appear to be part of...
Roman Lebedev [Wed, 18 Nov 2020 14:21:04 +0000 (17:21 +0300)]
[Reassociate] Don't convert add-like-or's into add's if they appear to be part of load-combining idiom

As Wei Mi is reporting in post-commit review
  https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201116/853479.html
teaching -reassociate about add-like-or's (70472f3) results in breaking apart
load widening patterns, and reassociating them.

For now, simply exclude any such `or` that appears to be a root of
load widening idiom from the or->add transformation.

Note that the heuristic is greedy, it doesn't ensure that loads
can *actually* be widened into a single load.

3 years ago[NFC][Reassociate] Add patterns where `or` is part of load reduction idiom
Roman Lebedev [Wed, 18 Nov 2020 14:14:26 +0000 (17:14 +0300)]
[NFC][Reassociate] Add patterns where `or` is part of load reduction idiom

As Wei Mi is reporting in post-commit review:
  https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20201116/853479.html
teaching -reassociate about add-like-or's (70472f3) results in breaking apart
load widening patterns, and reassociating them.

While that's great, it prevents the actual load widening in backend,
and that is not good. We should have load widening in middle-end,
but for now we should at least not regress the naive patterns..

3 years ago[AST] Enhance the const expression evaluator to support error-dependent exprs.
Haojian Wu [Wed, 18 Nov 2020 14:48:06 +0000 (15:48 +0100)]
[AST] Enhance the const expression evaluator to support error-dependent exprs.

Fix a crash when evaluating a constexpr function which contains
recovery-exprs. https://bugs.llvm.org/show_bug.cgi?id=46837

Would be nice to have constant expression evaluator support general template
value-dependent expressions, but it requires more work.

This patch is a good start I think, to handle the error-only
value-dependent expressions.

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

3 years ago[X86] Add broadcast merge test case for PR48215
Simon Pilgrim [Wed, 18 Nov 2020 14:06:19 +0000 (14:06 +0000)]
[X86] Add broadcast merge test case for PR48215

3 years agoFix unused variables in release build
Mikhail Goncharov [Wed, 18 Nov 2020 14:10:57 +0000 (15:10 +0100)]
Fix unused variables in release build

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

3 years ago[AMDGPU] Rename pseudo S_WAITCNT_IDLE to S_WAIT_IDLE. NFC.
Jay Foad [Wed, 18 Nov 2020 14:03:43 +0000 (14:03 +0000)]
[AMDGPU] Rename pseudo S_WAITCNT_IDLE to S_WAIT_IDLE. NFC.

3 years ago[ConstraintElimination] Refactor constraint extraction (NFC).
Florian Hahn [Tue, 17 Nov 2020 17:38:19 +0000 (17:38 +0000)]
[ConstraintElimination] Refactor constraint extraction (NFC).

This patch generalizes the extraction of a constraint for a given
condition. It allows decompose to return a vector of c * X pairs, which
allows de-composing multiple instructions in the future.

It also adds more clarifying comments.

3 years ago[clangd] Remove the trailing "." in add-using message.
Haojian Wu [Wed, 18 Nov 2020 13:43:15 +0000 (14:43 +0100)]
[clangd] Remove the trailing "." in add-using message.

to be consistent witih other code actions.

Reviewed By: adamcz

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

3 years ago[SystemZ] Use ISD::ABS opcode during isel.
Jonas Paulsson [Wed, 18 Nov 2020 10:40:18 +0000 (11:40 +0100)]
[SystemZ] Use ISD::ABS opcode during isel.

The SystemZISD::IABS node is no longer needed since ISD::ABS can be used
instead.

Review: Ulrich Weigand
Differential Revision: https://reviews.llvm.org/D91697

3 years ago[lldb][NFC] Don't let Process inherit from UserID
Raphael Isemann [Wed, 18 Nov 2020 13:30:06 +0000 (14:30 +0100)]
[lldb][NFC] Don't let Process inherit from UserID

I noticed that Process is inheriting from UserID to store its PID value. This patch
replaces this with a dedicated field in the Process class. This is NFC, but has some
small effects on the code using Process:
* `GetID()` now returns a `lldb::pid_t` like all other process code instead of `lldb::user_id_t`. Both are typedefs for `uint64_t`, so no change in behaviour.
* The equality operators defined for UserID no longer accept Process instances.
* Removes the inherited method `Process::Clear()` which didn't actually clear anything beside the PID value.

We maybe should also remove the getters/setters to `S/GetPID` or something like that. I can update all the code for that
in a follow-up NFC commit.

Reviewed By: labath

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

3 years ago[ARM][LowOverheadLoops] Merge VCMP and VPST across VPT blocks
Sam Tebbs [Fri, 6 Nov 2020 13:35:35 +0000 (13:35 +0000)]
[ARM][LowOverheadLoops] Merge VCMP and VPST across VPT blocks

This patch adds support for combining a VPST with a dangling VCMP from a
previous VPT block.

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

3 years agoFix typo for hasAnyOverloadedOperatorName; NFC
Keishi Hattori [Wed, 18 Nov 2020 12:48:59 +0000 (07:48 -0500)]
Fix typo for hasAnyOverloadedOperatorName; NFC

3 years agoRemove unportable test
Stephen Kelly [Wed, 18 Nov 2020 12:40:52 +0000 (12:40 +0000)]
Remove unportable test

The default content of translation unit varies too much between
platforms.

3 years agoAdd sysroot/lib to library search path of baremetal toolchain.
Hafiz Abid Qadeer [Wed, 18 Nov 2020 12:16:40 +0000 (12:16 +0000)]
Add sysroot/lib to library search path of baremetal toolchain.

Baremetal toolchain is not adding sysroot/lib to the library
search path. This is forcing the user to do it manually. This commit
fixes this shortcoming by adding the sysroot/lib to library search path
if sysroot is not empty.

Reviewed By: jroelofs

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

3 years ago[SLP] Use the minimum alignment of the load bundle when forming a masked.gather
Benjamin Kramer [Wed, 18 Nov 2020 11:50:24 +0000 (12:50 +0100)]
[SLP] Use the minimum alignment of the load bundle when forming a masked.gather

Instead of the first load. That works when vectorizing contiguous loads,
but not for gathers.

Fixes a miscompile introduced in fcad8d3635cff61a2749dcef94c0d51fa1e3e413.

3 years ago[Matrix] Adjust matrix pointer type for inline asm arguments.
Florian Hahn [Wed, 18 Nov 2020 11:32:45 +0000 (11:32 +0000)]
[Matrix] Adjust matrix pointer type for inline asm arguments.

Matrix types in memory are represented as arrays, but accessed through
vector pointers, with the alignment specified on the access operation.

For inline assembly, update pointer arguments to use vector pointers.
Otherwise there will be a mis-match if the matrix is also an
input-argument which is represented as vector.

Reviewed By: nickdesaulniers

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

3 years ago[sanitizer] Fix typo in log messages
Seonghyun Park [Wed, 18 Nov 2020 11:40:45 +0000 (03:40 -0800)]
[sanitizer] Fix typo in log messages

Fix typo in log messages

Reviewed By: vitalybuka

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

3 years ago[lldb] Fix a couple of remote llgs tests
David Spickett [Tue, 17 Nov 2020 11:56:45 +0000 (11:56 +0000)]
[lldb] Fix a couple of remote llgs tests

init_llgs_test no longer takes an argument
but these two were not updated.

Also fix some mistakes in TestAutoInstallMainExecutable
to get it passing again.

Reviewed By: JDevlieghere, labath

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

3 years ago[IndVars] Support different types of ExitCount when optimizing exit conds
Max Kazantsev [Wed, 18 Nov 2020 10:56:34 +0000 (17:56 +0700)]
[IndVars] Support different types of ExitCount when optimizing exit conds

In some cases we can handle IV and iter count of different types. It's a typical situation
after IV have been widened. This patch adds support for such cases, when legal.

Differential Revision: https://reviews.llvm.org/D88528
Reviewed By: skatkov

3 years ago[clang][cli] Port Migrator option flags to new option parsing system
Jan Svoboda [Wed, 18 Nov 2020 09:10:17 +0000 (10:10 +0100)]
[clang][cli] Port Migrator option flags to new option parsing system

Depends on D83406

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

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

3 years ago[lldb] [test] Un-XFAIL tests on freebsd/i386
Michał Górny [Tue, 17 Nov 2020 18:06:33 +0000 (19:06 +0100)]
[lldb] [test] Un-XFAIL tests on freebsd/i386

Restrict i386-specific XFAIL on a few tests to non-FreeBSD systems,
as they pass on FreeBSD.

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

3 years ago[lldb] [test] Un-XFAIL TestMultipleDebuggers.py
Michał Górny [Tue, 17 Nov 2020 11:04:13 +0000 (12:04 +0100)]
[lldb] [test] Un-XFAIL TestMultipleDebuggers.py

This test is flaky, and for the time being we do not mark them as XFAIL.

3 years ago[lldb] [test] Mark command-process-connect.test XFAIL
Michał Górny [Tue, 17 Nov 2020 10:39:48 +0000 (11:39 +0100)]
[lldb] [test] Mark command-process-connect.test XFAIL

We are still investigating why 'process connect' does not work while
'gdb-remote' does.

Signed-off-by: Michał Górny <mgorny@moritz.systems>
3 years ago[lldb] [test] Pass -mmmx to x86-gp-write test explicitly
Michał Górny [Tue, 17 Nov 2020 00:04:59 +0000 (01:04 +0100)]
[lldb] [test] Pass -mmmx to x86-gp-write test explicitly

Pass -mmmx explicitly to fix build failure with FreeBSD's clang on i386.

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

3 years ago[tsan] Add pthread_cond_clockwait interceptor
Vitaly Buka [Wed, 18 Nov 2020 07:43:08 +0000 (23:43 -0800)]
[tsan] Add pthread_cond_clockwait interceptor

Fixes https://github.com/google/sanitizers/issues/1259

Reviewed By: dvyukov

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

3 years ago[mlir] Simplify code generated by ConvertToLLVMPattern::getStridedElementPtr().
Christian Sigg [Tue, 17 Nov 2020 09:22:46 +0000 (10:22 +0100)]
[mlir] Simplify code generated by ConvertToLLVMPattern::getStridedElementPtr().

Make the interface match the one of ConvertToLLVMPattern::getDataPtr() (to be removed in a separate change).

Reviewed By: ftynse

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

3 years ago[clang][cli] Remove NormalizerRetTy and use the decltype of the KeyPath instead
Jan Svoboda [Mon, 16 Nov 2020 14:59:35 +0000 (15:59 +0100)]
[clang][cli] Remove NormalizerRetTy and use the decltype of the KeyPath instead

Depends on D83315

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

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

3 years ago[NFC][POwerPC] Added testcases of constant-i64.
Esme-Yi [Wed, 18 Nov 2020 10:13:16 +0000 (10:13 +0000)]
[NFC][POwerPC] Added testcases of constant-i64.

3 years ago[NFC] Add missing dependency in the IR unittests
Andrzej Warzynski [Wed, 18 Nov 2020 10:08:36 +0000 (10:08 +0000)]
[NFC] Add missing dependency in the IR unittests

This missing dependency has caused build failures when
`BUILD_SHARED_LIBS` is set to `ON`. The breaking change was introduced
here:
  * https://reviews.llvm.org/D91324

Failing buildbot:
  * http://lab.llvm.org:8011/#/builders/66/builds/555

3 years agoReland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16...
Georgii Rymar [Wed, 18 Nov 2020 08:59:49 +0000 (11:59 +0300)]
Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930).

This reverts reverting commit fc40a03323a4b265ccbed34a07e281b13c5e8367
and fixes LLD (MachO/wasm) tests that failed previously.

3 years ago[Analysis] CGSCCPassManager.cpp - fix Wshadow warnings. NFCI.
Simon Pilgrim [Wed, 18 Nov 2020 09:05:34 +0000 (09:05 +0000)]
[Analysis] CGSCCPassManager.cpp - fix Wshadow warnings. NFCI.

3 years ago[clang][cli] Turn arcmt-* options into a single option
Jan Svoboda [Mon, 16 Nov 2020 13:30:54 +0000 (14:30 +0100)]
[clang][cli] Turn arcmt-* options into a single option

- The new option, -arcmt-action, is a simple enum based option.
- The driver is modified to translate the existing -ccc-acmt-* options accordingly
Depends on D83298

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

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

3 years ago[mlir] Introduce support for parametric side-effects
Alex Zinenko [Sun, 15 Nov 2020 14:25:01 +0000 (15:25 +0100)]
[mlir] Introduce support for parametric side-effects

The side effect infrastructure is based on the Effect and Resource class
templates, instances of instantiations of which are constructed as
thread-local singletons. With this scheme, it is impossible to further
parameterize either of those, or the EffectInstance class that contains
pointers to an Effect and Resource instances. Such a parameterization is
necessary to express more detailed side effects, e.g. those of a loop or
a function call with affine operations inside where it is possible to
precisely specify the slices of accessed buffers.

Include an additional Attribute to EffectInstance class for further
parameterization. This allows to leverage the dialect-specific
registration and uniquing capabilities of the attribute infrastructure
without requiring Effect or Resource instantiations to be attached to a
dialect themselves.

Split out the generic part of the side effect Tablegen classes into a
separate file to avoid generating built-in MemoryEffect interfaces when
processing any .td file that includes SideEffectInterfaceBase.td.

Reviewed By: rriddle

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

3 years ago[clang][cli] Add ability to make fixups to CompilerInvocation after option parsing
Jan Svoboda [Mon, 16 Nov 2020 11:17:29 +0000 (12:17 +0100)]
[clang][cli] Add ability to make fixups to CompilerInvocation after option parsing

Depends on D83211

Reviewed By: Bigcheese

Original patch by Daniel Grumberg.

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

3 years ago[libcxx] Add missing _LIBCPP_FUNC_VIS on a few win32 locale functions
Martin Storsjö [Thu, 12 Nov 2020 08:57:03 +0000 (10:57 +0200)]
[libcxx] Add missing _LIBCPP_FUNC_VIS on a few win32 locale functions

These functions are called directly from the public installed
headers, and thus need to be exported in DLL builds, just like
some other functions in the same header (e.g. snprintf_l).

This fixes e.g. test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
in mingw configurations.

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

3 years ago[lldb] Python3 byte<->string issue in patch-crashlog.py
Raphael Isemann [Wed, 18 Nov 2020 08:58:02 +0000 (09:58 +0100)]
[lldb] Python3 byte<->string issue in patch-crashlog.py

3 years agoRevert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16...
Georgii Rymar [Wed, 18 Nov 2020 08:55:03 +0000 (11:55 +0300)]
Revert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types."

This reverts commit 65fd17c241e22e1671e81efdb683687369c2feb3.

It breaks LLD/MachO tests that seems use obj2yaml the check the output.

3 years agoSpeculativeExecution: Allow speculating more instruction types
Piotr Sobczak [Tue, 17 Nov 2020 14:38:44 +0000 (15:38 +0100)]
SpeculativeExecution: Allow speculating more instruction types

Support more instructions in SpeculativeExecution pass:
- ExtractElement
- InsertElement
- ShuffleVector

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

3 years ago[clangd] Call hierarchy (Protocol layer)
Nathan Ridge [Tue, 10 Nov 2020 05:20:38 +0000 (00:20 -0500)]
[clangd] Call hierarchy (Protocol layer)

The protocol is based on the spec found here:
https://microsoft.github.io/language-server-protocol/specifications/specification-3-16/#textDocument_prepareCallHierarchy

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

3 years ago[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32...
Georgii Rymar [Fri, 6 Nov 2020 10:39:55 +0000 (13:39 +0300)]
[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types.

When we produce an YAML output, we also print leading zeroes currently.
An output might look like this:

```
- Name:    .dynsym
  Type:    SHT_DYNSYM
  Address: 0x0000000000001000
  EntSize: 0x0000000000000018
```

There are probably no reason to print leading zeroes.
It just makes harder to read values. This patch stops printing them.
The output becomes like:

```
- Name:    .dynsym
  Type:    SHT_DYNSYM
  Address: 0x1000
  EntSize: 0x18
```

This affects obj2yaml mostly, but also dsymutil and llvm-xray tools output.

Differential revision: https://reviews.llvm.org/D90930

3 years agotest commit
Thorsten Schütt [Wed, 18 Nov 2020 08:20:37 +0000 (09:20 +0100)]
test commit

add whitespace

3 years ago[NFC][tsan] Prepepare for more interceptors which use cond_wait()
Vitaly Buka [Mon, 16 Nov 2020 13:16:45 +0000 (05:16 -0800)]
[NFC][tsan] Prepepare for more interceptors which use cond_wait()

3 years ago[test] Make scc-pass-printer.ll work with NPM
Arthur Eubanks [Wed, 18 Nov 2020 07:53:21 +0000 (23:53 -0800)]
[test] Make scc-pass-printer.ll work with NPM

Pin some legacy PM specific RUN lines to legacy PM.

3 years ago[mlir] Get array from the dense elements attribute with buffer protocol.
zhanghb97 [Sun, 8 Nov 2020 01:28:35 +0000 (09:28 +0800)]
[mlir] Get array from the dense elements attribute with buffer protocol.

- Add `mlirElementsAttrGetType` C API.
- Add `def_buffer` binding to PyDenseElementsAttribute.
- Implement the protocol to access the buffer.

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

3 years ago[X86] Use GF2P8AFFINEQB to implement vector bitreverse.
Craig Topper [Wed, 18 Nov 2020 05:34:34 +0000 (21:34 -0800)]
[X86] Use GF2P8AFFINEQB to implement vector bitreverse.

We can use GF2P8AFFINEQB to reverse bits in a byte. Shuffles are needed to reverse the bytes in elements larger than i8. LegalizeVectorOps takes care of inserting the shuffle for the larger element size.

We already have Custom lowering for v16i8 with SSSE3, v32i8 with AVX, and v64i8 with AVX512BW.

I think we might be able to use this for scalars too by moving into a vector and back. But I'll save that for a follow up as its a little more involved.

Reviewed By: RKSimon, pengfei

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

3 years ago[test] Pin size-remarks.ll to legacy PM
Arthur Eubanks [Wed, 18 Nov 2020 07:47:49 +0000 (23:47 -0800)]
[test] Pin size-remarks.ll to legacy PM

This tests legacy PM specific stuff.

3 years ago[JumpThreading] Make -print-lvi-after-jump-threading work with NPM
Arthur Eubanks [Wed, 18 Nov 2020 07:14:33 +0000 (23:14 -0800)]
[JumpThreading] Make -print-lvi-after-jump-threading work with NPM

3 years agoAdd CalibratedQuantizedType to quant dialect
Tei Jeong [Wed, 18 Nov 2020 06:14:02 +0000 (22:14 -0800)]
Add CalibratedQuantizedType to quant dialect

This type supports a calibrated type with min, max provided.

This will be used for importing calibration values of intermediate tensors (e.g. LSTM) which can't be imported with QuantStats op.

This type was initially suggested in the following RFC: https://llvm.discourse.group/t/rfc-a-proposal-for-implementing-quantization-transformations-in-mlir/655

Reviewed By: stellaraccident

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

3 years ago[clangd] Add OverridenBy Relation to index.
Utkarsh Saxena [Tue, 17 Nov 2020 11:15:31 +0000 (12:15 +0100)]
[clangd] Add OverridenBy Relation to index.

This was previously explored in reviews.llvm.org/D69094.

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

3 years ago[mlir][Python] Make DenseElementsAttr loading be int size agnostic.
Stella Laurenzo [Wed, 11 Nov 2020 18:21:53 +0000 (10:21 -0800)]
[mlir][Python] Make DenseElementsAttr loading be int size agnostic.

* I had missed the note about "Standard size" in the docs. On Windows, the 'l' types are 32bit.
* This fixes the only failing MLIR-Python test on Windows.

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

3 years agoADT: Share an implementation for single-element insert in SmallVector, NFC
Duncan P. N. Exon Smith [Wed, 18 Nov 2020 02:06:21 +0000 (18:06 -0800)]
ADT: Share an implementation for single-element insert in SmallVector, NFC

Factor out `SmallVectorImple::insert_one_impl`, a common implementation
for `insert(iterator, T&&)` and `insert(iterator, T const&)`. This is
just a clean up and has no functionality change.

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

3 years ago[DCE] Always get TargetLibraryInfo
Arthur Eubanks [Sat, 14 Nov 2020 07:34:11 +0000 (23:34 -0800)]
[DCE] Always get TargetLibraryInfo

I don't see any reason not to unconditionally retrieve TLI, it's fairly
cheap.

Fixes calls-errno.ll under NPM.

Reviewed By: asbirlea

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

3 years ago[libc++] Revert switch-based std::variant implementation again.
Eric Fiselier [Tue, 17 Nov 2020 22:34:23 +0000 (17:34 -0500)]
[libc++] Revert switch-based std::variant implementation again.

These changes cause substantial binary size increases for non-opt builds.
For example, the visit.pass.cpp test grows from 20k to 420k.

Further work will be done to re-land this patch without the size increases,
but that work is proving too tricky to fix forward.

This patch fully reverts:

35d226911165a9aae1f01f521a0019f1a9c0a25f

And it partially reverts:

bb43a0cd4adc4f1fa12e0d2fd1fe9aa6b5c00e34

The latter of which added XFAIL's to new variant tests
because the new implementation needlessly makes non-throwing code
paths in variant invoke throwing code.

This means the reverted change also breaks source backwards compat
with code compiled on OS X targeting older system dylibs. There is no
need for this to be the case. We should fix it before recommitting.

Reviewed as:
https://reviews.llvm.org/D91662

3 years ago[gn build] Port 6a89cb8136f
LLVM GN Syncbot [Wed, 18 Nov 2020 03:04:01 +0000 (03:04 +0000)]
[gn build] Port 6a89cb8136f

3 years ago[NewPM] Disable PreservedCFGChecker and add regression unit tests
Yevgeny Rouban [Wed, 18 Nov 2020 02:44:16 +0000 (09:44 +0700)]
[NewPM] Disable PreservedCFGChecker and add regression unit tests

The design of the PreservedCFG Checker (landed with the commit
28012e00d80b9) has a fundamental flaw which makes it incorrect.
The checker is based on the PreservedAnalyses result returned
by functional passes: if CFGAnalyses is in the returned
PreservedAnalyses set, then the checker asserts that the CFG
snapshot saved before the pass is equal to the CFG snapshot
taken after the the pass. The problem is in passes that change
CFG and invalidate CFGAnalyses on their own. Such passes do not
return CFGanalyses in the returned PreservedAnalyses. So the
checker mistakenly expects CFG unchanged. As an example see the
class TestSimplifyCFGInvalidatingAnalysisPass in the new tests.

It is interesting that the bug was not found in LLVM. That is
because the CFG checker ran only if CFGAnalyses was checked
incorrectly:
  if (!PassPA.allAnalysesInSetPreserved<CFGAnalyses>())
    return;

but must be checked as follows:
  auto PAC = PA.getChecker<PreservedCFGCheckerAnalysis>();
  if (!(PAC.preserved() ||
        PAC.preservedSet<AllAnalysesOn<Function>>() ||
        PAC.preservedSet<CFGAnalyses>())
    return;

A fully redesigned checker will be sent as a separate follow-up
patch.

Reviewed By: Serguei Katkov, Jakub Kuderski

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

3 years agoRevert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations...
Artem Dergachev [Wed, 18 Nov 2020 02:59:01 +0000 (18:59 -0800)]
Revert "Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis."""

This reverts commit 41bcc05e2a4e3062eb12ac6e071bc835decc38f5.

3 years ago[gn build] Port 41bcc05e2a4
LLVM GN Syncbot [Wed, 18 Nov 2020 02:45:24 +0000 (02:45 +0000)]
[gn build] Port 41bcc05e2a4

3 years agoRevert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to...
Artem Dergachev [Mon, 16 Nov 2020 01:26:22 +0000 (17:26 -0800)]
Revert "Revert "[analyzer] NFC: Move path diagnostic consumer implementations to libAnalysis.""

This reverts commit 77bb3ebebbca13f0648beb433fbd1b06ba95a19c.

3 years ago[CFGuard] Add address-taken IAT tables and delay-load support
Andrew Paverd [Wed, 18 Nov 2020 02:02:13 +0000 (18:02 -0800)]
[CFGuard] Add address-taken IAT tables and delay-load support

This patch adds support for creating Guard Address-Taken IAT Entry Tables (.giats$y sections) in object files, matching the behavior of MSVC. These contain lists of address-taken imported functions, which are used by the linker to create the final GIATS table.
Additionally, if any DLLs are delay-loaded, the linker must look through the .giats tables and add the respective load thunks of address-taken imports to the GFIDS table, as these are also valid call targets.

Reviewed By: rnk

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

3 years ago[NFC][Test] Add more tests for IEEE Longdouble for PowerPC
QingShan Zhang [Wed, 18 Nov 2020 02:12:01 +0000 (02:12 +0000)]
[NFC][Test] Add more tests for IEEE Longdouble for PowerPC

3 years agoset the alignment of mlir::AttributeStorage to 64 bit explicitly to fix 32 bit platform
daquexian [Wed, 18 Nov 2020 01:29:43 +0000 (17:29 -0800)]
set the alignment of mlir::AttributeStorage to 64 bit explicitly to fix 32 bit platform

On some platform (like WebAssembly), alignof(mlir::AttributeStorage) is 4 instead of 8. As a result, it makes the program crashes since PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable is 3.

So I explicitly set the alignment of mlir::AttributeStoarge to 64 bits, and set PointerLikeTypeTraits<mlir::Attribute>::NumLowBitsAvailable according to it.

I also fixed an another related error (alignof(NamedAttribute) -> alignof(DictionaryAttributeStorage)) based on reviewer's comments.

Reviewed By: dblaikie, rriddle

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

3 years ago[Frontend] Add flag to allow PCM generation despite compiler errors
Ben Barham [Wed, 18 Nov 2020 01:25:50 +0000 (17:25 -0800)]
[Frontend] Add flag to allow PCM generation despite compiler errors

As with precompiled headers, it's useful for indexers to be able to
continue through compiler errors in dependent modules.

Resolves rdar://69816264

Reviewed By: akyrtzi

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

3 years agoRevert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch"
Nick Desaulniers [Wed, 18 Nov 2020 01:17:44 +0000 (17:17 -0800)]
Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch"

This reverts commit b7926ce6d7a83cdf70c68d82bc3389c04009b841.

Going with a simpler approach.

3 years agoRevert "[BitCode] decode nossp fn attr"
Nick Desaulniers [Wed, 18 Nov 2020 01:17:36 +0000 (17:17 -0800)]
Revert "[BitCode] decode nossp fn attr"

This reverts commit 0b11d018cc2f2c6bea5dac8dc72140cdb502ca02.

Going with a simpler approach.

3 years ago[CMake] Fix ExtensionDependencies.inc with multiple extensions
Arthur Eubanks [Tue, 17 Nov 2020 17:24:38 +0000 (09:24 -0800)]
[CMake] Fix ExtensionDependencies.inc with multiple extensions

When polly is enabled and LLVM_BYE_LINK_INTO_TOOLS=ON is on, ExtensionDependencies.inc does not compile.

$ ninja tools/llvm-config/CMakeFiles/llvm-config.dir/llvm-config.cpp.o
tools/llvm-config/ExtensionDependencies.inc:8:1: error: excess elements in struct initializer
{{"Bye", {"Bye",nullptr}}},

ExtensionDependencies.inc pre-patch:
  std::array<ExtensionDescriptor, 2> AvailableExtensions{
  {{"Polly", {"support", "core", ...,nullptr}}},
  {{"Bye", {"Bye",nullptr}}},
  };

ExtensionDependencies.inc with this patch:
  std::array<ExtensionDescriptor, 2> AvailableExtensions{
  ExtensionDescriptor{"Polly", {"support", "core", ...,nullptr}},
  ExtensionDescriptor{"Bye", {"Bye",nullptr}},
  };

Reviewed By: Meinersbur

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

3 years ago[gn build] Use forward slashes for goma directory
Arthur Eubanks [Wed, 18 Nov 2020 01:09:45 +0000 (17:09 -0800)]
[gn build] Use forward slashes for goma directory

gn generates improper compile_commands.json files by not escaping
backslashes.