platform/upstream/llvm.git
4 years agoRevert a few unsuccessful attempts at fixing bots.
Nico Weber [Mon, 13 Apr 2020 20:53:06 +0000 (16:53 -0400)]
Revert a few unsuccessful attempts at fixing bots.

I broke bots last week and tried a few things to fix them.
These were attempts that didn't help, so back them back out.

This reverts commit c7aff9a109b611e4954a3055061a8076b4baa385.
This reverts commit 8838d6d3566d940859fd26b20aed4cb57d490988.
This reverts commit e875ba1509955dc4b3512d820edecc0da26fa38d.

4 years agoUse a temporary file, to allow running on read-only file systems
Sterling Augustine [Mon, 13 Apr 2020 20:09:22 +0000 (13:09 -0700)]
Use a temporary file, to allow running on read-only file systems

4 years ago[libc++] NFC: Remove unused method call
Louis Dionne [Mon, 13 Apr 2020 20:50:11 +0000 (16:50 -0400)]
[libc++] NFC: Remove unused method call

4 years ago[CallSite removal][TargetLowering] Replace ImmutableCallSite with CallBase
Craig Topper [Mon, 13 Apr 2020 17:44:59 +0000 (10:44 -0700)]
[CallSite removal][TargetLowering] Replace ImmutableCallSite with CallBase

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

4 years agoMake IRBuilder automatically set alignment on load/store/alloca.
Eli Friedman [Sun, 12 Apr 2020 23:58:30 +0000 (16:58 -0700)]
Make IRBuilder automatically set alignment on load/store/alloca.

This is equivalent in terms of LLVM IR semantics, but we want to
transition away from using MaybeAlign to represent the alignment of
these instructions.

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

4 years ago[Darwin] Fix a bug where the symbolizer would examine the wrong process.
Dan Liew [Tue, 7 Apr 2020 01:57:54 +0000 (18:57 -0700)]
[Darwin] Fix a bug where the symbolizer would examine the wrong process.

Summary:
Previously `AtosSymbolizer` would set the PID to examine in the
constructor which is called early on during sanitizer init. This can
lead to incorrect behaviour in the case of a fork() because if the
symbolizer is launched in the child it will be told examine the parent
process rather than the child.

To fix this the PID is determined just before the symbolizer is
launched.

A test case is included that triggers the buggy behaviour that existed
prior to this patch. The test observes the PID that `atos` was called
on. It also examines the symbolized stacktrace. Prior to this patch
`atos` failed to symbolize the stacktrace giving output that looked
like...

```
  #0 0x100fc3bb5 in __sanitizer_print_stack_trace asan_stack.cpp:86
  #1 0x10490dd36 in PrintStack+0x56 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_shared_lib.dylib:x86_64+0xd36)
  #2 0x100f6f986 in main+0x4a6 (/path/to/print-stack-trace-in-code-loaded-after-fork.cpp.tmp_loader:x86_64+0x100001986)
  #3 0x7fff714f1cc8 in start+0x0 (/usr/lib/system/libdyld.dylib:x86_64+0x1acc8)
```

After this patch stackframes `#1` and `#2` are fully symbolized.

This patch is also a pre-requisite refactor for rdar://problem/58789439.

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[Sanitizer Common] Show command used to launch symbolizer process at high verbosity...
Dan Liew [Tue, 7 Apr 2020 00:25:47 +0000 (17:25 -0700)]
[Sanitizer Common] Show command used to launch symbolizer process at high verbosity level.

Summary:
In preparation for writing a test for a bug fix we need to be able to
see the command used to launch the symbolizer process. This feature
will likely be useful for debugging how the Sanitizers use the
symbolizer in general.

This patch causes the command line used to launch the process to be
shown at verbosity level 3 and higher.

A small test case is included.

Reviewers: kubamracek, yln, vitalybuka, eugenis, kcc

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[gn build] Port e823068306e
LLVM GN Syncbot [Mon, 13 Apr 2020 20:31:14 +0000 (20:31 +0000)]
[gn build] Port e823068306e

4 years ago[gn build] Port 255cc202ea6
LLVM GN Syncbot [Mon, 13 Apr 2020 20:31:14 +0000 (20:31 +0000)]
[gn build] Port 255cc202ea6

4 years ago[Support] Add missing files from e823068306e.
Lang Hames [Mon, 13 Apr 2020 20:29:59 +0000 (13:29 -0700)]
[Support] Add missing files from e823068306e.

4 years ago[LLD] [COFF] Fix alignment of thunks for ARM/ARM64
Martin Storsjö [Wed, 8 Apr 2020 21:42:50 +0000 (00:42 +0300)]
[LLD] [COFF] Fix alignment of thunks for ARM/ARM64

The alignment of ARM64 range extension thunks was fixed in
7c816492197a, but ARM range extension thunks, and import
and delay import thunks also need aligning (like all code on ARM
platforms).

I'm adding a test for alignment of ARM64 import thunks - not
specifically adding tests for misalignment of all of them though.

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

4 years ago[mlir][Linalg] NFC: Add utility function to tile, fuse and set marker to use loop...
MaheshRavishankar [Sun, 12 Apr 2020 06:02:09 +0000 (23:02 -0700)]
[mlir][Linalg] NFC: Add utility function to tile, fuse and set marker to use loop.parallel.

This change is NFC since the facility to tile and generate
loop.parallel loops already exists in Linalg.

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

4 years ago[mlir][Linalg] NFC : Fix check for scalar case handling in LinalgToLoops
MaheshRavishankar [Sun, 12 Apr 2020 06:01:40 +0000 (23:01 -0700)]
[mlir][Linalg] NFC : Fix check for scalar case handling in LinalgToLoops

The invertPermutation method does not return a nullptr anymore, but
rather returns an empty map for the scalar case. Update the check in
LinalgToLoops to reflect this.
Also add test case for generating scalar code.

4 years ago[mlir][Linalg] Add loop.parallel lowering for all Linalg Ops.
MaheshRavishankar [Mon, 13 Apr 2020 16:33:34 +0000 (09:33 -0700)]
[mlir][Linalg] Add loop.parallel lowering for all Linalg Ops.

The outer parallel loops of a linalg operation is lowered to
loop.parallel, with the other loops lowered to loop.for. This gets the
lowering to loop.parallel on par with the loop.for lowering. In future
the reduction loop could also be lowered to loop.parallel.
Also add a utility function that returns the loops that are
created.

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

4 years ago[Support] Fix CMakeLists after e823068306e98e9
Sam McCall [Mon, 13 Apr 2020 20:14:27 +0000 (22:14 +0200)]
[Support] Fix CMakeLists after e823068306e98e9

4 years agoFix target_info.test on Windows with a hack
Reid Kleckner [Mon, 13 Apr 2020 20:12:42 +0000 (13:12 -0700)]
Fix target_info.test on Windows with a hack

Add a quote character to the sed command to cause it to be quoted.
Hopefully, which will help both gnuwin and MSys versions of sed tokenize
the command line the same way.

4 years ago[clangd] Rebuild dependent files when a header is saved.
Sam McCall [Fri, 10 Apr 2020 01:27:37 +0000 (03:27 +0200)]
[clangd] Rebuild dependent files when a header is saved.

Summary:
Caveats:
 - only works when the header is changed in the editor and the editor provides
   the notification
 - we revalidate preambles for all open files (stat all their headers) rather
   than taking advantage of the fact that we know which file changed.
   This is much simpler!

Fixes https://github.com/clangd/clangd/issues/107

Reviewers: kadircet

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Mon, 13 Apr 2020 19:30:53 +0000 (12:30 -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: sdesmalen, efriedma, krememek

Reviewed By: sdesmalen, efriedma

Subscribers: dexonsmith, Charusso, cfe-commits

Tags: #clang

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

4 years ago[ORC] Update ORCv2 docs to reflect removal of ExecutionSession::getMainJITDylib.
Lang Hames [Mon, 13 Apr 2020 19:51:46 +0000 (12:51 -0700)]
[ORC] Update ORCv2 docs to reflect removal of ExecutionSession::getMainJITDylib.

Thanks to Dibyendu Majumdar for spotting the issue.

4 years ago[Support] Add support RTTI support for open class hierarchies.
Lang Hames [Sat, 11 Apr 2020 00:23:20 +0000 (17:23 -0700)]
[Support] Add support RTTI support for open class hierarchies.

This patch extracts the RTTI part of llvm::ErrorInfo into its own class
(RTTIExtends) so that it can be used in other non-error hierarchies, and makes
it compatible with the existing LLVM RTTI function templates (isa, cast,
dyn_cast, dyn_cast_or_null) by adding the classof method.

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

4 years ago[mlir][spirv] Add a `spirv::InterfaceVarABIAttr`.
Denis Khalikov [Mon, 13 Apr 2020 18:11:08 +0000 (21:11 +0300)]
[mlir][spirv] Add a `spirv::InterfaceVarABIAttr`.

Summary:
Add a proper dialect-specific attribute for interface variable ABI.

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

4 years ago[mlir][spirv] NFC: use Optional to replace SPV_Optional
Lei Zhang [Mon, 13 Apr 2020 19:33:35 +0000 (15:33 -0400)]
[mlir][spirv] NFC: use Optional to replace SPV_Optional

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

4 years agoRemove the Identifier::is() method, it is now equivalent to operator==. NFC.
Chris Lattner [Mon, 13 Apr 2020 18:51:59 +0000 (11:51 -0700)]
Remove the Identifier::is() method, it is now equivalent to operator==.  NFC.

Summary: Depends on D78042.

Reviewers: rriddle!

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years agoClean up usages of asserting vector getters in Type
Christopher Tetreault [Mon, 13 Apr 2020 17:51:25 +0000 (10:51 -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: rriddle, sdesmalen, efriedma

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoExtend BasicBlock sections to allow specifying clusters of basic blocks in the same...
Rahman Lavaee [Mon, 13 Apr 2020 19:14:42 +0000 (12:14 -0700)]
Extend BasicBlock sections to allow specifying clusters of basic blocks in the same section.

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

4 years agoRevert "Extend BasicBlock sections to allow specifying clusters of basic blocks"
Rahman Lavaee [Mon, 13 Apr 2020 19:12:34 +0000 (12:12 -0700)]
Revert "Extend BasicBlock sections to allow specifying clusters of basic blocks"

This reverts commit 0d4ec16d3db3a92514e14101f635e8536c208c4f Because
tests were not added to the commit.

4 years ago[MachinePipeliner] Refine the RecMII calculation
Lama [Mon, 13 Apr 2020 18:51:03 +0000 (18:51 +0000)]
[MachinePipeliner] Refine the RecMII calculation

In the case of more than one SDep  between two successor SUnits in the Nodeset, the current implementation sums the latencies of the dependencies, which could create a larger RecMII than necessary.

for example, in case there is both a data dependency and an output dependency (with latency > 0) between successor nodes:
SU(1) inst1:
  successors:
    SU(2): out  latency = 1
    SU(2): data latency = 1
SU(2) inst2:
  successors:
    SU(3): out  latency = 1
    SU(3): data latency = 1
SU(3) inst3:
  successors:
    SU(1): out  latency = 1
    SU(1): data latency = 1

the NodeSet latency returned would be 6, whereas it could be 3 if we take the max for each successor SUnit.
In general this can be extended to finding the shortest path in the recurrence..
thoughts?

Unfortunately I had a hard time creating a test for this in Hexagon/PowerPC, so help would be appreciated.

Reviewed By: bcahoon

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

4 years ago[AMDGPU] Fix comment for llvm.amdgcn.div.scale. NFC.
Austin Kerbow [Mon, 13 Apr 2020 18:58:15 +0000 (11:58 -0700)]
[AMDGPU] Fix comment for llvm.amdgcn.div.scale. NFC.

Update comment to reflect actual lowering.

4 years agoEliminate all uses of Identifier::is() in the source tree, this doesn't remove the...
Chris Lattner [Mon, 13 Apr 2020 18:17:35 +0000 (11:17 -0700)]
Eliminate all uses of Identifier::is() in the source tree, this doesn't remove the definition of it (yet).  NFC.

Reviewers: mravishankar, antiagainst, herhut, rriddle!

Subscribers: jholewinski, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, bader, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years agoHIP: Fix handling of denormal mode
Matt Arsenault [Mon, 13 Apr 2020 14:14:07 +0000 (10:14 -0400)]
HIP: Fix handling of denormal mode

I didn't realize HIP was a distinct offloading kind, so the subtarget
was looking for -march, which isn't correct for HIP. We also have the
possibility of different denormal defaults in the case of multiple
offload targets, so we need to thread the JobAction through the target
hook.

4 years agoExtend BasicBlock sections to allow specifying clusters of basic blocks
Rahman Lavaee [Mon, 13 Apr 2020 18:39:23 +0000 (11:39 -0700)]
Extend BasicBlock sections to allow specifying clusters of basic blocks
in the same section.

This allows specifying BasicBlock clusters like the following example:
!foo
!!0 1 2
!!4
This places basic blocks 0, 1, and 2 in one section in this order, and
places basic block #4 in a single section of its own.

4 years ago[InstCombine] Use SmallBitVector for convienently checking if all bits are set
Benjamin Kramer [Mon, 13 Apr 2020 18:36:31 +0000 (20:36 +0200)]
[InstCombine] Use SmallBitVector for convienently checking if all bits are set

4 years ago[MLIR] NFC cleanup/modernize memref-dataflow-opt / getNestingDepth
Uday Bondhugula [Mon, 13 Apr 2020 04:48:10 +0000 (10:18 +0530)]
[MLIR] NFC cleanup/modernize memref-dataflow-opt / getNestingDepth

Bring code to date with recent changes to the core infrastructure /
coding style.

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

4 years ago[MLIR] NFC clean up simplify-affine-structures test case
Uday Bondhugula [Mon, 13 Apr 2020 14:00:35 +0000 (19:30 +0530)]
[MLIR] NFC clean up simplify-affine-structures test case

NFC clean up for simplify-affine-structures test cases. Rename sets
better; avoid suffix numbers;  move outlined definitions close to use.
This is in preparation for other functionality updates.

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

4 years ago[mlir][Transforms][docs] Add a description blurb for various passes
River Riddle [Mon, 13 Apr 2020 18:26:55 +0000 (11:26 -0700)]
[mlir][Transforms][docs] Add a description blurb for various passes

Summary: This revision adds blurbs of documentation to various different passes, namely: Canonicalizer, CSE, LocationSnapshot, StripDebugInfo, and SymbolDCE.

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

4 years agoAdd missing dependencies on the flang test target
Mehdi Amini [Mon, 13 Apr 2020 17:03:12 +0000 (17:03 +0000)]
Add missing dependencies on the flang test target

Without this, the LLVM utilities (FileCheck) aren't built when running
`ninja check-flang` and it fails with:

llvm-project/llvm/utils/lit/lit/llvm/subst.py:134: fatal: Did not find FileCheck in...

Also the modules aren't built without depending on `module_files`, which
makes multiple tests failing.

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

4 years ago[mlir][spirv] Improve stride support in array types
Lei Zhang [Mon, 13 Apr 2020 16:47:58 +0000 (12:47 -0400)]
[mlir][spirv] Improve stride support in array types

This commit added stride support in runtime array types. It also
adjusted the assembly form for the stride from `[N]` to `stride=N`.
This makes the IR more readable, especially for the cases where
one mix array types and struct types.

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

4 years ago[SanCov] Disable whitelist/blacklist test on Darwin.
Matt Morehouse [Mon, 13 Apr 2020 17:58:26 +0000 (10:58 -0700)]
[SanCov] Disable whitelist/blacklist test on Darwin.

4 years ago[gn build] (manually) merge 6dbf1a1229ba
Nico Weber [Mon, 13 Apr 2020 17:57:00 +0000 (13:57 -0400)]
[gn build] (manually) merge 6dbf1a1229ba

4 years ago[InstCombine] Fix debug variance issue in tryToMoveFreeBeforeNullTest
Vedant Kumar [Fri, 10 Apr 2020 23:47:09 +0000 (16:47 -0700)]
[InstCombine] Fix debug variance issue in tryToMoveFreeBeforeNullTest

Fix an issue where the presence of debug info could disable an
optimization in tryToMoveFreeBeforeNullTest.

4 years ago[Debugify] Strip added metadata in the -debugify-each pipeline
Vedant Kumar [Fri, 10 Apr 2020 21:58:13 +0000 (14:58 -0700)]
[Debugify] Strip added metadata in the -debugify-each pipeline

Summary:
Share logic to strip debugify metadata between the IR and MIR level
debugify passes. This makes it simpler to hunt for bugs by diffing IR
with vs. without -debugify-each turned on.

As a drive-by, fix an issue causing CallGraphNodes to become invalid
when a dead llvm.dbg.value prototype is deleted.

Reviewers: dsanders, aprantl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[llvm-xray][test] Combine two AArch64 tests
Fangrui Song [Fri, 10 Apr 2020 16:41:41 +0000 (09:41 -0700)]
[llvm-xray][test] Combine two AArch64 tests

Rename extract-instrmap-aarch64.test to extract-instrmap.test because
the path component `AArch64` conveys the target name clearly.

Additionally, adopt a convention we start to use in LLVM binary
utilities: prepend `#` to CHECK/RUN lines and `##` to comment lines even
if the file contains no code. The notation makes CHECK/RUN/comments
stand out.

Reviewed By: dberris

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

4 years agoReimplement mlir::Identifier to be a wrapper around 'StringMapEntry*' instead of...
Chris Lattner [Mon, 13 Apr 2020 05:15:26 +0000 (22:15 -0700)]
Reimplement mlir::Identifier to be a wrapper around 'StringMapEntry*' instead of a wrapper around a 'const char*'.  This makes it so strref() can be computed without calling strlen, which is more efficient and less error-prone.  While here...

Summary:
..., reimplement DenseMapInfo<mlir::Identifier>::getHashValue in terms of mlir::hash_value(Identifier).

Both of these improvements were suggested by River, thanks!

Reviewers: rriddle!

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years ago[clangd] Send the correct error code when cancelling requests.
Sam McCall [Sat, 11 Apr 2020 16:19:50 +0000 (18:19 +0200)]
[clangd] Send the correct error code when cancelling requests.

Summary:
I couldn't quite bring myself to make Cancellation depend on LSP ErrorCode.
Magic numbers instead...

Reviewers: kadircet

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, jfb, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[CostModel][X86] Remove comments that begin with a filecheck prefix.
Simon Pilgrim [Mon, 13 Apr 2020 17:39:07 +0000 (18:39 +0100)]
[CostModel][X86] Remove comments that begin with a filecheck prefix.

Stop filecheck from confusing a general comment with a check.

4 years ago[mlir][spirv] Add missing interface storage classes in serializer
Lei Zhang [Mon, 13 Apr 2020 17:14:07 +0000 (13:14 -0400)]
[mlir][spirv] Add missing interface storage classes in serializer

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

4 years ago[ADT] Reduce the requirements for the simple loop in DenseMap::clear
Benjamin Kramer [Mon, 13 Apr 2020 17:28:20 +0000 (19:28 +0200)]
[ADT] Reduce the requirements for the simple loop in DenseMap::clear

We can use it when just the value doesn't require destruction. Empty
keys are safe to overwrite always. This gets the important case of
std::pair values.

4 years ago[OpenMP] Refined CUDA plugin to put all CUDA operations into class
Shilei Tian [Mon, 13 Apr 2020 17:32:21 +0000 (13:32 -0400)]
[OpenMP] Refined CUDA plugin to put all CUDA operations into class

Summary: Current implementation mixed everything up so that there is almost no encapsulation. In this patch, all CUDA related operations are put into a new class DeviceRTLTy and only necessary functions are exposed. In addition, all C++ code now conforms with LLVM code standard, keeping those API functions following C style.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: jfb, yaxunl, guansong, openmp-commits

Tags: #openmp

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

4 years ago[CallSite removal][GlobalISel] Use CallBase instead of CallSite in lowerCall and...
Craig Topper [Mon, 13 Apr 2020 17:17:29 +0000 (10:17 -0700)]
[CallSite removal][GlobalISel] Use CallBase instead of CallSite in lowerCall and translateCallBase.

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

4 years agoDAG: Fix wrong legality check for ISD::FMAD
Matt Arsenault [Sun, 12 Apr 2020 13:47:03 +0000 (09:47 -0400)]
DAG: Fix wrong legality check for ISD::FMAD

Since 1725f2884175ca618d29b06e35f5c6ebd618053d, this should check
isFMADLegalForFAddFSub rather than the the plain isOperationLegal.

This would assert in a subset of cases due to an oddity in how FMAD is
selected. We will allow FMA formation pre-legalize, but not FMAD even
in cases where it would be valid.

The current hook requires passing in the root fadd/fsub. However, in
this distributed case, this would be far more complicated to pass in
the relevant operand. AMDGPU doesn't get any value from the node, and
only needs the type and is the only implementor, so I'm not sure why
we have this complexity. Just rename and expand the assert to avoid
the more complicated checks spread through the distribution logic.

4 years ago[X86] Move X86ShuffleDecode.cpp/h into MCTargetDesc and remove X86Utils library. NFC
Craig Topper [Mon, 13 Apr 2020 16:33:05 +0000 (09:33 -0700)]
[X86] Move X86ShuffleDecode.cpp/h into MCTargetDesc and remove X86Utils library. NFC

The shuffle decoding is used by X86ISelLowering and
MCTargetDesc/X86InstComments. The latter used to be in a
separate InstPrinter library. The Utils library existed to allow
InstPrinter and CodeGen to share the shuffle decoding. Since
X86InstComments now lives in the MCTargetDesc, which CodeGen
already depends on, we can sink the shuffle decoding there as well.

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

4 years ago[llvm] Fix yet more missing FileCheck colons
Jon Roelofs [Mon, 13 Apr 2020 16:21:01 +0000 (10:21 -0600)]
[llvm] Fix yet more missing FileCheck colons

4 years ago[llvm] Fix another missing FileCheck colon
Jon Roelofs [Mon, 13 Apr 2020 16:19:57 +0000 (10:19 -0600)]
[llvm] Fix another missing FileCheck colon

4 years ago[llvm] Fix more missing FileCheck directive colons
Jonathan Roelofs [Thu, 2 Apr 2020 22:28:32 +0000 (16:28 -0600)]
[llvm] Fix more missing FileCheck directive colons

4 years ago[lit] Print substitutions with --show-suites
Louis Dionne [Thu, 9 Apr 2020 18:34:58 +0000 (14:34 -0400)]
[lit] Print substitutions with --show-suites

We already print available features, and it can be useful to print
substitutions as well since those are a pretty fundamental part of
a test suite. We could also consider printing other things like the
test environment, however the need doesn't appear to be as strong.

As a fly-by fix, we also always print available features, even when
there are none.

Before:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features : -faligned-allocation -fsized-deallocation [...]

After:

  $ lit -sv libcxx/test --show-suites
  -- Test Suites --
    libc++ - 6350 tests
      Source Root: [...]
      Exec Root  : [...]
      Available Features: -faligned-allocation -fsized-deallocation [...]
      Available Substitutions: %{build_module} => [...]
                               %{build} => %{cxx} -o [...]

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

4 years agoFix an indent.
Nico Weber [Mon, 13 Apr 2020 15:53:23 +0000 (11:53 -0400)]
Fix an indent.

4 years ago[llvm-objdump] Fix incomplete relocation output for -D -r mode
jasonliu [Mon, 13 Apr 2020 15:49:36 +0000 (15:49 +0000)]
[llvm-objdump] Fix incomplete relocation output for -D -r mode

This patch intends to fix incomplete relocation printing for
XCOFF (potentially for other targets).

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

4 years ago[X86] Improve combineVectorShiftImm
Jay Foad [Thu, 2 Apr 2020 11:20:35 +0000 (12:20 +0100)]
[X86] Improve combineVectorShiftImm

Summary:
Fold (shift (shift X, C2), C1) -> (shift X, (C1 + C2)) for logical as
well as arithmetic shifts. This is needed to prevent regressions from
an upcoming funnel shift expansion change.

While we're here, fold (VSRAI -1, C) -> -1 too.

Reviewers: RKSimon, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clang-format] use spaces for alignment with UT_ForContinuationAndIndentation
mydeveloperday [Mon, 13 Apr 2020 14:14:26 +0000 (15:14 +0100)]
[clang-format] use spaces for alignment with UT_ForContinuationAndIndentation

Summary:
Use spaces instead of tabs for alignment with UT_ForContinuationAndIndentation to make the code aligned for any tab/indent width.

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

Reviewed By: MyDeveloperDay

Patch By: fickert

Tags: #clang-format

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

4 years ago[clang-format] A Minor change to clang-format-diff.py
mydeveloperday [Mon, 13 Apr 2020 14:08:07 +0000 (15:08 +0100)]
[clang-format] A Minor change to clang-format-diff.py

Summary: Testing for None should use the 'is' operator.

Reviewed By: MyDeveloperDay

Patch By:  eagleoflqj

Tags: #clang-format

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

4 years ago[clang-format] Always break line after enum opening brace
mydeveloperday [Mon, 13 Apr 2020 14:03:36 +0000 (15:03 +0100)]
[clang-format] Always break line after enum opening brace

Summary:
clang-format currently puts the first enumerator on the same line as the
enum keyword and opening brace if it fits (for example, for anonymous
enums if IndentWidth is 8):

  $ echo "enum { RED, GREEN, BLUE };" | clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
  enum { RED,
         GREEN,
         BLUE };

This doesn't seem to be intentional, as I can't find any style guide that
suggests wrapping enums this way. Always force the enumerator to be on a new
line, which gets us the desired result:

  $ echo "enum { RED, GREEN, BLUE };" | ./bin/clang-format -style="{BasedOnStyle: llvm, ColumnLimit: 15, IndentWidth: 8}"
  enum {
          RED,
          GREEN,
          BLUE
  };

Test Plan:

New test added. Confirmed test failed without change and passed with change by
running:

  $ ninja FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewed By: MyDeveloperDay

Patch By: osandov

Tags: #clang-format, #clang

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

4 years ago[X86][AVX] Attempt to scale masked shuffles to match the root type
Simon Pilgrim [Mon, 13 Apr 2020 13:57:25 +0000 (14:57 +0100)]
[X86][AVX] Attempt to scale masked shuffles to match the root type

Improve the chances of folding the writemask into the combined shuffle by scaling a wider shuffle mask to match the root's original type.

This creates a few minor issues with variable shuffles, preventing combines of shuffles because of the more limited support binary shuffle types. In most cases we're probably better off combining the shuffles and losing the writemask fold, but this isn't always going to be true.

4 years ago[X86][AVX] Add some masked variable shuffle tests
Simon Pilgrim [Mon, 13 Apr 2020 13:29:57 +0000 (14:29 +0100)]
[X86][AVX] Add some masked variable shuffle tests

Now that's D77928 landed we need to try harder to match shuffle and mask widths. This is a couple of tests showing where variable shuffle masks have been widened preventing them from folding with the mask.

4 years agoAddress sphinx warnings
Benjamin Kramer [Mon, 13 Apr 2020 12:39:25 +0000 (14:39 +0200)]
Address sphinx warnings

LanguageExtensions.rst:2191: WARNING: Title underline too short.
llvm-symbolizer.rst:157: Error in "code-block" directive: maximum 1 argument(s) allowed, 30 supplied.

4 years agoCodeMetrics.h - include and forward declaration cleanup. NFC.
Simon Pilgrim [Mon, 13 Apr 2020 12:09:08 +0000 (13:09 +0100)]
CodeMetrics.h - include and forward declaration cleanup. NFC.

Remove SmallPtrSet include, replace with forward declaration and include SmallPtrSet.h in CodeMetrics.cpp directly.
Remove unused llvm::DataLayout/Instruction forward declarations.

4 years agoIVDescriptors.h - include and forward declaration cleanup. NFC.
Simon Pilgrim [Mon, 13 Apr 2020 11:01:14 +0000 (12:01 +0100)]
IVDescriptors.h - include and forward declaration cleanup. NFC.

Replace unused AliasAnalysis.h and EHPersonalities.h includes
Remove unused llvm::AliasSet/AliasSetTracker/BasicBlock/DataLayout/LoopInfo/OptimizationRemarkEmitter/PredIteratorCache/TargetLibraryInfo/TargetTransformInfo forward declarations.

4 years ago[X86][AVX] Create splitVectorIntBinary helper.
Simon Pilgrim [Sun, 12 Apr 2020 15:15:26 +0000 (16:15 +0100)]
[X86][AVX] Create splitVectorIntBinary helper.

Removes duplicate code from split256IntArith/split512IntArith.

4 years agoTypos correction.
SCOTT-HAMILTON [Mon, 13 Apr 2020 06:39:58 +0000 (08:39 +0200)]
Typos correction.

4 years agoNormalize working directory when running llvm-mc in test
serge-sans-paille [Mon, 13 Apr 2020 11:44:15 +0000 (13:44 +0200)]
Normalize working directory when running llvm-mc in test

Otherwise, depending on the lit location used to run the test, llvm-mc adds an
include_directories entry in the dwarf output, which breaks tests in some setup.

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

4 years agofix some doc typos to cycle bots
Nico Weber [Mon, 13 Apr 2020 10:28:33 +0000 (06:28 -0400)]
fix some doc typos to cycle bots

4 years ago[clangd] Update TUStatus test to handle async PreambleThread
Kadir Cetinkaya [Tue, 7 Apr 2020 18:53:56 +0000 (20:53 +0200)]
[clangd] Update TUStatus test to handle async PreambleThread

Summary:
Currently it doesn't matter because we run PreambleThread in sync mode.
Once we start running it in async, test order will become non-deterministic.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[LV] Clean up vectorizeInterleaveGroup (NFCI)
Gil Rapaport [Mon, 13 Apr 2020 05:53:42 +0000 (08:53 +0300)]
[LV] Clean up vectorizeInterleaveGroup (NFCI)

Pass from the calling recipe the interleave group itself instead of passing the
group's insertion position and having the function query CM for its interleave
group and making sure that given instruction is the insertion point of.

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

4 years ago[AssumeBundles] adapt Assumption cache to assume bundles
Tyker [Mon, 13 Apr 2020 09:27:27 +0000 (11:27 +0200)]
[AssumeBundles] adapt Assumption cache to assume bundles

Summary: change assumption cache to store an assume along with an index to the operand bundle containing the knowledge.

Reviewers: jdoerfert, hfinkel

Reviewed By: jdoerfert

Subscribers: hiraditya, mgrang, llvm-commits

Tags: #llvm

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

4 years ago[LLDB] Remove xfail aarch64/linux from TestThreadPlanCommands.py
Muhammad Omair Javaid [Mon, 13 Apr 2020 09:30:23 +0000 (14:30 +0500)]
[LLDB] Remove xfail aarch64/linux from TestThreadPlanCommands.py

4 years agoRevert "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef."
Benjamin Kramer [Mon, 13 Apr 2020 09:23:26 +0000 (11:23 +0200)]
Revert "[SCCP] Use SimplifyBinOp for non-integer constant/expressions & overdef."

This reverts commit 1a02aaeaa4f8675490da38ee8cb0d4a6d39815dd. Crashes on
the following test case:

$ cat crash.ll
source_filename = "__compute_module"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"

@0 = private unnamed_addr constant [24 x i8] c"\00\00\C0\7F\00\00\C0\7F\09\85\08?\ED\C94\FE~\EB/\F3\90\CF\BA\C1"
@1 = private unnamed_addr constant [24 x i8] c"\00\00\C0\7F\A3\A0\0FA\00\00\C0\7F\00\00\C0\7F\00\00\00\00\02\9AA\00"

define void @IgammaSpecialValues.448() {
entry:
  br label %fusion.26.loop_header.dim.0

fusion.26.loop_header.dim.0:                      ; preds = %fusion.26.loop_header.dim.0, %entry
  %fusion.26.invar_address.dim.0.0 = phi i64 [ 0, %entry ], [ %invar.inc17, %fusion.26.loop_header.dim.0 ]
  %0 = getelementptr inbounds [6 x float], [6 x float]* bitcast ([24 x i8]* @0 to [6 x float]*), i64 0, i64 %fusion.26.invar_address.dim.0.0
  %1 = load float, float* %0
  %2 = fmul float %1, 0.000000e+00
  %3 = getelementptr inbounds [6 x float], [6 x float]* bitcast ([24 x i8]* @1 to [6 x float]*), i64 0, i64 %fusion.26.invar_address.dim.0.0
  %4 = load float, float* %3
  %5 = fneg float %4
  %6 = fadd float %2, %5
  %invar.inc17 = add nuw nsw i64 %fusion.26.invar_address.dim.0.0, 1
  br label %fusion.26.loop_header.dim.0
}

$ opt -ipsccp -S < crash.ll
opt: llvm/include/llvm/Analysis/ValueLattice.h:251: bool llvm::ValueLatticeElement::markConstant(llvm::Constant *, bool): Assertion `getConstant() == V && "Marking constant with different value"' failed.

4 years ago[mlir][NFC] Mark a debug only variable as (void) to avoid unused warning
River Riddle [Mon, 13 Apr 2020 07:48:17 +0000 (00:48 -0700)]
[mlir][NFC] Mark a debug only variable as (void) to avoid unused warning

4 years ago[VPlan] Introduce VPWidenSelectRecipe (NFC).
Florian Hahn [Mon, 13 Apr 2020 07:28:26 +0000 (08:28 +0100)]
[VPlan] Introduce VPWidenSelectRecipe (NFC).

Widening a selects depends on whether the condition is loop invariant or
not. Rather than checking during codegen-time, the information can be
recorded at the VPlan construction time.

This was suggested as part of D76992, to reduce the reliance on
accessing the original underlying IR values.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: gilr

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

4 years ago[mlir][SymbolDCE][NFC] Fix the visibility of the symbols within the test and
River Riddle [Mon, 13 Apr 2020 07:19:14 +0000 (00:19 -0700)]
[mlir][SymbolDCE][NFC] Fix the visibility of the symbols within the test and
move it to test/Transforms/

4 years ago[CallSite removal][CodeGen] Use CallBase instead of CallSite in getNoopInput in Analy...
Craig Topper [Mon, 13 Apr 2020 06:47:17 +0000 (23:47 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of CallSite in getNoopInput in Analysis.cpp. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in TargetFrameL...
Craig Topper [Mon, 13 Apr 2020 06:43:06 +0000 (23:43 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in TargetFrameLoweringInfo. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in IntrinsicLow...
Craig Topper [Mon, 13 Apr 2020 06:34:57 +0000 (23:34 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in IntrinsicLowering. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare...
Craig Topper [Mon, 13 Apr 2020 06:12:41 +0000 (23:12 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in WinEHPrepare. NFC

4 years ago[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in SwiftErrorVa...
Craig Topper [Mon, 13 Apr 2020 06:09:35 +0000 (23:09 -0700)]
[CallSite removal][CodeGen] Use CallBase instead of ImmutableCallSite in SwiftErrorValueTracking. NFC

4 years ago[MC] Reorganize and improve macro tests
Fangrui Song [Mon, 13 Apr 2020 05:02:55 +0000 (22:02 -0700)]
[MC] Reorganize and improve macro tests

* Reorganize tests and add coverage
* Improve diagnostic testing
* Make assert() tests more relevant
* Rename tests to macro-* or altmacro-*

This is not NFC because a (previously untested) diagnostic message is changed.

4 years agoRemove dependency between test files.
Alexander Kornienko [Mon, 13 Apr 2020 04:16:46 +0000 (06:16 +0200)]
Remove dependency between test files.

There seems to be no good reason for rocm-device-libs.cl to depend on opencl.cl.
Removed this dependency to unbreak the tests in our setup.

4 years ago[AMDGPU] Don't assert on partial exec copy
Austin Kerbow [Mon, 13 Apr 2020 01:44:45 +0000 (18:44 -0700)]
[AMDGPU] Don't assert on partial exec copy

After Machine CSE and coalescing we can end up with copies of exec to
subregister SGPRs.

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

4 years ago[NFC][PowerPC] Add a new test case early-ret-verify.mir
Kang Zhang [Mon, 13 Apr 2020 03:48:35 +0000 (03:48 +0000)]
[NFC][PowerPC] Add a new test case early-ret-verify.mir

4 years ago[mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen
River Riddle [Mon, 13 Apr 2020 02:03:33 +0000 (19:03 -0700)]
[mlir][EnumGen] Generate utility symbolizeEnum and stringifyEnum methods during EnumGen

Summary:
This revision adds generation of two utility methods during EnumGen:
```
llvm::Optional<EnumType> symbolizeEnum<EnumType>(llvm::StringRef)
<stringifyResult> stringifyEnum(EnumType);
```

This provides a generic interface for stringifying/symbolizing any enum that can be used in a template environment.

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

4 years ago[CallSite removal][FastISel] Use CallBase instead of CallSite in fastLowerCall.
Craig Topper [Sun, 12 Apr 2020 23:47:06 +0000 (16:47 -0700)]
[CallSite removal][FastISel] Use CallBase instead of CallSite in fastLowerCall.

4 years agoclang format one more line.
Chris Lattner [Sun, 12 Apr 2020 23:36:56 +0000 (16:36 -0700)]
clang format one more line.

4 years agoNFC: Clean up the implementation of StringPool a bit, and remove dependence on some...
Chris Lattner [Sun, 12 Apr 2020 17:44:03 +0000 (10:44 -0700)]
NFC: Clean up the implementation of StringPool a bit, and remove dependence on some "implicitly MallocAllocator" based methods on StringMapEntry. This allows reducing the #includes in StringMapEntry.h.

Summary:
StringPool has many caveats and isn't used in the monorepo.  I will
propose removing it as a patch separate from this refactoring patch.

Reviewers: rriddle

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[GlobalOpt] Explicitly set alignment of bool load/store operations.
Eli Friedman [Sun, 12 Apr 2020 23:01:28 +0000 (16:01 -0700)]
[GlobalOpt] Explicitly set alignment of bool load/store operations.

4 years ago[NFC] Use VectorType::isScalable to align with ongoing VectorType refactor.
Huihui Zhang [Sun, 12 Apr 2020 22:05:37 +0000 (15:05 -0700)]
[NFC] Use VectorType::isScalable to align with ongoing VectorType refactor.

4 years ago[MC][test] Reorganize macro tests
Fangrui Song [Sun, 12 Apr 2020 15:14:37 +0000 (08:14 -0700)]
[MC][test] Reorganize macro tests

* Add locations
* Use FileCheck --match-full-lines --strict-whitespace
* Use CHECK-NEXT:
* Merge related tests
* Delete redundant tests
* Improve test coverage

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

4 years ago[clang-tidy] Convert config options that are bools to use the bool overload of get...
Nathan James [Thu, 9 Apr 2020 21:47:09 +0000 (22:47 +0100)]
[clang-tidy] Convert config options that are bools to use the bool overload of get(GlobalOrLocal)?

Summary: This was done with a script that looks for calls to Options.get(GlobalOrLocal) that take an integer for the second argument and the result is either compared not equal to 0 or implicitly converted to bool. There may be other occurances

Reviewers: aaron.ballman, alexfh, gribozavr2

Reviewed By: aaron.ballman

Subscribers: wuzish, nemanjai, xazax.hun, kbarton, cfe-commits

Tags: #clang

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

4 years ago[NFC] Silence compiler warning [-Wmissing-braces].
Huihui Zhang [Sun, 12 Apr 2020 21:41:03 +0000 (14:41 -0700)]
[NFC] Silence compiler warning [-Wmissing-braces].

llvm/include/llvm/Support/FormatVariadic.h:146:15: warning: suggest braces around initialization of subobject [-Wmissing-braces]
      return {&Items...};
              ^~~~~~
              {     }

4 years ago[X86] Print k-mask in FMA3 comments.
Craig Topper [Sun, 12 Apr 2020 20:16:53 +0000 (13:16 -0700)]
[X86] Print k-mask in FMA3 comments.

4 years ago[CallSite removal][TargetLowering] Use CallBase instead of CallSite in TargetLowering...
Craig Topper [Sun, 12 Apr 2020 04:45:09 +0000 (21:45 -0700)]
[CallSite removal][TargetLowering] Use CallBase instead of CallSite in TargetLowering::ParseConstraints interface.

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

4 years agoreland: [DAG] Fix PR45049: LegalizeTypes crash
Jonathan Roelofs [Sat, 28 Mar 2020 18:55:51 +0000 (12:55 -0600)]
reland: [DAG] Fix PR45049: LegalizeTypes crash

Sometimes LegalizeTypes knows about common subexpressions before SelectionDAG
does, leading to accidental SDValue removal before its reference count was
truly zero.

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

Reviewed-By: bjope
Fixes: https://bugs.llvm.org/show_bug.cgi?id=45049

Reverted in 3ce77142a6452d76d6f97c9a6c2da193e78841ba because the previous patch
broke the expensive-checks bots. The new patch removes the broken check.

4 years ago[llvm][NFC] Refactor uses of CallSite to CallBase - call promotion
Mircea Trofin [Sun, 12 Apr 2020 01:07:50 +0000 (18:07 -0700)]
[llvm][NFC] Refactor uses of CallSite to CallBase - call promotion

Summary:
Updated CallPromotionUtils and impacted sites. Parameters that are
expected to be non-null, and return values that are guranteed non-null,
were replaced with CallBase references rather than pointers.

Left FIXME in places where more changes are facilitated by CallBase, but
aren't CallSites: Instruction* parameters or return values, for example,
where the contract that they are actually CallBase values.

Reviewers: davidxl, dblaikie, wmi

Reviewed By: dblaikie

Subscribers: arsenm, jvesely, nhaehnle, eraman, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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