platform/upstream/llvm.git
4 years ago[CostModel][X86] Add insert/extract cost tests for sub-128bit vXi8/vXi16 vectors
Simon Pilgrim [Sat, 4 Apr 2020 11:44:56 +0000 (12:44 +0100)]
[CostModel][X86] Add insert/extract cost tests for sub-128bit vXi8/vXi16 vectors

4 years ago[X86][SSE] lowerV8I16Shuffle - lower compaction shuffles using PACKUSDW(PBLENDW,PBLEN...
Simon Pilgrim [Sat, 4 Apr 2020 10:42:06 +0000 (11:42 +0100)]
[X86][SSE] lowerV8I16Shuffle - lower compaction shuffles using PACKUSDW(PBLENDW,PBLENDW) on SSE41+

Similar to the lowerV16I8Shuffle implementation, for binary compaction v8i16 shuffles we can avoid the PUNPCKLDQ(PSHUFB,PSHUFB) pattern on SSE41+ targets by using PACKUSDW and PBLENDW. Before SSE41 we would need to use PACKSSDW but that requires sign extension that seems to destroy any gains, even on targets without PSHUFB.

This is a bigger gain on AMD than Intel targets but should never be a regression, and avoiding the shuffle mask load(s) is always useful.

Noticed in codegen while dealing with PR31443.

4 years ago[IRBuilder] Move some code into the cpp file; NFC
Nikita Popov [Thu, 2 Apr 2020 19:35:24 +0000 (21:35 +0200)]
[IRBuilder] Move some code into the cpp file; NFC

Since D73835 we no longer need to define the whole IRBuilder
implementation in the header. This patch moves some of the larger
methods out of line, into the C++ file.

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

4 years ago[VNCoercion] Use IRBuilderBase; NFC
Nikita Popov [Sat, 4 Apr 2020 10:40:09 +0000 (12:40 +0200)]
[VNCoercion] Use IRBuilderBase; NFC

And remove include from header.

4 years ago[Object] object::ELFObjectFile::dynamic_symbol_begin(): skip symbol index 0
vgxbj [Sat, 4 Apr 2020 10:17:58 +0000 (18:17 +0800)]
[Object] object::ELFObjectFile::dynamic_symbol_begin(): skip symbol index 0

Summary:
Note: This revision is very similar to D62296.

In D75756, we need `getDynamicSymbolIterators()` to skip first NULL symbol in `.dynsym`. And I believe it might be worth pointing this out in a separate patch to gather you experts' opinions.

I have checked that current code base will not be affected by this change.

```
dynamic_symbol_begin()
|- dynamic_symbol_end(): Ok
`- getDynamicSymbolIterators()
   |- addDynamicElfSymbols(): llvm/tools/llvm-objdump/llvm-objdump.cpp, Line 934
   |                          Ok, NULL symbol will be omitted by Line 945-947
   |                          StringRef Name = unwrapOrError(Symbol.getName(), Obj->getName());
   |                          if (Name.empty()) continue;
   |- dumpSymbolNameFromObject(): llvm/tools/llvm-nm/llvm-nm.cpp, Line 1192
   |                          There's no test for dumping dynamic debugging symbol. This patch helps improve llvm-nm behavior. (we should add test for this later)
   `- computeSymbolSizes(): llvm/lib/Object/SymbolSize.cpp, Line 52
      |- OProfileJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp, Line 92
      |                                                  Ok, NULL symbol will be omitted by Line 94-95
      |                                                  if (!Sym.getType() || *Sym.getType() != SF_Function) continue;
      |- IntelJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp, Line 98
      |                                               Ok, NULL symbol will be omitted by Line 124-126 (same as previous one)
      |- PerfJITEventListener::notifyObjectLoaded(): llvm/lib/ExecutionEngine/PerfJITEvents/PerfJITEventListener.cpp, Line 244
      |                                              Ok, NULL symbol will be omitted by Line 254-256, (same as previous one)
      |- SymbolizableObjectFile::create(): llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp, Line 73
      |                                    Ok, NULL symbol will be omitted by Line 75
      |                                    res->addSymbol()
      |                                    In addSymbol(), Line 167-168
      |                                    if (!Sec || (Obj && Obj->section_end() == *Sec)) return std::error_code();
      |- dumpCXXData(): llvm/tools/llvm-cxxdump/llvm-cxxdump.cpp, Line 189
      |                 Ok, NULL symbol will be omitted by Line 199-202
      |                 object::section_iterator SecI = *SecIOrErr;
      |                 // Skip external symbols.
      |                 if (SecI == Obj->section_end())
      |                   continue;
      `- printLineInfoForInput(): llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp, Line 418
                                  Ok, NULL symbol will be omitted by Line 430-477
                                  if (Type == object::SymbolRef::ST_Function) {
                                    ...
                                  }
```

Reviewers: grimar, jhenderson, MaskRay

Reviewed By: jhenderson, MaskRay

Subscribers: rupprecht, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[Reassociate] Use IRBuilderBase; NFC
Nikita Popov [Sat, 4 Apr 2020 10:34:16 +0000 (12:34 +0200)]
[Reassociate] Use IRBuilderBase; NFC

And remove now unnecessary IRBuilder.h include in header.

4 years ago[IVDescriptors] Remove IRBuilder.h include; NFC
Nikita Popov [Sat, 4 Apr 2020 10:02:21 +0000 (12:02 +0200)]
[IVDescriptors] Remove IRBuilder.h include; NFC

IVDescriptors.h itself does not reference IRBuilder at all.
Move the include into transformation passes that do.

4 years ago[IVDescriptors] Remove unnecessary DemandedBits.h include; NFC
Nikita Popov [Sat, 4 Apr 2020 09:51:06 +0000 (11:51 +0200)]
[IVDescriptors] Remove unnecessary DemandedBits.h include; NFC

Forward declare DemandedBits in IVDescriptors, and move include
into the cpp file. Also drop the include from LoopUtils, which
does not need it at all.

4 years ago[libc++] Attempt to workaround module invalidation bug
Eric Fiselier [Sat, 4 Apr 2020 07:18:01 +0000 (03:18 -0400)]
[libc++] Attempt to workaround module invalidation bug

4 years ago[clangd] Tweak parseDocumentation loop to use raw lines. NFC
Sam McCall [Sat, 4 Apr 2020 06:06:24 +0000 (08:06 +0200)]
[clangd] Tweak parseDocumentation loop to use raw lines. NFC

This clears the way for the raw lines themselves to be parsed easily.

(Okay, one functional change: fix punctuation linebreaks with trailing WS)

4 years ago[clang] Annotate trivial getters and setters on hover.
Sam McCall [Fri, 3 Apr 2020 15:09:38 +0000 (17:09 +0200)]
[clang] Annotate trivial getters and setters on hover.

Summary: (Only if their definitions are visible and they have no other docs)

Reviewers: kadircet

Subscribers: jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[MLIR] Fix shape inference in toy tutorial
Frederik Gossen [Sat, 4 Apr 2020 04:33:58 +0000 (04:33 +0000)]
[MLIR] Fix shape inference in toy tutorial

The implementation of shape inference in the toy tutorial did not conform to the correct algorithmic description.
The result was only correct because all operations appear to be processed in sequence.

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

4 years agoAMDGPU: Fix a few more tests with old denormal subtarget features
Matt Arsenault [Sat, 4 Apr 2020 03:17:28 +0000 (23:17 -0400)]
AMDGPU: Fix a few more tests with old denormal subtarget features

4 years agoAdd mention of advantages of `arc` in the Phabricator doc.
Mehdi Amini [Sat, 4 Apr 2020 03:21:12 +0000 (03:21 +0000)]
Add mention of advantages of `arc` in the Phabricator doc.

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

4 years agoDon't treat a CXXScopeSpec with a nested name specifier but no location
Richard Smith [Sat, 4 Apr 2020 03:17:43 +0000 (20:17 -0700)]
Don't treat a CXXScopeSpec with a nested name specifier but no location
as invalid.

We create those when forming trivial type source information with no
associated location, which, unfortunately, we do create in some cases
(when a TreeTransform with no base location is used to transform a
QualType).

This would previously lead to rejects-valid bugs when we misinterpreted
these constructs as having no nested-name-specifier.

4 years agoFix typos in toy tutorial
Frederik Gossen [Sat, 4 Apr 2020 03:17:15 +0000 (03:17 +0000)]
Fix typos in toy tutorial

 Fix two typos throughout the chapters.

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

4 years ago[OpenMP] NFC: Fix trivial typo
Kazuaki Ishizaki [Sat, 4 Apr 2020 03:06:29 +0000 (12:06 +0900)]
[OpenMP] NFC: Fix trivial typo

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

4 years agoThe thread plan list test is failing at least on Ubuntu Linux.
Jim Ingham [Sat, 4 Apr 2020 02:58:56 +0000 (19:58 -0700)]
The thread plan list test is failing at least on Ubuntu Linux.
Mark it expected fail for now.

The test output shows that the "internal" thread listing isn't showing the
step out plan that we use to step back out of a function we're stepping into.
The internal plan listing code has nothing platform specific in it, so that
isn't the problem.

I am pretty sure the difference is that on MacOS we step into the function and then need to
step back out again so we push the internal plan the test is checking for.  But on Linux we
are able to step past the function without stepping into it.

So nothing is actually going wrong here, I just need to find a better test case where I
can ensure we are going to have to push a private plan.  It's probably better to test this
using a custom thread plan, then I can control the state of the plan stack better.

That's for Monday...

4 years agoFix LLDB debug builds
Walter Erquinigo [Sat, 4 Apr 2020 02:49:07 +0000 (19:49 -0700)]
Fix LLDB debug builds

Summary:
A recent change in ThreadPlans introduced this little compilation error.
Seems to be related to the work around https://reviews.llvm.org/D76814.

Reviewers: clayborg, labath, jingham

Reviewed By: jingham

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[mlir][DeclarativeParser] Emit an error if a `:` follows an attribute with a non...
River Riddle [Sat, 4 Apr 2020 02:20:33 +0000 (19:20 -0700)]
[mlir][DeclarativeParser] Emit an error if a `:` follows an attribute with a non-constant type.

Summary: The attribute grammar includes an optional trailing colon type, so for attributes without a constant buildable type this will generally lead to unexpected and undesired behavior. Given that, it's better to just error out on these cases.

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

4 years ago[source maps] Fix remove, insert-after and replace
Walter Erquinigo [Sat, 4 Apr 2020 00:29:32 +0000 (17:29 -0700)]
[source maps] Fix remove, insert-after and replace

Summary:
In this diff of mine D77186 I introduce a bug in the replace operation, where I was failing fast by mistake.
Besides, a similar problem existed in the insert-after operation, where it was failing fast.

Finally, the remove operation was wrong, as it was not using the indices provided by the users.

I fixed those issues and added some tests account for cases with multiple elements in these requests.

Reviewers: labath, clayborg

Reviewed By: labath

Subscribers: mgrang, lldb-commits

Tags: #lldb

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

4 years ago[mlir] Change the default of `mlir-print-op-on-diagnostic` to true
River Riddle [Sat, 4 Apr 2020 02:02:39 +0000 (19:02 -0700)]
[mlir] Change the default of `mlir-print-op-on-diagnostic` to true

Summary: It is a very common user trap to think that the location printed along with the diagnostic is the same as the current operation that caused the error. This revision changes the behavior to always print the current operation, except for when diagnostics are being verified. This is achieved by moving the command line flags in IR/ to be options on the MLIRContext.

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

4 years ago[NFC][PowerPC] Pre-commit a test case for D77448
Nemanja Ivanovic [Sat, 4 Apr 2020 01:41:22 +0000 (20:41 -0500)]
[NFC][PowerPC] Pre-commit a test case for D77448

Pre-committing the new test case so the review shows only the diffs.

4 years agoPR45402: Make the restrictions on constant evaluation of memcmp and
Richard Smith [Sat, 4 Apr 2020 01:22:17 +0000 (18:22 -0700)]
PR45402: Make the restrictions on constant evaluation of memcmp and
memchr consistent and comprehensible, and document them.

We previously allowed evaluation of memcmp on arrays of integers of any
size, so long as the call evaluated to 0, and allowed evaluation of
memchr on any array of integral type of size 1 (including enums). The
purpose of constant-evaluating these builtins is only to support
constexpr std::char_traits, so we now consistently allow them on arrays
of (possibly signed or unsigned) char only.

4 years agoThis test is failing on the Ubuntu bot but the bot log doesn't
Jim Ingham [Sat, 4 Apr 2020 01:02:51 +0000 (18:02 -0700)]
This test is failing on the Ubuntu bot but the bot log doesn't
capture the test stdout, so put the info I need to see in the error
message instead.

4 years ago[clang][opaque pointers] Fix up a bunch of "getType()->getElementType()"
Eli Friedman [Fri, 3 Apr 2020 22:11:40 +0000 (15:11 -0700)]
[clang][opaque pointers] Fix up a bunch of "getType()->getElementType()"

In contexts where we know an LLVM type is a pointer, there's generally
some simpler way to get the pointee type.

4 years ago[polly][opaque pointers] Remove use of deprecated APIs.
Eli Friedman [Fri, 3 Apr 2020 21:57:12 +0000 (14:57 -0700)]
[polly][opaque pointers] Remove use of deprecated APIs.

(See also D76269.)

4 years ago[clang codegen][opaque pointers] Remove use of deprecated constructor
Eli Friedman [Fri, 3 Apr 2020 21:54:36 +0000 (14:54 -0700)]
[clang codegen][opaque pointers] Remove use of deprecated constructor

(See also D76269.)

4 years ago[llvm-stress][opaque pointers] Remove use of deprecated constructor
Eli Friedman [Fri, 3 Apr 2020 21:52:18 +0000 (14:52 -0700)]
[llvm-stress][opaque pointers] Remove use of deprecated constructor

(See also D76269.)

4 years agoFix unused variable, format, and format string warnings.
Eric Christopher [Sat, 4 Apr 2020 00:58:59 +0000 (17:58 -0700)]
Fix unused variable, format, and format string warnings.
NFC.

4 years ago[intel-mpx] Delete an unnecessary license header
Walter Erquinigo [Thu, 2 Apr 2020 19:03:32 +0000 (12:03 -0700)]
[intel-mpx] Delete an unnecessary license header

Summary:
@labath mentioned to me that test files shouldn't have a license header.
I saw this one some days ago, so I'm doing some cleaning.

Reviewers: labath, clayborg

Subscribers: lldb-commits, labath

Tags: #lldb

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

4 years agoDisable two new tests on Windows. They are failing but the logs are not helpful.
Jim Ingham [Sat, 4 Apr 2020 00:13:07 +0000 (17:13 -0700)]
Disable two new tests on Windows.  They are failing but the logs are not helpful.

Also turn on the command trace unconditionally for TestThreadPlanCommands.py as the
tests for the Ubuntu bot don't seem to run with -t making it hard to see why this is
failing remotely.

4 years ago[gn build] Port 1d42c0db9a2
LLVM GN Syncbot [Sat, 4 Apr 2020 00:07:07 +0000 (00:07 +0000)]
[gn build] Port 1d42c0db9a2

4 years agoRevert "[X86] Add a Pass that builds a Condensed CFG for Load Value Injection (LVI...
Craig Topper [Fri, 3 Apr 2020 23:54:38 +0000 (16:54 -0700)]
Revert "[X86] Add a Pass that builds a Condensed CFG for Load Value Injection (LVI) Gadgets"

This reverts commit c74dd640fd740c6928f66a39c7c15a014af3f66f.

Reverting to address coding standard issues raised in post-commit
review.

4 years agoRevert "[X86] Add Support for Load Hardening to Mitigate Load Value Injection (LVI)"
Craig Topper [Fri, 3 Apr 2020 23:54:04 +0000 (16:54 -0700)]
Revert "[X86] Add Support for Load Hardening to Mitigate Load Value Injection (LVI)"

This reverts commit 62c42e29ba43c9d79cd5bd2084b641fbff6a96d5

Reverting to address coding standard issues raised in post-commit
review.

4 years ago[MS] Fix assert handling enum forward decls in hasVisibleDefinition
Reid Kleckner [Fri, 3 Apr 2020 20:42:23 +0000 (13:42 -0700)]
[MS] Fix assert handling enum forward decls in hasVisibleDefinition

An enum may be considered to be a complete type if it was forward
declared. It may be declared with a fixed underlying type, or, in MSVC
compatiblity mode, with no type at all.

Previously, the code was written with special handling for fixed enums.
I generalized the code to check if the underlying integer type is known,
which should be the case when targetting the MSVC C++ ABI.

Fixes PR45409

4 years agoAvoid using std::max_align_t in pre-C++11 mode
Joerg Sonnenberger [Fri, 3 Apr 2020 22:48:02 +0000 (00:48 +0200)]
Avoid using std::max_align_t in pre-C++11 mode

Always depend on the compiler to have a correct implementation of
max_align_t in stddef.h and don't provide a fallback. For pre-C++11,
require __STDCPP_NEW_ALIGNMENT__ in <new> as provided by clang in all
standard modes. Adjust test cases to avoid testing or using max_align_t
in pre-C++11 mode and also to better deal with alignof(max_align_t)>16.
Document requirements of the alignment tests around natural alignment of
power-of-two-sized types.

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

4 years ago[ObjC generics] Fix not inheriting type bounds in categories/extensions.
Volodymyr Sapsai [Fri, 3 Apr 2020 23:25:37 +0000 (16:25 -0700)]
[ObjC generics] Fix not inheriting type bounds in categories/extensions.

When a category/extension doesn't repeat a type bound, corresponding
type parameter is substituted with `id` when used as a type argument. As
a result, in the added test case it was causing errors like

> type argument 'T' (aka 'id') does not satisfy the bound ('id<NSCopying>') of type parameter 'T'

We are already checking that type parameters should be consistent
everywhere (see `checkTypeParamListConsistency`) and update
`ObjCTypeParamDecl` to have correct underlying type. And when we use the
type parameter as a method return type or a method parameter type, it is
substituted to the bounded type. But when we use the type parameter as a
type argument, we check `ObjCTypeParamType` that wasn't updated and
remains `id`.

Fix by updating not only `ObjCTypeParamDecl` UnderlyingType but also
TypeForDecl as we use the underlying type to create a canonical type for
`ObjCTypeParamType` (see `ASTContext::getObjCTypeParamType`).

This is a different approach to fixing the issue. The previous one was
02c2ab3d8872416589bd1a6ca3dfb96ba373a3b9 which was reverted in
4c539e8da1b3de38a53ef3f7497f5c45a3243b61. The problem with the previous
approach was that `ObjCTypeParamType::desugar` was returning underlying
type for `ObjCTypeParamDecl` without applying any protocols stored in
`ObjCTypeParamType`. It caused inconsistencies in comparing types before
and after desugaring.

rdar://problem/54329242

Reviewed By: erik.pilkington

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

4 years ago[Driver] Handle all optimization-record options for Darwin LTO
Francis Visoiu Mistrih [Fri, 3 Apr 2020 19:29:54 +0000 (12:29 -0700)]
[Driver] Handle all optimization-record options for Darwin LTO

clang with -flto does not handle -foptimization-record-path=<path>

This dulicates the code from ToolChains/Clang.cpp with modifications to
support everything in the same fashion.

4 years ago[libc] Fix memcpy to adhere to qualified calls.
Paula Toth [Fri, 3 Apr 2020 22:14:33 +0000 (15:14 -0700)]
[libc] Fix memcpy to adhere to qualified calls.

Summary: Switched to using the new memcpy implementation.

Reviewers: sivachandra, abrachet, gchatelet

Reviewed By: abrachet, gchatelet

Subscribers: mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[lldb] Findtypes -gmodules fix for too many matches
Jan Kratochvil [Fri, 3 Apr 2020 22:12:59 +0000 (00:12 +0200)]
[lldb] Findtypes -gmodules fix for too many matches

Apparently the intention was to copy the condition above:
  if (types.GetSize() >= max_matches)
    break;

So that if the iteration stopped because of too many matches we do not
add even more matches in this 'Clang modules' block downward.

It was implemented by:
  SymbolFileDWARF: Unconditionally scan through clang modules. NFCish
  fe9eaadd68307347d97698fd0a1646827eafd290

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

4 years ago[libc] Add strlen implementation.
Paula Toth [Fri, 3 Apr 2020 21:47:15 +0000 (14:47 -0700)]
[libc] Add strlen implementation.

Summary: This should fix the call to a non internal libc function.

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra

Subscribers: xbolva00, mgorny, MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years agoAllow the ThreadPlanStackMap to hold the thread plans for threads
Jim Ingham [Wed, 18 Mar 2020 19:05:08 +0000 (12:05 -0700)]
Allow the ThreadPlanStackMap to hold the thread plans for threads
that were not reported by the OS plugin.  To facilitate this, move
adding/updating the ThreadPlans for a Thread to the ThreadPlanStackMap.
Also move dumping thread plans there as well.

Added some tests for "thread plan list" and "thread plan discard" since
I didn't seem to have written any originally.

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

4 years agoMove thread plan stacks into the Process, indexed by TID.
Jim Ingham [Tue, 10 Mar 2020 23:18:11 +0000 (16:18 -0700)]
Move thread plan stacks into the Process, indexed by TID.

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

4 years agoMake ThreadPlanTracers use TID & Process rather than Thread *.
Jim Ingham [Tue, 10 Mar 2020 21:04:42 +0000 (14:04 -0700)]
Make ThreadPlanTracers use TID & Process rather than Thread *.

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

4 years agoMake ThreadPlans use TID and Process, rather than Thread *.
Jim Ingham [Tue, 10 Mar 2020 21:03:53 +0000 (14:03 -0700)]
Make ThreadPlans use TID and Process, rather than Thread *.

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

4 years ago[libc++] Lit: Add default values for most arguments of test executors
Louis Dionne [Fri, 3 Apr 2020 21:50:39 +0000 (17:50 -0400)]
[libc++] Lit: Add default values for most arguments of test executors

4 years ago[mlir] LoopToStandard conversion: support "if/else" with results
Alex Zinenko [Fri, 3 Apr 2020 17:55:48 +0000 (19:55 +0200)]
[mlir] LoopToStandard conversion: support "if/else" with results

Summary:
A recent extension allowed the `loop.if` operation to return results yielded by
its regions. However, such operations could not be lowered to a CFG of standard
operations because it would have required to modify the argument list of a
block, which is not allowed in a conversion pattern. Now that the conversion
infrastructure supports block creation, use it to create a block with an
argument list that dominates the operations following the `loop.if` and forward
the results as arguments of this block.

Depends On D77416

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

4 years ago[InstCombine] add tests for freelyNegateValue with 'not'; NFC
Sanjay Patel [Fri, 3 Apr 2020 21:09:38 +0000 (17:09 -0400)]
[InstCombine] add tests for freelyNegateValue with 'not'; NFC

4 years agoFix standalone clang builds after fb80b6b2d58.
Nico Weber [Fri, 3 Apr 2020 21:15:09 +0000 (17:15 -0400)]
Fix standalone clang builds after fb80b6b2d58.

When clang is built against a prebuilt LLVM, LLVM_SOURCE_DIR is
empty, which due to a cmake quirk caused list lengths to get out
of sync. Add a workaround.

4 years ago[test] preformat test with update_llc_test_checks.py NFC
Nick Desaulniers [Fri, 3 Apr 2020 21:07:16 +0000 (14:07 -0700)]
[test] preformat test with update_llc_test_checks.py NFC

Summary:
Prior to landing D76961, preprocess via:
    $ llvm/utils/update_llc_test_checks.py \
      llvm/test/CodeGen/X86/callbr-asm-outputs.ll

Reviewers: void, MaskRay

Reviewed By: void, MaskRay

Subscribers: MaskRay, llvm-commits, srhines

Tags: #llvm

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

4 years ago[X86] Add Support for Load Hardening to Mitigate Load Value Injection (LVI)
Scott Constable [Fri, 3 Apr 2020 20:41:34 +0000 (13:41 -0700)]
[X86] Add Support for Load Hardening to Mitigate Load Value Injection (LVI)

After finding all such gadgets in a given function, the pass minimally inserts
LFENCE instructions in such a manner that the following property is satisfied:
for all SOURCE+SINK pairs, all paths in the CFG from SOURCE to SINK contain at
least one LFENCE instruction. The algorithm that implements this minimal
insertion is influenced by an academic paper that minimally inserts memory
fences for high-performance concurrent programs:

http://www.cs.ucr.edu/~lesani/companion/oopsla15/OOPSLA15.pdf

The algorithm implemented in this pass is as follows:

1. Build a condensed CFG (i.e., a GadgetGraph) consisting only of the following components:
  -SOURCE instructions (also includes function arguments)
  -SINK instructions
  -Basic block entry points
  -Basic block terminators
  -LFENCE instructions
2. Analyze the GadgetGraph to determine which SOURCE+SINK pairs (i.e., gadgets) are already mitigated by existing LFENCEs. If all gadgets have been mitigated, go to step 6.
3. Use a heuristic or plugin to approximate minimal LFENCE insertion.
4. Insert one LFENCE along each CFG edge that was cut in step 3.
5. Go to step 2.
6. If any LFENCEs were inserted, return true from runOnFunction() to tell LLVM that the function was modified.

By default, the heuristic used in Step 3 is a greedy heuristic that avoids
inserting LFENCEs into loops unless absolutely necessary. There is also a
CLI option to load a plugin that can provide even better optimization,
inserting fewer fences, while still mitigating all of the LVI gadgets.
The plugin can be found here: https://github.com/intel/lvi-llvm-optimization-plugin,
and a description of the pass's behavior with the plugin can be found here:
https://software.intel.com/security-software-guidance/insights/optimized-mitigation-approach-load-value-injection.

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

4 years ago[OpenMP][NFC] Remove the need to include `OpenMPClause.h`
Reid Kleckner [Fri, 3 Apr 2020 19:35:30 +0000 (12:35 -0700)]
[OpenMP][NFC] Remove the need to include `OpenMPClause.h`

See rational here: https://reviews.llvm.org/D76173#1922916
Time to compile Attr.h in isolation goes from 2.6s to 1.8s.

Original patch by Johannes, plus some additions from Reid to fix some
clang tooling targets.

Effect on transitive includes is marginal, though:

$ diff -u <(sort thedeps-before.txt) <(sort thedeps-after.txt) \
   | grep '^[-+] ' | sort | uniq -c | sort -nr
    104 -    /usr/local/google/home/rnk/llvm-project/clang/include/clang/AST/OpenMPClause.h
     87 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPContext.h
     19 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SmallSet.h
     19 -    /usr/local/google/home/rnk/llvm-project/llvm/include/llvm/ADT/SetVector.h
     14 -    /usr/include/c++/9/set
...

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

4 years ago[mlir][Linalg] Employ finer-grained control of C interface emission
Nicolas Vasilache [Fri, 3 Apr 2020 04:08:22 +0000 (00:08 -0400)]
[mlir][Linalg] Employ finer-grained control of C interface emission

Summary:
Linalg makes it possible to interface codegen with externally precompiled HPC libraries. The mechanism to allow such interop uses a normalized ABI and the emission of C interface wrappers.

The mechanism controlling these C interface emission is too aggressive and makes it very easy to obtained undefined symbols for external function (e.g. the ones coming from libm).

This revision uses the newly introduced llvm.emit_c_interface function attribute which allows controlling this behavior at a function granularity. As a consequence LinalgToLLVM does not need to activate the C wrapper emission when adding the StdToLLVM patterns.

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

4 years ago[gn build] Port c74dd640fd7
LLVM GN Syncbot [Fri, 3 Apr 2020 20:07:19 +0000 (20:07 +0000)]
[gn build] Port c74dd640fd7

4 years ago[lit] Cleanly exit on user keyboard interrupt
Julian Lettner [Thu, 24 Oct 2019 06:36:29 +0000 (23:36 -0700)]
[lit] Cleanly exit on user keyboard interrupt

Graceful lit shutdown on user keyboard interrupt [Ctrl+C] was a
longstanding goal of mine.  After a few refactorings this revision
finally enables it.  We use the following strategy to deal with
KeyboardInterrupt:
https://noswap.com/blog/python-multiprocessing-keyboardinterrupt

Printing of a helpful summary for interrupted runs (just as the one for
completed runs) will be tackled in future revisions.

Reviewed By: serge-sans-paille, rnk

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

4 years ago[X86] Add a Pass that builds a Condensed CFG for Load Value Injection (LVI) Gadgets
Scott Constable [Fri, 3 Apr 2020 19:12:51 +0000 (12:12 -0700)]
[X86] Add a Pass that builds a Condensed CFG for Load Value Injection (LVI) Gadgets

Adds a new data structure, ImmutableGraph, and uses RDF to find LVI gadgets and add them to a MachineGadgetGraph.

More specifically, a new X86 machine pass finds Load Value Injection (LVI) gadgets consisting of a load from memory (i.e., SOURCE), and any operation that may transmit the value loaded from memory over a covert channel, or use the value loaded from memory to determine a branch/call target (i.e., SINK).

Also adds a new target feature to X86: +lvi-load-hardening

The feature can be added via the clang CLI using -mlvi-hardening.

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

4 years ago[nfc] [lldb] Unindent code - obvious part
Jan Kratochvil [Fri, 3 Apr 2020 19:58:11 +0000 (21:58 +0200)]
[nfc] [lldb] Unindent code - obvious part

It is an obvious part of D77326.

It removes some needless deep indentation and some redundant statements.
It prepares the code for a more clean next patch - DWARF index callbacks
in D77327.

4 years ago[gn build] Port f95a67d8b8a
LLVM GN Syncbot [Fri, 3 Apr 2020 19:47:51 +0000 (19:47 +0000)]
[gn build] Port f95a67d8b8a

4 years agoRevert "[PowerPC] Replace subtract-from-zero float in version with fneg in PowerPC...
Kevin P. Neal [Fri, 3 Apr 2020 19:41:37 +0000 (15:41 -0400)]
Revert "[PowerPC] Replace subtract-from-zero float in version with fneg in PowerPC special fma compiler builtins"

The new test case causes bot failures.

This reverts commit ba87430cadb2d5d0ee8e4b75101d7abcf6b321bf.

4 years agoDon't use relpaths in lit cfg if build/source dir are on different drives.
Andrew Ng [Fri, 3 Apr 2020 19:41:14 +0000 (15:41 -0400)]
Don't use relpaths in lit cfg if build/source dir are on different drives.

See discussion on https://reviews.llvm.org/D77184.

4 years agoTest had incorrect check for nonzero count
Paul Robinson [Fri, 3 Apr 2020 19:36:37 +0000 (12:36 -0700)]
Test had incorrect check for nonzero count

4 years ago[ORC] Improve documention of memory ownership in the new Orc C bindings.
Lang Hames [Fri, 3 Apr 2020 19:25:32 +0000 (12:25 -0700)]
[ORC] Improve documention of memory ownership in the new Orc C bindings.

4 years agoFix typo in test.
Kevin P. Neal [Fri, 3 Apr 2020 19:21:33 +0000 (15:21 -0400)]
Fix typo in test.

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

4 years ago[GraphDiff] Extend GraphDiff to track a list of updates.
Alina Sbirlea [Fri, 27 Mar 2020 22:02:23 +0000 (15:02 -0700)]
[GraphDiff] Extend GraphDiff to track a list of updates.

Summary:
This patch includes two extensions:
1. It extends the GraphDiff to also keep the original list of updates
after legalization, not just the deletes/insert vectors.
It also provides an API to pop the first update (the updates are store
in reverse, such that the first update is at the end of the list)
2. It adds a bool to mark whether the given updates should be applied as
given, or applied in reverse. This moves the task of reversing the
updates (when the caller needs this) to a functionality inside
GraphDiff, versus having the caller do this.

The two changes could be split into two patches, but they seemed
reasonably small to be reviewed together.

Reviewers: kuhar, dblaikie

Subscribers: hiraditya, george.burgess.iv, mgrang, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add RET-hardening Support to mitigate Load Value Injection (LVI)
Scott Constable [Fri, 3 Apr 2020 17:58:38 +0000 (10:58 -0700)]
[X86] Add RET-hardening Support to mitigate Load Value Injection (LVI)

Adding a pass that replaces every ret instruction with the sequence:

pop <scratch-reg>
lfence
jmp *<scratch-reg>

where <scratch-reg> is some available scratch register, according to the
calling convention of the function being mitigated.

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

4 years ago[PowerPC] Replace subtract-from-zero float in version with fneg in PowerPC special...
Andrew Wock [Fri, 3 Apr 2020 18:55:27 +0000 (14:55 -0400)]
[PowerPC] Replace subtract-from-zero float in version with fneg in PowerPC special fma compiler builtins

This patch adds a test for the PowerPC fma compiler builtins, some variations
of which negate inputs and outputs. The code to generate IR for these
builtins was untested before this patch.

Originally, the code used the outdated method of subtracting floating point
values from -0.0 as floating point negation. This patch remedies that.

Patch by: Drew Wock <drew.wock@sas.com>
Differential Revision: https://reviews.llvm.org/D76949

4 years ago[compiler-rt] Build with correct ABI (PR38025)
Riyaz V Puthiyapurayil [Fri, 27 Mar 2020 23:17:52 +0000 (16:17 -0700)]
[compiler-rt] Build with correct ABI (PR38025)

Summary:
This patch fixes [[ https://bugs.llvm.org/show_bug.cgi?id=38025 | PR38025 ]]:
Wrong ABI used when building compiler-rt

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

4 years agoSupport: Add specializations for reverseBits to use builtin
Matt Arsenault [Sun, 6 Mar 2016 19:48:28 +0000 (11:48 -0800)]
Support: Add specializations for reverseBits to use builtin

4 years agoCodeGen: Convert some TII hooks to use Register
Matt Arsenault [Fri, 3 Apr 2020 17:22:51 +0000 (13:22 -0400)]
CodeGen: Convert some TII hooks to use Register

4 years agoAMDGPU: Use Register in more places
Matt Arsenault [Fri, 3 Apr 2020 17:07:00 +0000 (13:07 -0400)]
AMDGPU: Use Register in more places

4 years agoAMDGPU: Remove redundant virtual
Matt Arsenault [Fri, 3 Apr 2020 16:50:04 +0000 (12:50 -0400)]
AMDGPU: Remove redundant virtual

4 years ago[libc++] NFC: Remove unused CMake option
Louis Dionne [Fri, 3 Apr 2020 18:42:35 +0000 (14:42 -0400)]
[libc++] NFC: Remove unused CMake option

That option seems to be a remnant that has now been replaced by the
LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY setting.

Fixes PR45347.

4 years ago[clang-tidy] Address false positive in modernize-use-default-member-init
Nathan James [Fri, 3 Apr 2020 18:40:59 +0000 (19:40 +0100)]
[clang-tidy] Address false positive in modernize-use-default-member-init

Summary: Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=45363 | incorrect warning emitted by "modernize-use-default-member-init" (new to 10.0.0) ]].

Reviewers: aaron.ballman, alexfh, gribozavr2

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

4 years ago[AMDGPU] Added label to test. NFC.
Stanislav Mekhanoshin [Fri, 3 Apr 2020 18:36:32 +0000 (11:36 -0700)]
[AMDGPU] Added label to test. NFC.

4 years ago[mlir] DialectConversion: support block creation in ConversionPatternRewriter
Alex Zinenko [Fri, 3 Apr 2020 17:53:13 +0000 (19:53 +0200)]
[mlir] DialectConversion: support block creation in ConversionPatternRewriter

PatternRewriter and derived classes provide a set of virtual methods to
manipulate blocks, which ConversionPatternRewriter overrides to keep track of
the manipulations and undo them in case the conversion fails. However, one can
currently create a block only by splitting another block into two. This not
only makes the API inconsistent (`splitBlock` is allowed in conversion
patterns, but `createBlock` is not), but it also make it impossible for one to
create blocks with argument lists different from those of already existing
blocks since in-place block updates are not supported either. Such
functionality precludes dialect conversion infrastructure from being used more
extensively on region-containing ops, for example, for value-returning "if"
operations. At the same time, ConversionPatternRewriter already allows one to
undo block creation as block creation is one of the primitive operations in
already supported region inlining.

Support block creation in conversion patterns by hooking `createBlock` on the
block action undo mechanism. This requires to make `Builder::createBlock`
virtual, similarly to Op insertion. This is a minimal change to the Builder
infrastructure that will later help support additional use cases such as block
signature changes. `createBlock` now additionally takes the types of the block
arguments that are added immediately so as to avoid in-place argument list
manipulation that would be illegal in conversion patterns.

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Fri, 3 Apr 2020 18:24:59 +0000 (11:24 -0700)]
Clean up usages of asserting vector getters in Type

Summary:
Remove usages of asserting vector getters in Type in preparation for the
VectorType refactor. The existence of these functions complicates the
refactor while adding little value.

Reviewers: kparzysz, sdesmalen, efriedma

Reviewed By: kparzysz

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[CMAKE] Plumb include_directories() into tablegen()
Stephen Neuendorffer [Tue, 31 Mar 2020 18:45:59 +0000 (11:45 -0700)]
[CMAKE] Plumb include_directories() into tablegen()

Previously, the tablegen() cmake command, which defines custom
commands for running tablegen, included several hardcoded paths.  This
becomes unwieldy as there are more users for which these paths are
insufficient.  For most targets, cmake uses include_directories() and
the INCLUDE_DIRECTORIES directory property to specify include paths.
This change picks up the INCLUDE_DIRECTORIES property and adds it
to the include path used when running tablegen.  As a side effect, this
allows us to remove several hard coded paths to tablegen that are redundant
with specified include_directories().

I haven't removed the hardcoded path to CMAKE_CURRENT_SOURCE_DIR, which
seems generically useful.  There are several users in clang which apparently
don't have the current directory as an include_directories().  This could
be considered separately.

The new version of this path uses list APPEND rather than list TRANSFORM,
in order to be compatible with cmake 3.4.3. If we update to cmake 3.12 then
we can use list TRANSFORM instead.

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

4 years ago[AMDGPU] Propagate AGPR RC from PHI to its PHI operands
Stanislav Mekhanoshin [Thu, 2 Apr 2020 23:06:45 +0000 (16:06 -0700)]
[AMDGPU] Propagate AGPR RC from PHI to its PHI operands

We can fix register class of PHI based on its all AGPR uses.
That leaves behind all PHIs which were already processed
earlier. Propagate RC back to PHI operands of a PHI.

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

4 years ago[libc++] Remove support for specifying LIBCXX_CXX_ABI_SYSTEM manually
Louis Dionne [Fri, 3 Apr 2020 18:08:53 +0000 (14:08 -0400)]
[libc++] Remove support for specifying LIBCXX_CXX_ABI_SYSTEM manually

This was only kept until Chromium fixed their build of libc++, which
they have now done according to
https://bugs.chromium.org/p/chromium/issues/detail?id=1067216

4 years ago[YAMLParser] Scanner::setError - ensure we use the StringRef::iterator argument ...
Simon Pilgrim [Fri, 3 Apr 2020 17:53:38 +0000 (18:53 +0100)]
[YAMLParser] Scanner::setError - ensure we use the StringRef::iterator argument (PR45043)

As detailed on PR45043, static analysis was warning that the StringRef::iterator Position argument was being ignored and the function was hardwired to use the Current iterator.

This patch ensures we use the provided iterator and removes the (barely necessary) setError wrapper that always used Current.

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

4 years ago[VectorCombine] try to form a better extractelement
Sanjay Patel [Fri, 3 Apr 2020 17:53:54 +0000 (13:53 -0400)]
[VectorCombine] try to form a better extractelement

Extracting to the same index that we are going to insert back into
allows forming select ("blend") shuffles and enables further transforms.

Admittedly, this is a quick-fix for a more general problem that I'm
hoping to solve by adding transforms for patterns that start with an
insertelement.

But this might resolve some regressions known to be caused by the
extract-extract transform (although I have not gotten more details on
those yet).

In the motivating case from PR34724:
https://bugs.llvm.org/show_bug.cgi?id=34724

The combination of subsequent instcombine and codegen transforms gets us this improvement:

  vmovshdup %xmm0, %xmm2    ## xmm2 = xmm0[1,1,3,3]
  vhaddps %xmm1, %xmm1, %xmm4
  vmovshdup %xmm1, %xmm3    ## xmm3 = xmm1[1,1,3,3]
  vaddps %xmm0, %xmm2, %xmm0
  vaddps %xmm1, %xmm3, %xmm1
  vshufps $200, %xmm4, %xmm0, %xmm0 ## xmm0 = xmm0[0,2],xmm4[0,3]
  vinsertps $177, %xmm1, %xmm0, %xmm0 ## xmm0 = zero,xmm0[1,2],xmm1[2]

  -->

  vmovshdup %xmm0, %xmm2    ## xmm2 = xmm0[1,1,3,3]
  vhaddps %xmm1, %xmm1, %xmm1
  vaddps %xmm0, %xmm2, %xmm0
  vshufps $200, %xmm1, %xmm0, %xmm0 ## xmm0 = xmm0[0,2],xmm1[0,3]

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

4 years ago[Support/Path] sys::path::replace_path_prefix fix and simplifications
Sylvain Audi [Tue, 31 Mar 2020 21:21:31 +0000 (17:21 -0400)]
[Support/Path] sys::path::replace_path_prefix fix and simplifications

Added unit tests for 2 scenarios that were failing.
Made replace_path_prefix back to 3 parameters instead of 5, simplifying the implementation. The other 2 were always used with the default value.

This commit is intended to be the first of 3:
1) simplify/fix replace_path_prefix.
2) use it in the context of -fdebug-prefix-map and -fmacro-prefix-map (see D76869).
3) Make Windows version of replace_path_prefix insensitive to both case and separators (slash vs backslash).

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

4 years ago[libc++] Remove useless nothing_to_do.pass.cpp tests
Louis Dionne [Fri, 3 Apr 2020 17:17:57 +0000 (13:17 -0400)]
[libc++] Remove useless nothing_to_do.pass.cpp tests

The testing script used to test libc++ historically did not like directories
without any testing files, so these tests had been added. Since this is
not necessary anymore, we can now remove these files. This has the benefit
that the total number of tests reflects the real number of tests more
closely, and we also skip some unnecessary work (especially relevant when
running tests over SSH).

However, some nothing_to_do.pass.cpp tests actually serve the purpose of
documenting that an area of the Standard doesn't need to be tested, or is
tested elsewhere. These files are not removed by this commit.

Removal done with:

  import os
  import itertools
  for (dirpath, dirnames, filenames) in itertools.chain(os.walk('./libcxx/test'),
                                                        os.walk('./libcxxabi/test')):
      if len(filenames + dirnames) > 1 and \
         any(p == 'nothing_to_do.pass.cpp' for p in filenames):
          os.remove(os.path.join(dirpath, 'nothing_to_do.pass.cpp'))

4 years agoRevert "[CMAKE] Plumb include_directories() into tablegen()"
Stephen Neuendorffer [Fri, 3 Apr 2020 17:47:36 +0000 (10:47 -0700)]
Revert "[CMAKE] Plumb include_directories() into tablegen()"

This reverts commit ae044c5b0caa095602b6ef4cca40d57efc26a8f6.

This breaks the buildbots, which use an older version of cmake.

4 years ago[CMAKE] Plumb include_directories() into tablegen()
Stephen Neuendorffer [Tue, 31 Mar 2020 18:45:59 +0000 (11:45 -0700)]
[CMAKE] Plumb include_directories() into tablegen()

Previously, the tablegen() cmake command, which defines custom
commands for running tablegen, included several hardcoded paths.  This
becomes unwieldy as there are more users for which these paths are
insufficient.  For most targets, cmake uses include_directories() and
the INCLUDE_DIRECTORIES directory property to specify include paths.
This change picks up the INCLUDE_DIRECTORIES property and adds it
to the include path used when running tablegen.  As a side effect, this
allows us to remove several hard coded paths to tablegen that are redundant
with specified include_directories().

I haven't removed the hardcoded path to CMAKE_CURRENT_SOURCE_DIR, which
seems generically useful.  There are several users in clang which apparently
don't have the current directory as an include_directories().  This could
be considered separately.

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

4 years ago[X86][SSE] lowerShuffleWithPACK - extend to use chained PACKs for larger truncations
Simon Pilgrim [Fri, 3 Apr 2020 17:25:53 +0000 (18:25 +0100)]
[X86][SSE] lowerShuffleWithPACK - extend to use chained PACKs for larger truncations

Extend lowerShuffleWithPACK/matchShuffleWithPACK/createPackShuffleMask to handle compaction style shuffle masks that can be lowered to chains of PACKSS/PACKUS if their inputs are suitably sign/zero extended.

This helps avoid PSHUFB (and its mask load) for short shuffle chains, shuffle combining will still replace with a PSHUFB if we have enough shuffles as getFauxShuffleMask should recognise the PACKSS/PACKUS chains.

4 years agoRevert "[SCEV] rewriteLoopExitValues(): even if have hard uses, still rewrite if...
Roman Lebedev [Fri, 3 Apr 2020 16:59:47 +0000 (19:59 +0300)]
Revert "[SCEV] rewriteLoopExitValues(): even if have hard uses, still rewrite if cheap (PR44668)"

As discussed in post-commit review in https://reviews.llvm.org/D73501
if the goal of this is to help vectorizer, then we should actually
be teaching vectorizer to do this, because right now this rewrite
is still budget-limited, which isn't what we'd want.

Additionally, while the rest of the patch series was universally profitable,
this particular patch is reportedly (https://reviews.llvm.org/D73501#1905171)
exposing cost-modeling issues on ARM.

So let's just back this particular patch out. Once there's an undo transform,
this could be considered for reintegration.

This reverts commit 44edc6fd2c63b7db43e13cc8caf1fee79bebdb5f.

4 years ago[NFC] Move ARM `opt -indvars` test from Codegen into Transforms
Roman Lebedev [Fri, 3 Apr 2020 16:30:38 +0000 (19:30 +0300)]
[NFC] Move ARM `opt -indvars` test from Codegen into Transforms

They are really not codegen tests.

4 years ago[LoopStrengthReduce] Fix test checks to fix issue reported on D77227
Simon Pilgrim [Fri, 3 Apr 2020 17:09:44 +0000 (18:09 +0100)]
[LoopStrengthReduce] Fix test checks to fix issue reported on D77227

4 years ago[cuda][hip] Fix `RegisterVar` function prototype.
Michael Liao [Fri, 3 Apr 2020 14:17:06 +0000 (10:17 -0400)]
[cuda][hip] Fix `RegisterVar` function prototype.

Summary:
- `RegisterVar` has `void` return type and `size_t` in its variable size
  parameter in HIP or CUDA 9.0+.

Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AArch64] Fix swap-compare-operands test names to fix issue reported on D77354
Simon Pilgrim [Fri, 3 Apr 2020 16:48:05 +0000 (17:48 +0100)]
[AArch64] Fix swap-compare-operands test names to fix issue reported on D77354

Load of copy+paste errors in the label checks that needed fixing before the missing ":" could be added

4 years ago[PhaseOrdering] add shuffle tests based on D40633; NFC
Sanjay Patel [Fri, 3 Apr 2020 16:21:34 +0000 (12:21 -0400)]
[PhaseOrdering] add shuffle tests based on D40633; NFC

We got some of the potential optimizations with D76727 and D76844.
There are 2 likely enhancements that we could add to -vector-combine
to get most of the remaining cases:
1. Allow bitcasted shuffle mask narrowing (widen the elements).
2. Combine shuffle-of-shuffle into a single shuffle.

This is already partly handled by the x86 backend, but the
tests here show that we still miss some of the potential
combines.

4 years ago[ARM] Fix incorrect handling of big-endian vmov.i64
John Brawn [Mon, 16 Mar 2020 17:28:11 +0000 (17:28 +0000)]
[ARM] Fix incorrect handling of big-endian vmov.i64

Currently when the target is big-endian vmov.i64 reverses the order of the two
words of the vector. This is correct only when the underlying element type is
32-bit, as actually what it should be doing is considering it a vector of the
underlying type and reversing the elements of that.

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

4 years ago[ARM] Avoid pointless vrev of element-wise vmov
John Brawn [Tue, 17 Mar 2020 17:58:04 +0000 (17:58 +0000)]
[ARM] Avoid pointless vrev of element-wise vmov

If we have an element-wise vmov immediate instruction then a subsequent vrev
with width greater or equal to the vmov element width, then that vrev won't do
anything. Add a DAG combine to convert bitcasts that would become such vrevs
into vector_reg_casts instead.

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

4 years agoRun update_llc_test on test/CodeGen/ARM/vmov.ll
John Brawn [Thu, 2 Apr 2020 17:20:16 +0000 (18:20 +0100)]
Run update_llc_test on test/CodeGen/ARM/vmov.ll

This is in preparation for D76514

4 years ago[InstSimplify] Regenerate compares tests to fix issue reported on D77354
Simon Pilgrim [Fri, 3 Apr 2020 16:29:06 +0000 (17:29 +0100)]
[InstSimplify] Regenerate compares tests to fix issue reported on D77354

4 years ago[lldb/Support] Treat empty FileSpec as an invalid file.
Jonas Devlieghere [Fri, 3 Apr 2020 16:18:47 +0000 (09:18 -0700)]
[lldb/Support] Treat empty FileSpec as an invalid file.

LLDB relies on empty FileSpecs being invalid files, for example, they
don't exists. Currently this assumption does not always hold during
reproducer replay, because we pass the result of GetPath to the VFS.
This is an empty string, which the VFS converts to an absolute directory
by prepending the current working directory, before looking it up in the
YAML mapping. This means that an empty FileSpec will exist when the
current working directory does. This breaks at least one test
(TestAddDsymCommand.py) when ran from replay.

This patch special cases empty FileSpecs and returns a sensible result
before calling GetPath and forwarding the call.

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

4 years ago[lldb/Symbol] Reimplement Symbols::FindSymbolFileInBundle to use the VFS
Jonas Devlieghere [Fri, 3 Apr 2020 15:33:55 +0000 (08:33 -0700)]
[lldb/Symbol] Reimplement Symbols::FindSymbolFileInBundle to use the VFS

This reimplements Symbols::FindSymbolFileInBundle to use the VFS-aware
recursive directory iterator. This is needed for reproducer replay.

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

4 years ago[LoopRotate] Cleanup test checks to fix issue reported on D77354
Simon Pilgrim [Fri, 3 Apr 2020 16:21:37 +0000 (17:21 +0100)]
[LoopRotate] Cleanup test checks to fix issue reported on D77354