platform/upstream/llvm.git
4 years agoRemove unused variable
Alex Brachet [Sat, 22 Feb 2020 01:48:07 +0000 (20:48 -0500)]
Remove unused variable

4 years ago[lldb][test] Fix sh_type of .debug_cu_index and .debug_tu_index
Fangrui Song [Sat, 22 Feb 2020 01:37:01 +0000 (17:37 -0800)]
[lldb][test] Fix sh_type of .debug_cu_index and .debug_tu_index

They do not have the SHF_EXCLUDE flag.
After D73999, MC errors `changed section type for .debug_cu_index, expected: 0x0`

4 years agoFlags for displaying only hot nodes in CFGPrinter graph
Kirill Naumov [Sat, 22 Feb 2020 00:36:09 +0000 (16:36 -0800)]
Flags for displaying only hot nodes in CFGPrinter graph

Added two flags to omit uncommon or dead paths in the CFG graphs:
  -cfg-hide-unreachable-paths
  -cfg-hide-deoptimize-paths

The main purpose is performance analysis when such block are not
"interesting" from perspective of common path performance.

Reviewed By: apilipenko, davidxl

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

4 years ago[WebAssembly] Fix a non-determinism problem in FixIrreducibleControlFlow
Heejin Ahn [Sat, 22 Feb 2020 01:01:52 +0000 (17:01 -0800)]
[WebAssembly] Fix a non-determinism problem in FixIrreducibleControlFlow

Summary:
We already sorted the blocks when fixing up a set of mutual
loop entries, however, there can be multiple sets of such
mutual loop entries, and the order we encounter them
should not be random, so sort them too.

Fixes https://bugs.llvm.org/show_bug.cgi?id=44982

Patch by Alon Zakai (kripken)

Reviewers: aheejin, sbc100, dschuff

Subscribers: mgrang, sunfish, hiraditya, jgravelle-google, llvm-commits

Tags: #llvm

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

4 years ago[llvm-objdump][test] Fix source-interleave-function-from-debug.test on Windows after...
Fangrui Song [Sat, 22 Feb 2020 00:46:52 +0000 (16:46 -0800)]
[llvm-objdump][test] Fix source-interleave-function-from-debug.test on Windows after D74507

4 years agoAllow customized relative PYTHONHOME (Attemp 1)
Haibo Huang [Fri, 21 Feb 2020 23:52:15 +0000 (15:52 -0800)]
Allow customized relative PYTHONHOME (Attemp 1)

Summary:
This is another attempt of 0bb90628b5f7c170689d2d3f019af773772fc649.

The difference is that g_python_home is not declared as const. Since
some versions of python do not expect that.

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years agoAMDGPU/GlobalISel: Remove dead code
Matt Arsenault [Tue, 18 Feb 2020 14:34:31 +0000 (09:34 -0500)]
AMDGPU/GlobalISel: Remove dead code

4 years ago[Driver] Escape the program path for -frecord-command-line
Scott Linder [Thu, 20 Feb 2020 21:31:17 +0000 (16:31 -0500)]
[Driver] Escape the program path for -frecord-command-line

Similar to the rest of the command line that is recorded, the program
path must also have spaces and backslashes escaped. Without this
parsing the recorded command line becomes hard on platforms like
Windows where spaces and backslashes are common.

This was originally reverted in
577d9ce35532439203411c999deefc9c80e04c69; this version makes a test
agnostic to the presence of backslashes in paths on some platforms.

Patch By: Ravi Ramaseshan
Differential Revision: https://reviews.llvm.org/D74811

4 years ago[mlir][DeclarativeParser][NFC] Use explicit type names in TypeSwitch to
River Riddle [Sat, 22 Feb 2020 00:09:58 +0000 (16:09 -0800)]
[mlir][DeclarativeParser][NFC] Use explicit type names in TypeSwitch to
appease older GCC.

Older versions of GCC are unable to properly capture 'this' in template lambdas,
resulting in errors.

4 years agoRevert "[AMDGPU] Don’t marke the .note section as ALLOC"
Mark Searles [Fri, 21 Feb 2020 23:26:51 +0000 (15:26 -0800)]
Revert "[AMDGPU] Don’t marke the .note section as ALLOC"

This reverts commit 977cd661cf019039dec7ffdd15bf0ac500828c87.

It breaks OpenCL testing. OpenCL Runtime is using PT_LOAD information
to calculate memory for global variables. This commit should be relanded once
the OpenCL runtime stops relying on PT_LOAD information for calculating global
variable memory size.

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

4 years ago[lldb/test] Tweak libcxx string test on Apple+ARM devices
Vedant Kumar [Fri, 21 Feb 2020 23:21:19 +0000 (15:21 -0800)]
[lldb/test] Tweak libcxx string test on Apple+ARM devices

On Apple platforms, is __arm__ isn't defined and we're not on Intel, we use an
alternate std::string layout. I.e., the libcxx string test fails on phones
because the hand-crafted "garbage" string structs are actually valid strings.

See:

```
  // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
  // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
  #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) &&       \
       (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) ||                           \
      defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
  #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
  #endif
```

Disable inspection of the garbage structs on Apple+ARM devices.

4 years ago[MC][ELF] Error for sh_type, sh_flags or sh_entsize change
Fangrui Song [Tue, 4 Feb 2020 22:28:20 +0000 (14:28 -0800)]
[MC][ELF] Error for sh_type, sh_flags or sh_entsize change

Heads-up message: https://lists.llvm.org/pipermail/llvm-dev/2020-February/139390.html

GNU as started to emit warnings for changed sh_type or sh_flags in 2000.
GNU as>=2.35 will emit errors for most sh_type/sh_flags change, and error for entsize change.

Some cases remain warnings for legacy reasons:

   .section .init_array,"ax", @progbits
   .section .init_array,"ax", @init_array
   # And some obscure sh_flags changes (OS/Processor specific flags)

The rationale of a diagnostic (warning or error) is that sh_type,
sh_flags or sh_entsize changes usually indicate user errors. The values
are taken from the first .section directive. Successive directives are ignored.

We just try to be rigid and emit errors for all sh_type/sh_flags/sh_entsize change.

A possible improvement in the future is to reuse
llvm-readobj/ELFDumper.cpp:getSectionTypeString so that we can name the
type in the diagnostics.

Reviewed By: psmith

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

4 years ago[llvm-objdump] Print method name from debug info in disassembly output.
Jordan Rupprecht [Fri, 21 Feb 2020 23:30:51 +0000 (15:30 -0800)]
[llvm-objdump] Print method name from debug info in disassembly output.

Summary:
GNU objdump prints the method name in disassembly output, and upon further investigation this seems to come from debug info, not the symbol table.

Some additional refactoring is necessary to make this work even when the line number is 0/the filename is unknown. The added test case includes a note for this scenario.

See http://llvm.org/PR41341 for more info.

Reviewers: dblaikie, MaskRay, jhenderson

Reviewed By: MaskRay

Subscribers: ormris, jvesely, aprantl, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[mlir][Tutorial] Add a section to Toy Ch.2 detailing the custom assembly format.
River Riddle [Fri, 21 Feb 2020 22:36:24 +0000 (14:36 -0800)]
[mlir][Tutorial] Add a section to Toy Ch.2 detailing the custom assembly format.

Summary:
This details the C++ format as well as the new declarative format. This has been one of the major missing pieces from the toy tutorial.

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

4 years ago[mlir][DeclarativeParser] Add support for formatting the successors of an operation.
River Riddle [Fri, 21 Feb 2020 21:20:06 +0000 (13:20 -0800)]
[mlir][DeclarativeParser] Add support for formatting the successors of an operation.

This revision add support for formatting successor variables in a similar way to operands, attributes, etc.

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

4 years ago[mlir][ODS] Add support for specifying the successors of an operation.
River Riddle [Fri, 21 Feb 2020 21:19:50 +0000 (13:19 -0800)]
[mlir][ODS] Add support for specifying the successors of an operation.

This revision add support in ODS for specifying the successors of an operation. Successors are specified via the `successors` list:
```
let successors = (successor AnySuccessor:$target, AnySuccessor:$otherTarget);
```

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

4 years ago[mlir] Add a utility iterator range that repeats a given value `n` times.
River Riddle [Fri, 21 Feb 2020 21:19:36 +0000 (13:19 -0800)]
[mlir] Add a utility iterator range that repeats a given value `n` times.

This range is useful when an desired API expects a range or when comparing two different ranges for equality, but the underlying data is a splat. This range removes the need to explicitly construct a vector in those cases.

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

4 years ago[mlir][DeclarativeParser] Add an 'attr-dict-with-keyword' directive
River Riddle [Fri, 21 Feb 2020 21:19:26 +0000 (13:19 -0800)]
[mlir][DeclarativeParser] Add an 'attr-dict-with-keyword' directive

This matches the '(print|parse)OptionalAttrDictWithKeyword' functionality provided by the assembly parser/printer.

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

4 years ago[mlir][DeclarativeParser] Add basic support for optional groups in the assembly format.
River Riddle [Fri, 21 Feb 2020 21:19:15 +0000 (13:19 -0800)]
[mlir][DeclarativeParser] Add basic support for optional groups in the assembly format.

When operations have optional attributes, or optional operands(i.e. empty variadic operands), the assembly format often has an optional section to represent these arguments. This revision adds basic support for defining an "optional group" in the assembly format to support this. An optional group is defined by wrapping a set of elements in `()` followed by `?` and requires the following:

* The first element of the group must be either a literal or an operand argument.
  - This is because the first element must be optionally parsable.
* There must be exactly one argument variable within the group that is marked as the anchor of the group. The anchor is the element whose presence controls whether the group should be printed/parsed. An element is marked as the anchor by adding a trailing `^`.
* The group must only contain literals, variables, and type directives.
  - Any attribute variables may be used, but only optional attributes can be marked as the anchor.
  - Only variadic, i.e. optional, operand arguments can be used.
  - The elements of a type directive must be defined within the same optional group.

An example of this can be seen with the assembly format for ReturnOp, which has a variadic number of operands.

```
def ReturnOp : ... {
  let arguments = (ins Variadic<AnyType>:$operands);

  // We only print the operands+types if there are a non-zero number
  // of operands.
  let assemblyFormat = "attr-dict ($operands^ `:` type($operands))?";
}
```

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

4 years ago[mlir][DeclarativeParser] Add support for the TypesMatchWith trait.
River Riddle [Fri, 21 Feb 2020 21:19:03 +0000 (13:19 -0800)]
[mlir][DeclarativeParser] Add support for the TypesMatchWith trait.

This allows for injecting type constraints that are not direct 1-1 mappings, for example when one type is equal to the element type of another. This allows for moving over several more parsers to the declarative form.

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

4 years ago[Analysis][Docs] Parents of loops documentation.
Stefanos Baziotis [Fri, 21 Feb 2020 23:07:53 +0000 (17:07 -0600)]
[Analysis][Docs] Parents of loops documentation.

Recently I had to use it and although one assumes it returns null if
there's no parent loop, I think it helps to doc it.

Reviewed By: Meinersbur

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

4 years agoRevert "Allow customized relative PYTHONHOME"
Stella Stamenova [Fri, 21 Feb 2020 22:56:17 +0000 (14:56 -0800)]
Revert "Allow customized relative PYTHONHOME"

This reverts commit 0bb90628b5f7c170689d2d3f019af773772fc649 since it is causing failures on the Windows LLDB buildbot:

http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/14048

4 years ago[Target] Remove libObject dependency in lib/Target
Francis Visoiu Mistrih [Fri, 21 Feb 2020 22:50:45 +0000 (14:50 -0800)]
[Target] Remove libObject dependency in lib/Target

This removes a couple useless includes and the dependency of X86Desc on Object,
which was useless as well.

4 years ago[Attributor][FIX] Disable a test to unblock the builders
Johannes Doerfert [Fri, 21 Feb 2020 22:41:02 +0000 (14:41 -0800)]
[Attributor][FIX] Disable a test to unblock the builders

To unblock the builders this disables a test for which the CHECK lines
need to be updated. The patch causing the failure was not reverted
because it is needed for a different problem we are investigating. Here
we just need to update the CHECK lines which will happen in the
meantime.

4 years ago[GISel][KnownBits] Add a cache mechanism to speed compile time
Quentin Colombet [Fri, 21 Feb 2020 01:51:26 +0000 (17:51 -0800)]
[GISel][KnownBits] Add a cache mechanism to speed compile time

This patch adds a cache that is valid only for the duration of a call
to getKnownBits. With such short lived cache we avoid all the problems
of cache invalidation while still getting the benefits of reusing
the information we already computed.

This cache is useful whenever an instruction occurs more than once
in a chain of computation.
E.g.,
v0 = G_ADD v1, v2
v3 = G_ADD v0, v1

Previously we would compute the known bits for:
v1, v2, v0, then v1 again and finally v3.

With the patch, now we won't have to recompute v1 again.

NFC

4 years ago[Attributor][FIX] Undo 16188f9 until SCC iterator bug is fixed
Johannes Doerfert [Fri, 21 Feb 2020 22:18:30 +0000 (14:18 -0800)]
[Attributor][FIX] Undo 16188f9 until SCC iterator bug is fixed

The buildbot
  http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win
shows some strange SCC iterator bug since 16188f9 which we need to
investigate. This patch should remove the part of 16188f9 that could
have exposed the problem.

4 years ago[CloneFunction] Update loop headers after cloning all blocks in loop.
Whitney Tsang [Fri, 21 Feb 2020 22:15:39 +0000 (22:15 +0000)]
[CloneFunction] Update loop headers after cloning all blocks in loop.

Summary:
Blocks in a loop can be in any order as long as the loop header is the
first block in Blocks.
With some order of Blocks, cloneLoopWithPreheader would trigger the
assertion in addBasicBlockToLoop.

Example:

define void @test(i64 %N) {
preheader.i:
  br label %header.i

header.i:
  %i = phi i64 [ 0, %preheader.i ], [ %inc.i, %latch.i ]
  br label %header.j

header.j:
  %j = phi i64 [ 0, %header.i ], [ %inc.j, %latch.j ]
  br label %header.k

header.k:
  %k = phi i64 [ 0, %header.j ], [ %inc.k, %latch.k ]
  call void @baz(i64 %i, i64 %j, i64 %k)
  br label %latch.k

latch.k:
  %inc.k = add nsw i64 %k, 1
  %cmp.k = icmp slt i64 %inc.k, %N
  br i1 %cmp.k, label %header.k, label %latch.j

latch.j:
  %inc.j = add nsw i64 %j, 1
  %cmp.j = icmp slt i64 %inc.j, %N
  br i1 %cmp.j, label %header.j, label %latch.i

latch.i:
  %inc.i = add nsw i64 %i, 1
  %cmp.i = icmp slt i64 %inc.i, %N
  br i1 %cmp.i, label %header.i, label %exit.i

exit.i:
  ret void
}
declare void @baz(i64, i64, i64)
If the blocks of loop-i is in the order: header.i, latch.k, header.k,
header.j, latch.j, latch.i,
then cloneLoopWithPreheader would trigger the assertion in
addBasicBlockToLoop
assert(contains(SameHeader) && getHeader() == SameHeader->getHeader() &&
"Incorrect LI specified for this loop!");

As latch.k is in both loop-j and loop-k, it would be set as the header
of both loops after adding latch.k.
If we update loop headers during cloning blocks, then after adding
header.k,
the header of loop-k would be updated with header.k,
while the header of loop-j stays as latch.k.

When adding header.j, SameHeader is loop-k, SameHeader->getHeader() is
header.k, but getHeader() is latch.k, which trigger the assertion.
Reviewer: jdoerfert, Meinersbur, fhahn, kbarton, hfinkel, bmahjour,
etiotto
Reviewed By: Meinersbur
Subscribers: hiraditya, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D74382

4 years ago[Hexagon] Define __ELF__ by default.
Sid Manning [Fri, 21 Feb 2020 19:41:22 +0000 (13:41 -0600)]
[Hexagon] Define __ELF__ by default.

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

4 years ago[AArch64] Delete an unneeded dependency on Object after 1874dee5662603c9251228c71b66d...
Fangrui Song [Fri, 21 Feb 2020 22:02:39 +0000 (14:02 -0800)]
[AArch64] Delete an unneeded dependency on Object after 1874dee5662603c9251228c71b66de72cec0c979

1874dee5662603c9251228c71b66de72cec0c979 moved CPU_(SUB_)TYPE logic to
BinaryFormat. Object is not directly referenced.

4 years ago[AArch64][SVE] Fix -DBUILD_SHARED_LIBS=on builds after -D74808/1874dee5662603c9251228...
Fangrui Song [Fri, 21 Feb 2020 21:54:09 +0000 (13:54 -0800)]
[AArch64][SVE] Fix -DBUILD_SHARED_LIBS=on builds after -D74808/1874dee5662603c9251228c71b66de72cec0c979

4 years ago[SelectionDAG] remove unused isFast() helper function; NFC
Sanjay Patel [Fri, 21 Feb 2020 21:46:39 +0000 (16:46 -0500)]
[SelectionDAG] remove unused isFast() helper function; NFC

We want flag users to check individual fast-math flags,
not that all of them are set. This was also probably
not working as intended because NoFPExcept isn't always
set on non-strict nodes.

4 years agoclang/Modules: Finish renaming CompilerInstance::ModuleManager, NFC.
Volodymyr Sapsai [Fri, 21 Feb 2020 01:45:51 +0000 (17:45 -0800)]
clang/Modules: Finish renaming CompilerInstance::ModuleManager, NFC.

Follow-up to 20d51b2f14ac4488f684f8fc57cb0ba718a6b91d, rename the setter to
make it consistent with the getter. Also fixed a few comments along the
way, didn't try to find all references to a module manager.

Reviewed By: dexonsmith

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

4 years ago[AArch64][SVE] Fix -Wimplicit-fallthrough after D73711
Fangrui Song [Fri, 21 Feb 2020 21:45:12 +0000 (13:45 -0800)]
[AArch64][SVE] Fix -Wimplicit-fallthrough after D73711

4 years ago[lldb/Plugins] Add ability to fetch crash information on crashed processes
Med Ismail Bennani [Fri, 21 Feb 2020 21:43:25 +0000 (22:43 +0100)]
[lldb/Plugins] Add ability to fetch crash information on crashed processes

Currently, in macOS, when a process crashes, lldb halts inside the
implementation disassembly without yielding any useful information.
The only way to get more information is to detach from the process, then wait
for ReportCrash to generate a report, find the report, then see what error
message was included in it. Instead of waiting for this to happen, lldb could
locate the error_string and make it available to the user.

This patch addresses this issue by enabling the user to fetch extended
crash information for crashed processes using `process status --verbose`.

Depending on the platform, this will try to gather different crash information
into an structured data dictionnary. This dictionnary is generic and extensible,
as it contains an array for each different type of crash information.

On Darwin Platforms, lldb will iterate over each of the target's images,
extract their `__crash_info` section and generated a StructuredData::Array
containing, in each entry, the module spec, its UUID, the crash messages
and the abort cause. The array will be inserted into the platform's
`m_extended_crash_info` dictionnary and `FetchExtendedCrashInformation` will
return its JSON representation like this:

```
{
  "crash-info annotations": [
    {
      "abort-cause": 0,
      "image": "/usr/lib/system/libsystem_malloc.dylib",
      "message": "main(76483,0x1000cedc0) malloc: *** error for object 0x1003040a0: pointer being freed was not allocated",
      "message2": "",
      "uuid": "5747D0C9-900D-3306-8D70-1E2EA4B7E821"
    },
    ...
  ],
  ...
}
```

This crash information can also be fetched using the SB API or lldb-rpc protocol
using SBTarget::GetExtendedCrashInformation().

rdar://37736535

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[lldb/test] Move `platform process list` tests to its own directory (NFC)
Med Ismail Bennani [Wed, 19 Feb 2020 15:33:39 +0000 (16:33 +0100)]
[lldb/test] Move `platform process list` tests to its own directory (NFC)

Since the `platform process` commamnd has more tests now, this commits
separates each of the `platform process` subcommand's test in its own directory.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[llvm-objcopy][MachO] Change the storage of sections
Alexander Shaposhnikov [Fri, 21 Feb 2020 21:18:36 +0000 (13:18 -0800)]
[llvm-objcopy][MachO] Change the storage of sections

In this diff we change the storage of a section to unique_ptr.
This refactoring was factored out from D71647.

Test plan: make check-all

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

4 years ago[AArch64][SVE] Add support for DestructiveBinary and DestructiveBinaryComm Destructiv...
Cameron McInally [Fri, 21 Feb 2020 20:41:35 +0000 (14:41 -0600)]
[AArch64][SVE] Add support for DestructiveBinary and DestructiveBinaryComm DestructiveInstTypes

Add support for DestructiveBinaryComm DestructiveInstType, as well as the lowering code to expand the new Pseudos into the final movprfx+instruction pairs.

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

4 years agoAMDGPU/GlobalISel: Better code for one case of G_SHUFFLE_VECTOR on v2i16
Jay Foad [Fri, 21 Feb 2020 20:59:44 +0000 (20:59 +0000)]
AMDGPU/GlobalISel: Better code for one case of G_SHUFFLE_VECTOR on v2i16

Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[VectorCombine] refactor to reduce duplicated code; NFC
Sanjay Patel [Fri, 21 Feb 2020 20:43:05 +0000 (15:43 -0500)]
[VectorCombine] refactor to reduce duplicated code; NFC

This should be the last step in the current cleanup.
Follow-ups should resolve the TODO about cost calc
and enable the more general case where we extract
different elements.

4 years ago[gn build] Port 1874dee5662
LLVM GN Syncbot [Fri, 21 Feb 2020 20:51:44 +0000 (20:51 +0000)]
[gn build] Port 1874dee5662

4 years agoAllow customized relative PYTHONHOME
Haibo Huang [Mon, 17 Feb 2020 01:33:32 +0000 (17:33 -0800)]
Allow customized relative PYTHONHOME

Summary:
This change allows a hard coded relative PYTHONHOME setting. So that
python can easily be packaged together with lldb.

The change includes:
1. Extend LLDB_RELOCATABLE_PYTHON to all platforms. It defaults to ON
for platforms other than Windows, to keep the behavior compatible.
2. Allows to customize LLDB_PYTHON_HOME. But still defaults to
PYTHON_HOME.
3. LLDB_PYTHON_HOME can be a path relative to liblldb. If it is
relative, we will resolve it before send it to Py_DecodeLocale.

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years ago[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormat
Francis Visoiu Mistrih [Wed, 19 Feb 2020 00:39:05 +0000 (16:39 -0800)]
[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormat

This moves all the logic of converting LLVM Triples to
MachO::CPU_(SUB_)TYPE from the specific target (Target)AsmBackend to
more convenient functions in lib/BinaryFormat.

This also gets rid of the separate two X86AsmBackend classes.

The previous attempt was to add it to libObject, but that adds an
unnecessary dependency to libObject from all the targets.

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

4 years ago[X86] Add a new format type for instructions that represent named prefix bytes like...
Craig Topper [Fri, 21 Feb 2020 20:30:27 +0000 (12:30 -0800)]
[X86] Add a new format type for instructions that represent named prefix bytes like data16 and rep. Use it to make a simpler version of isPrefix.

isPrefix was added to support the patches to align branches.
it relies on a switch over instruction names.

This moves those opcodes to a new format so the information is
tablegen and we can just check for a specific value in some bits
in TSFlags instead.

I've left the other function in place for now so that the
existing patches in phabricator will still work. I'll work with
the owner to get them migrated.

4 years ago[IR] Update BasicBlock::validateInstrOrdering comments, NFC
Reid Kleckner [Fri, 21 Feb 2020 20:31:00 +0000 (12:31 -0800)]
[IR] Update BasicBlock::validateInstrOrdering comments, NFC

Pointed out by Jay Foad.

4 years ago[llvm][CodeGen][aarch64] Add contiguous prefetch intrinsics for SVE.
Francesco Petrogalli [Thu, 13 Feb 2020 20:42:26 +0000 (20:42 +0000)]
[llvm][CodeGen][aarch64] Add contiguous prefetch intrinsics for SVE.

Summary: The patch covers both register/register and register/immediate addressing modes.

Reviewers: efriedma, andwar, sdesmalen

Reviewed By: sdesmalen

Subscribers: sdesmalen, tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[VectorCombine] refactor cost calcs to reduce duplication; NFC
Sanjay Patel [Fri, 21 Feb 2020 19:25:39 +0000 (14:25 -0500)]
[VectorCombine] refactor cost calcs to reduce duplication; NFC

More cleanup is possible now, but we probably need to
resolve the TODO about the existing difference between
compares and binops.

4 years ago[llvm][aarch64] SVE addressing modes.
Francesco Petrogalli [Tue, 28 Jan 2020 20:37:52 +0000 (20:37 +0000)]
[llvm][aarch64] SVE addressing modes.

Summary:
Added register + immediate and register + register addressing modes for the following intrinsics:

1. Masked load and stores:
     * Sign and zero extended load and truncated stores.
     * No extension or truncation.
2. Masked non-temporal load and store.

Reviewers: andwar, efriedma

Subscribers: cameron.mcinally, sdesmalen, tschuett, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoMove StandardOps/Ops.h to StandardOps/IR/Ops.h
Rob Suderman [Fri, 21 Feb 2020 19:54:49 +0000 (11:54 -0800)]
Move StandardOps/Ops.h to StandardOps/IR/Ops.h

Summary:
NFC - Moved StandardOps/Ops.h to a StandardOps/IR dir to better match surrounding
directories. This is to match other dialects, and prepare for moving StandardOps
related transforms in out for Transforms and into StandardOps/Transforms.

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

4 years ago[Hexagon] Simplify intrinsic (vandvrt (vandqrt q b) m) -> q if possible
Krzysztof Parzyszek [Fri, 21 Feb 2020 16:35:59 +0000 (10:35 -0600)]
[Hexagon] Simplify intrinsic (vandvrt (vandqrt q b) m) -> q if possible

When each byte in b&m is non-zero, this conversion Q->V->Q is a no-op.

4 years ago[MLIR] Remove constexpr from LoopOps.td
Nagy Mostafa [Fri, 21 Feb 2020 19:48:45 +0000 (11:48 -0800)]
[MLIR] Remove constexpr from LoopOps.td

Reviewed By: rriddle

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

4 years ago[mlir][spirv] Add lowering for load/store zero-rank memref from std to SPIR-V.
Hanhan Wang [Fri, 21 Feb 2020 19:39:32 +0000 (14:39 -0500)]
[mlir][spirv] Add lowering for load/store zero-rank memref from std to SPIR-V.

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

4 years ago[CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V
Luís Marques [Fri, 21 Feb 2020 19:26:09 +0000 (19:26 +0000)]
[CodeGen][RISCV] Fix clang/test/CodeGen/atomic_ops.c for RISC-V

By default the RISC-V target doesn't have the atomics standard extension
enabled. The first RUN line in `clang/test/CodeGen/atomic_ops.c` didn't
specify a target triple, which meant that on RISC-V Linux hosts it would
target RISC-V, but because it used clang cc1 we didn't get the toolchain
driver functionality to automatically turn on the extensions implied by
the target triple (riscv64-linux includes atomics). This would cause the
test to fail on RISC-V hosts.

This patch changes the test to have RUN lines for two explicit targets,
one with native atomics and one without. To work around FileCheck
limitations and more accurately match the output, some tests now have
separate prefixes for the two cases.

Reviewers: jyknight, eli.friedman, lenary, efriedma
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D74847

4 years ago[AArch64][SVE] Add backend support for splats of immediates
Cameron McInally [Fri, 21 Feb 2020 19:15:28 +0000 (13:15 -0600)]
[AArch64][SVE] Add backend support for splats of immediates

This patch adds backend support for splats of both Int and FP immediates.

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

4 years ago[libc++] Do not set the `availability=XXX` feature when not testing against a system...
Louis Dionne [Fri, 21 Feb 2020 18:53:50 +0000 (13:53 -0500)]
[libc++] Do not set the `availability=XXX` feature when not testing against a system libc++

Otherwise, the `availability=XXX` lit feature is set even when we're
testing trunk and _LIBCPP_DISABLE_AVAILABILITY is defined, which causes
tests that check for availability markup to be enabled and unexpectedly
pass.

4 years ago[ARM] Change ARMAttributeParser::Parse to use support::endianness and simplify
Fangrui Song [Fri, 21 Feb 2020 18:55:12 +0000 (10:55 -0800)]
[ARM] Change ARMAttributeParser::Parse to use support::endianness and simplify

4 years agoAMDGPU/GlobalISel: Fix SALU mapping for v2s16 min/max
Matt Arsenault [Wed, 19 Feb 2020 19:53:03 +0000 (14:53 -0500)]
AMDGPU/GlobalISel: Fix SALU mapping for v2s16 min/max

The legalizer helper functions are unusably awkward to perform the 3-5
part legalization. This needs to be widened, scalarized, lowered, and
we should avoid creating vector extends and truncates. Manually do all
of this and expand.

4 years ago[lldb/cmake] Enable more verbose find_package output.
Matt Davis [Fri, 21 Feb 2020 18:33:35 +0000 (10:33 -0800)]
[lldb/cmake] Enable more verbose find_package output.

Summary:
The purpose of this patch is to make identifying missing dependencies clearer to the user.
`find_package` will report if a package is not found, that output, combined with the exiting
status message, is clearer than not having the additional verbosity.

If the SWIG dependency is required {LLDB_ENABLE_PYTHON, LLDB_ENABLE_LUA}
and SWIG is not available, fail the configuration step.  Terminate the
configure early rather than later with a clear error message.

We could possibly modify:
`llvm-project/lldb/cmake/modules/FindPythonInterpAndLibs.cmake`
However, the patch here seems clear in my opinion.

Reviewers: aadsm, hhb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: labath, jrm, mgorny, lldb-commits

Tags: #lldb

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

4 years agoAMDGPU: Move dot intrinsic patterns to instruction def
Matt Arsenault [Wed, 19 Feb 2020 15:42:31 +0000 (10:42 -0500)]
AMDGPU: Move dot intrinsic patterns to instruction def

I tried to use some of the new tablegen features to avoid creating
different operand list permutations, but I still don't see a way to
programmatically build a source pattern dag.

Also add GlobalISel tests, which now all import successfully.

Some of the fneg fold tests are incorrect, which need to be fixed in a
future commit

4 years agoAMDGPU/GlobalISel: Select llvm.amdgcn.fdot2
Matt Arsenault [Tue, 18 Feb 2020 03:26:04 +0000 (22:26 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.fdot2

I'm slighly worried about the generated checks, since they won't catch
incorrect modifiers being added at the end of the line.

4 years agoAMDGPU/GlobalISel: Select VOP3P instructions
Matt Arsenault [Sun, 1 Sep 2019 02:39:00 +0000 (22:39 -0400)]
AMDGPU/GlobalISel: Select VOP3P instructions

This only handles the basic cases. More work is needed to make better
use of op_sel.

4 years agoAMDGPU/GlobalISel: Select G_SHUFFLE_VECTOR
Matt Arsenault [Sun, 16 Feb 2020 04:56:56 +0000 (23:56 -0500)]
AMDGPU/GlobalISel: Select G_SHUFFLE_VECTOR

G_SHUFFLE_VECTOR is legal since it theoretically may help match op_sel
for VOP3P instructions. Expand it in some other way in case it doesn't
fold into the use instructions.

4 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 21 Feb 2020 18:23:29 +0000 (18:23 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

4 years ago[LoopVectorize][X86] Regenerate tests. NFCI.
Simon Pilgrim [Fri, 21 Feb 2020 18:14:01 +0000 (18:14 +0000)]
[LoopVectorize][X86] Regenerate tests. NFCI.

4 years ago[XCOFF][AIX] Put undefined symbol name into StringTable when neccessary
jasonliu [Fri, 21 Feb 2020 17:20:45 +0000 (17:20 +0000)]
[XCOFF][AIX] Put undefined symbol name into StringTable when neccessary

Summary:
When we have a long name for the undefined symbol, we would hit this assertion:
Assertion failed: I != StringIndexMap.end() && "String is not in table!"
This patch addresses that.

Reviewed by: DiggerLin, daltenty

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

4 years ago[MLIR] Allow Loop dialect IfOp and ForOp to define values
Nagy Mostafa [Fri, 21 Feb 2020 17:58:00 +0000 (09:58 -0800)]
[MLIR] Allow Loop dialect IfOp and ForOp to define values

This patch implements the RFCs proposed here:
https://llvm.discourse.group/t/rfc-modify-ifop-in-loop-dialect-to-yield-values/463
https://llvm.discourse.group/t/rfc-adding-operands-and-results-to-loop-for/459/19.

It introduces the following changes:
- All Loop Ops region, except for ReduceOp, terminate with a YieldOp.
- YieldOp can have variadice operands that is used to return values out of IfOp and ForOp regions.
- Change IfOp and ForOp syntax and representation to define values.
- Add unit-tests and update .td documentation.
- YieldOp is a terminator to loop.for/if/parallel
- YieldOp custom parser and printer

Lowering is not supported at the moment, and will be in a follow-up PR.

Thanks.

Reviewed By: bondhugula, nicolasvasilache, rriddle

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

4 years ago[llvm][CodeGen] DAG Combiner folds for vscale.
Francesco Petrogalli [Tue, 18 Feb 2020 19:13:39 +0000 (19:13 +0000)]
[llvm][CodeGen] DAG Combiner folds for vscale.

Summary:
This patch simplifies the DAGs generated when using the intrinsic `@llvm.vscale.*` as follows:

* Fold (add (vscale * C0), (vscale * C1)) to (vscale * (C0 + C1)).
* Canonicalize (sub X, (vscale * C)) to (add X,  (vscale * -C)).
* Fold (mul (vscale * C0), C1) to (vscale * (C0 * C1)).
* Fold (shl (vscale * C0), C1) to (vscale * (C0 << C1)).

The test `sve-gep-ll` have been updated to reflect the folding introduced by this patch.

Reviewers: efriedma, sdesmalen, andwar, rengolin

Reviewed By: sdesmalen

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[InstCombine] Improve simplify demanded bits worklist management
Nikita Popov [Thu, 20 Feb 2020 21:19:10 +0000 (22:19 +0100)]
[InstCombine] Improve simplify demanded bits worklist management

This fixes a small mistake from D72944: The worklist add should
happen before assigning the new operand, not after.

In case an actual replacement happens, the old operand needs to
be added for DCE. If no actual replacement happens, then old/new
are the same, so it doesn't matter.

This drops one iteration from the annotated test case.

4 years ago[BFI] Fix missed BFI updates in MachineSink.
Hiroshi Yamauchi [Wed, 12 Feb 2020 22:55:53 +0000 (14:55 -0800)]
[BFI] Fix missed BFI updates in MachineSink.

Summary:
This prevents BFI queries on new blocks (from
MachineSinking::GetAllSortedSuccessors) and fixes a bunch of assert failures
under -check-bfi-unknown-block-queries=true.

Reviewers: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Clang interpreter] Rename Block.{h,cpp} to InterpBlock.{h,cpp}
Fangrui Song [Thu, 20 Feb 2020 22:54:22 +0000 (14:54 -0800)]
[Clang interpreter] Rename Block.{h,cpp} to InterpBlock.{h,cpp}

The Blocks runtime provide a header named Block.h.
It is generally preferable to avoid name collision with system headers
(reducing reliance on -isystem order, more friendly when navigating files in
an editor, etc).

Reviewed By: gribozavr2

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

4 years ago[InstCombine] Use replaceOperand() in more places
Nikita Popov [Sun, 16 Feb 2020 09:16:17 +0000 (10:16 +0100)]
[InstCombine] Use replaceOperand() in more places

Followup to D73919 with another batch of replacements of
setOperand() -> replaceOperand(), to make sure the old
operand gets DCEd right away.

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

4 years ago[DSE,MSSA] Dbg counters required assertions. Mark test accordingly.
Florian Hahn [Fri, 21 Feb 2020 17:34:34 +0000 (17:34 +0000)]
[DSE,MSSA] Dbg counters required assertions. Mark test accordingly.

4 years ago[VectorUtils] Move ToVectorTy to VectorUtils.h (NFC).
Florian Hahn [Fri, 21 Feb 2020 17:21:44 +0000 (17:21 +0000)]
[VectorUtils] Move ToVectorTy to VectorUtils.h (NFC).

ToVectorTy is defined and used in multiple places. Hoist it to
VectorUtils.h to avoid duplication and improve re-usability.

Reviewers: rengolin, hsaito, Ayal, gilr, fpetrogalli

Reviewed By: fpetrogalli

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

4 years ago[X86] Fix SDLoc initialization
Nikita Popov [Fri, 21 Feb 2020 17:11:51 +0000 (18:11 +0100)]
[X86] Fix SDLoc initialization

Fixes -Wparentheses warning, in this case indicating a genuine
bug.

4 years ago[SimplifyLibCalls][IRBuilder] Accept any IRBuilder in SimplifyLibCalls
Nikita Popov [Tue, 18 Feb 2020 21:20:55 +0000 (22:20 +0100)]
[SimplifyLibCalls][IRBuilder] Accept any IRBuilder in SimplifyLibCalls

This changes the SimplifyLibCalls utility to accept an IRBuilderBase,
which allows us to pass through the IRBuilder used by InstCombine.
This will ensure that new instructions get added to the worklist.
The annotated test-case drops from 4 to 2 InstCombine iterations thanks
to this.

To achieve this, I'm adding an IRBuilderBase::OperandBundlesGuard,
which is basically the same as the existing InsertPointGuard and
FastMathFlagsGuard, but for operand bundles. Also add a
setDefaultOperandBundles() method so these can be set outside the
constructor.

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

4 years ago[gn build] Port 23444edf30b
LLVM GN Syncbot [Fri, 21 Feb 2020 17:21:54 +0000 (17:21 +0000)]
[gn build] Port 23444edf30b

4 years ago[SystemZ] Return scalarized costs for vector instructions on older archs.
Jonas Paulsson [Thu, 20 Feb 2020 18:40:30 +0000 (10:40 -0800)]
[SystemZ]  Return scalarized costs for vector instructions on older archs.

A cost query for a vector instruction should return a cost even without
target vector support, and not trigger an assert.

VectorCombine does this with an input containing source code vectors.

Review: Ulrich Weigand

4 years agoAMDGPU: Use default operand for VOP3P clamp
Matt Arsenault [Tue, 18 Feb 2020 14:34:31 +0000 (09:34 -0500)]
AMDGPU: Use default operand for VOP3P clamp

We don't use this, and matching from the def doesn't make much sense.

There are multiple tablegen bugs with default operand
handling. undef_tied_input should work to handle the vdst_in
correctly, but this breaks the operand register class constraint which
it should be able to infer.

4 years ago[AArch64][SVE] Add intrinsics for SVE2 bitwise ternary operations
Danilo Carvalho Grael [Fri, 21 Feb 2020 16:59:52 +0000 (11:59 -0500)]
[AArch64][SVE] Add intrinsics for SVE2 bitwise ternary operations

Summary:
Add intrinsics for the following operations:
- eor3, bcax
- bsl, bsl1n, bsl2n, nbsl

Fix MC tests for bsl instructions.

Reviewers: kmclaughlin, c-rhodes, sdesmalen, efriedma, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[VectorCombine] refactor matching code to reduce duplication; NFC
Sanjay Patel [Fri, 21 Feb 2020 16:49:11 +0000 (11:49 -0500)]
[VectorCombine] refactor matching code to reduce duplication; NFC

cmp/binop were already diverging even though they are largely
the same logic.

4 years ago[AST matchers] Add basic matchers for googletest EXPECT/ASSERT calls.
Yitzhak Mandelbaum [Wed, 19 Feb 2020 16:04:51 +0000 (11:04 -0500)]
[AST matchers] Add basic matchers for googletest EXPECT/ASSERT calls.

Summary:
This revision adds matchers that match calls to the gtest EXPECT and ASSERT
macros almost like function calls. The matchers are placed in separate files
(GtestMatchers...), because they are specific to the gtest library.

Reviewers: gribozavr2

Subscribers: mgorny, cfe-commits

Tags: #clang

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

4 years ago[DSE,MSSA] Add debug counter.
Florian Hahn [Fri, 21 Feb 2020 16:55:18 +0000 (16:55 +0000)]
[DSE,MSSA] Add debug counter.

Can be used like
-debug-counter=dse-memoryssa-skip=10,dse-memoryssa-counter-count=20

Reviewers: dmgreen, rnk, efriedma, bryant, asbirlea

Reviewed By: asbirlea

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

4 years ago[AArch64][SVE] Add +fullfp16 to sve-vector-splat.ll
Cameron McInally [Fri, 21 Feb 2020 16:55:25 +0000 (10:55 -0600)]
[AArch64][SVE] Add +fullfp16 to sve-vector-splat.ll

Add +fullfp16 to sve-vector-splat.ll so we can test folding of immediates into moves.

This attribute can go away later when SVE has a full set of fp16 patterns in place.

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

4 years agoGlobalISel: Fix narrowing of (G_ASHR i64:x, 32)
Jay Foad [Thu, 20 Feb 2020 20:21:30 +0000 (20:21 +0000)]
GlobalISel: Fix narrowing of (G_ASHR i64:x, 32)

Reviewers: arsenm

Subscribers: jvesely, wdng, nhaehnle, rovka, hiraditya, volkan, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Commit test changes I forgot to squash
Matt Arsenault [Thu, 20 Feb 2020 14:58:03 +0000 (09:58 -0500)]
AMDGPU/GlobalISel: Commit test changes I forgot to squash

These should have been in ac7abe0ba9ae4c6a2248cc3ef4e4fe7e6d270105

4 years agoAMDGPU/GlobalISel: Fix xnor matching
Matt Arsenault [Fri, 21 Feb 2020 02:12:04 +0000 (21:12 -0500)]
AMDGPU/GlobalISel: Fix xnor matching

We should try the generated matchers before the manual selection. This
means the patterns are now handling the common cases, but the manual
selection code is not yet dead. It's still handling the non-s32/s64
cases (like v2s16 and v2s32). Currently tablegen doesn't have a nice
way to have a single pattern that covers multiple types.

4 years ago[TargetLowering] Apply basic shift combines before recursive SimplifyDemandedBits...
Simon Pilgrim [Fri, 21 Feb 2020 15:30:56 +0000 (15:30 +0000)]
[TargetLowering] Apply basic shift combines before recursive SimplifyDemandedBits calls.

Minor refactor/cleanup before we begin adding non-uniform support.

4 years ago[ELF] Shuffle .init_array/.fini_array with --shuffle-sections=
Fangrui Song [Thu, 20 Feb 2020 07:14:49 +0000 (23:14 -0800)]
[ELF] Shuffle .init_array/.fini_array with --shuffle-sections=

Useful for detecting static initialization order fiasco.

Reviewed By: grimar

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

4 years ago[lldb-vscode] Use libOption with tablegen to parse command line options.
Ivan Hernandez [Fri, 21 Feb 2020 16:13:05 +0000 (08:13 -0800)]
[lldb-vscode] Use libOption with tablegen to parse command line options.

This change will bring lldb-vscode in line with how several other llvm
tools process command line arguments and make it easier to add future
options.

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

4 years ago[ELF] Warn changed output section address
Fangrui Song [Mon, 17 Feb 2020 21:56:01 +0000 (13:56 -0800)]
[ELF] Warn changed output section address

When the output section address (addrExpr) is specified, GNU ld warns if
sh_addr is different. This patch implements the warning.

Note, LinkerScript::assignAddresses can be called more than once. We
need to record the changed section addresses, and only report the
warnings after the addresses are finalized.

Reviewed By: grimar

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

4 years ago[ELF] Ignore the maximum of input section alignments for two cases
Fangrui Song [Mon, 17 Feb 2020 18:21:31 +0000 (10:21 -0800)]
[ELF] Ignore the maximum of input section alignments for two cases

Follow-up for D74286.

Notations:

* alignExpr: the computed ALIGN value
* max_input_align: the maximum of input section alignments

This patch changes the following two cases to match GNU ld:

* When ALIGN is present, GNU ld sets output sh_addr to alignExpr, while lld use max(alignExpr, max_input_align)
* When addrExpr is specified but alignExpr is not, GNU ld sets output sh_addr to addrExpr, while lld uses `advance(0, max_input_align)`

Note, sh_addralign is still set to max(alignExpr, max_input_align).

lma-align.test is enhanced a bit to check we don't overalign sh_addr.

fixSectionAlignments() sets addrExpr but not alignExpr for the `!hasSectionsCommand` case.
This patch sets alignExpr as well so that max_input_align will be respected.

Reviewed By: grimar

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

4 years agoAMDGPU/GlobalISel: Precommit xnor matching test
Matt Arsenault [Fri, 21 Feb 2020 16:09:20 +0000 (11:09 -0500)]
AMDGPU/GlobalISel: Precommit xnor matching test

4 years ago[ARM] Correct Formatting. NFC
David Green [Fri, 21 Feb 2020 16:07:09 +0000 (16:07 +0000)]
[ARM] Correct Formatting. NFC

Also removed an unnecessary TODO that I don't believe is relevant for
the instruction in question.

4 years agoAMDGPU/GlobalISel: Manually select G_BUILD_VECTOR_TRUNC
Matt Arsenault [Sat, 15 Feb 2020 22:14:17 +0000 (17:14 -0500)]
AMDGPU/GlobalISel: Manually select G_BUILD_VECTOR_TRUNC

We have patterns for s_pack* selection, but they assume the inputs are
a build_vector with 16-bit inputs, not a truncating build
vector. Since there's still outstanding work for how to handle
mismatched result and source element vector operations, and since I'm
trying a different packed vector strategy than SelectionDAG, just
manually select this for now.

4 years agoAMDGPU/GlobalISel: Legalize G_FPOW
Matt Arsenault [Thu, 20 Feb 2020 23:59:08 +0000 (18:59 -0500)]
AMDGPU/GlobalISel: Legalize G_FPOW

There are few differences from the DAG handling. First, the DAG
handling uses a primitive selection pattern instead of custom
legalizing it. Because of this, this makes use of source modifiers
while the DAG does not.

Also instead of promoting f16, try to use the f16 log/exp. There's no
f16 fmul_legacy, so widen just for the multiply, although I'm not sure
that's the best solution.

4 years agoAMDGPU/GlobalISel: Select llvm.amdgcn.fmul.legacy
Matt Arsenault [Thu, 20 Feb 2020 22:40:43 +0000 (17:40 -0500)]
AMDGPU/GlobalISel: Select llvm.amdgcn.fmul.legacy

4 years agoAMDGPU/GlobalISel: Fix constant bus violation with source modifiers
Matt Arsenault [Thu, 20 Feb 2020 20:34:51 +0000 (15:34 -0500)]
AMDGPU/GlobalISel: Fix constant bus violation with source modifiers

This looked through copies to find the source modifiers, which may
have been SGPR->VGPR copies added to avoid potential constant bus
violations. Re-insert a copy to a VGPR if this happens.

4 years ago[mlir] Silence error: call to constructor of 'llvm::APInt' is ambiguous
Alexandre Ganea [Fri, 21 Feb 2020 15:05:07 +0000 (10:05 -0500)]
[mlir] Silence error: call to constructor of 'llvm::APInt' is ambiguous

I was getting this error when using Clang 9.0.1 for compiling.

F:\llvm-project\mlir\lib\IR\Builders.cpp(119,27): error: call to constructor of 'llvm::APInt' is ambiguous
                          APInt(32, value, /*isSigned=*/false));
                          ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(277,3): note: candidate constructor
  APInt(unsigned numBits, uint64_t val, bool isSigned = false)
  ^
F:\llvm-project\llvm\include\llvm/ADT/APInt.h(304,3): note: candidate constructor
  APInt(unsigned numBits, unsigned numWords, const uint64_t bigVal[]);
  ^
1 error generated.

4 years agoRemove unused functions in llvm-ml
Eric Astor [Thu, 20 Feb 2020 14:43:02 +0000 (09:43 -0500)]
Remove unused functions in llvm-ml

On review, these functions will likely not be needed even in the final MasmParser.

4 years ago[lldb/DWARF] Add support for type units in dwp files
Pavel Labath [Fri, 21 Feb 2020 14:42:07 +0000 (15:42 +0100)]
[lldb/DWARF] Add support for type units in dwp files

all that was needed was to teach lldb's DWARF context about the
debug_tu_index section.

4 years ago[PowerPC][NFC] Add a test for vrsave usage iinline asm.
Sean Fertile [Thu, 20 Feb 2020 14:18:10 +0000 (09:18 -0500)]
[PowerPC][NFC] Add a test for vrsave usage iinline asm.

Add a lit test that that uses vrsave register in the clobber list, and
tests the extended mnemonics mtvrsave and mfvrsave.