platform/upstream/llvm.git
4 years agoLangOptions cannot depend on ASTContext, make it not use ASTContext directly
Benjamin Kramer [Thu, 16 Apr 2020 09:45:02 +0000 (11:45 +0200)]
LangOptions cannot depend on ASTContext, make it not use ASTContext directly

Fixes a layering violation introduced in 2ba4e3a4598b165245c581c506a813cd4a7dce33.

4 years ago[LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg
Jeremy Morse [Thu, 16 Apr 2020 09:24:47 +0000 (10:24 +0100)]
[LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg

In D68209, LiveDebugValues::transferDebugValue had a call to
OpenRanges.erase shifted, and by accident this led to a code path where
DBG_VALUEs of $noreg would not have their open range terminated, allowing
variable locations to extend past blocks where they were terminated.

This patch correctly terminates the open range, if present, when such a
DBG_VAUE is encountered, and adds a test for this behaviour.

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

4 years agoAlso look for devtoolset-9 gcc toolchain
Stephan Dollberg [Thu, 16 Apr 2020 09:17:10 +0000 (11:17 +0200)]
Also look for devtoolset-9 gcc toolchain

devtoolset-9 has been out for a while so also look for it.

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

4 years ago[MLIR] Fix fusion of linalg.indexed_generic producer into tiled (Indexed)GenericOp.
Alexander Belyaev [Thu, 16 Apr 2020 08:39:42 +0000 (10:39 +0200)]
[MLIR] Fix fusion of linalg.indexed_generic producer into tiled (Indexed)GenericOp.

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

4 years ago[MLIR] NFC after commit D77478.
Lorenzo Chelini [Thu, 16 Apr 2020 08:30:11 +0000 (10:30 +0200)]
[MLIR] NFC after commit D77478.

Remove leftovers 'applyPatternsGreedily' from the codebase.

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

4 years ago[MLIR] Add IndexAttr to primitive attributes kinds in tablegen.
Ulysse Beaugnon [Thu, 16 Apr 2020 08:28:02 +0000 (10:28 +0200)]
[MLIR] Add IndexAttr to primitive attributes kinds in tablegen.

Summary:
OpBase.td defined attributes kind for all integer types expect index. This
commit fixes that by adding an IndexAttr attribute kind.

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

4 years ago[MLIR] [EDSC] Add folded_xxxx handles for common std instructions.
Pierre Oechsel [Thu, 16 Apr 2020 08:24:48 +0000 (10:24 +0200)]
[MLIR] [EDSC] Add folded_xxxx handles for common std instructions.

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

4 years ago[Attributor][NFC] Reduce indention for call site attribute seeding
Johannes Doerfert [Wed, 15 Apr 2020 16:59:50 +0000 (11:59 -0500)]
[Attributor][NFC] Reduce indention for call site attribute seeding

Also added a TODO to remind us that indirect calls could be optimized as
well.

4 years ago[Attributor][NFC] Do not create temporary maps during lookup
Johannes Doerfert [Wed, 15 Apr 2020 07:14:56 +0000 (02:14 -0500)]
[Attributor][NFC] Do not create temporary maps during lookup

The AAMap.lookup() call created a temporary value if the key was not
present. Since the value was another map it was not free to create it.
Instead of a lookup we now use find and compare the result against the
end iterator explicitly. The result is the same but we never need to
create a temporary map.

4 years agoRevert "Revert "[GlobalISel] Fix invalid combine of unmerge(merge) with intermediate...
Dominik Montada [Thu, 16 Apr 2020 07:02:46 +0000 (09:02 +0200)]
Revert "Revert "[GlobalISel] Fix invalid combine of unmerge(merge) with intermediate cast""

This reverts commit 1265899c5f7d34034a8c1f67e69a5ab6087310e7.

4 years ago[CallSite removal][TargetLowering] Remove ArgListEntry::setAttributes signature that...
Craig Topper [Thu, 16 Apr 2020 06:28:03 +0000 (23:28 -0700)]
[CallSite removal][TargetLowering] Remove ArgListEntry::setAttributes signature that took an ImmutableCallSite. NFC

There's another signature that takes a CallBase. The uses of the
ImmutableCallSite version were removed in previous patches.

4 years ago[LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef
Matthias Gehre [Mon, 19 Aug 2019 21:28:04 +0000 (23:28 +0200)]
[LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef

Summary:
This detected the bugs fixed in
  https://reviews.llvm.org/D66442
and
  https://reviews.llvm.org/D66440

The warning itself was implemented in
  https://reviews.llvm.org/D63954
  https://reviews.llvm.org/D64256
  https://reviews.llvm.org/D65120
  https://reviews.llvm.org/D65127
  https://reviews.llvm.org/D66152

Reviewers: zturner, mehdi_amini, gribozavr

Subscribers: dexonsmith, Szelethus, xazax.hun, llvm-commits

Tags: #llvm

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

4 years ago[Attributor][FIX] Handle droppable uses when replacing values
Johannes Doerfert [Sat, 11 Apr 2020 04:41:59 +0000 (23:41 -0500)]
[Attributor][FIX] Handle droppable uses when replacing values

Since we use the fact that some uses are droppable in the Attributor we
need to handle them explicitly when we replace uses. As an example, an
assumed dead value can have live droppable users. In those we cannot
replace the value simply by an undef. Instead, we either drop the uses
(via `dropDroppableUses`) or keep them as they are. In this patch we do
both, depending on the situation. For values that are dead but not
necessarily removed we keep droppable uses around because they contain
information we might be able to use later. For values that are removed
we drop droppable uses explicitly to avoid replacement with undef.

4 years ago[InstCombine] Simplify calls with casted `returned` attribute
Johannes Doerfert [Sun, 12 Apr 2020 17:41:56 +0000 (12:41 -0500)]
[InstCombine] Simplify calls with casted `returned` attribute

The handling of the `returned` attribute in D75815 did miss the case
where the argument is (bit)casted to a different type. This is
explicitly allowed by the language reference and exposed by the
Attributor.

Reviewed By: lebedev.ri

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

4 years ago[MustExecute][NFC] Copy function_ref instead of passing a reference
Johannes Doerfert [Sat, 11 Apr 2020 17:36:24 +0000 (12:36 -0500)]
[MustExecute][NFC] Copy function_ref instead of passing a reference

4 years ago[Attributor][FIX] Properly check for accesses to globals
Johannes Doerfert [Tue, 14 Apr 2020 23:49:59 +0000 (18:49 -0500)]
[Attributor][FIX] Properly check for accesses to globals

The check if globals were accessed was not always working because two
bits are set for NO_GLOBAL_MEM. The new check works also if only on kind
of globals (internal/external) is accessed.

4 years ago[Attributor][NFC] Run the verifier only on functions and under EXPENSIVE_CHECKS
Johannes Doerfert [Mon, 13 Apr 2020 17:24:09 +0000 (12:24 -0500)]
[Attributor][NFC] Run the verifier only on functions and under EXPENSIVE_CHECKS

Running the verifier is expensive so we want to avoid it even in runs
that enable assertions. As we move closer to enabling the Attributor
this code will be executed by some buildbots but not cause overhead for
most people.

4 years ago[CallSite removal][TargetLibraryInfo] Replace ImmutableCallSite with CallBase in...
Craig Topper [Thu, 16 Apr 2020 05:02:35 +0000 (22:02 -0700)]
[CallSite removal][TargetLibraryInfo] Replace ImmutableCallSite with CallBase in one of the getLibFunc signatures. NFC

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

4 years ago[llvm][NFC][CallSite] Removed CallSite from some implementation details.
Mircea Trofin [Wed, 15 Apr 2020 23:50:57 +0000 (16:50 -0700)]
[llvm][NFC][CallSite] Removed CallSite from some implementation details.

Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add interface X86II::isPseudo
Shengchen Kan [Thu, 16 Apr 2020 04:37:24 +0000 (12:37 +0800)]
[X86] Add interface X86II::isPseudo

Avoid duplicate code in X86MCCodeEmitter, NFCI.

4 years ago[MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS...
Fangrui Song [Tue, 14 Apr 2020 18:05:21 +0000 (11:05 -0700)]
[MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections

For `.bss; nop`, MC inappropriately calls abort() (via report_fatal_error()) with a message
`cannot have fixups in virtual section!`
It is a bug to crash for invalid user input. Fix it by erroring out early in EmitInstToData().

Similarly, emitIntValue() in a virtual section (SHT_NOBITS in ELF) can crash with the mssage
`non-zero initializer found in section '.bss'` (see D4199)
It'd be nice to report the location but so many directives can call emitIntValue()
and it is difficult to track every location.
Note, COFF does not crash because MCAssembler::writeSectionData() is not
called for an IMAGE_SCN_CNT_UNINITIALIZED_DATA section.

Note, GNU as' arm64 backend reports ``Error: attempt to store non-zero value in section `.bss'``
for a non-zero .inst but fails to do so for other instructions.
We simply reject all instructions, even if the encoding is all zeros.

The Mach-O counterpart is D48517 (see `test/MC/MachO/zerofill-text.s`)

Reviewed By: rnk, skan

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

4 years agoFix build by adding missing CMake link dependency
Mehdi Amini [Thu, 16 Apr 2020 03:47:02 +0000 (03:47 +0000)]
Fix build by adding missing CMake link dependency

This would only fail when using a linker that is sensitive to the order
in which the libraries are passed on the command line (like bfd).

4 years ago[X86][MC][NFC] Code cleanup in X86MCCodeEmitter
Shengchen Kan [Thu, 16 Apr 2020 03:24:35 +0000 (11:24 +0800)]
[X86][MC][NFC] Code cleanup in X86MCCodeEmitter

Make some function static, move the definitions of functions to a better
place and use C++ style cast, etc.

4 years ago[Attributor] Lazily collect function information
Johannes Doerfert [Sat, 11 Apr 2020 17:37:09 +0000 (12:37 -0500)]
[Attributor] Lazily collect function information

Before, we eagerly analyzed all the functions to collect information
about them, e.g. what instructions may read/write memory. This had
multiple drawbacks:
  - In CGSCC-mode we can end up looking at a callee which is not in the
    SCC but for which we need an initialized cache.
  - We end up looking at functions that we deem dead and never need to
    analyze in the first place.
  - We have a implicit dependence which is easy to break.

This patch moves the function analysis into the information cache and
makes it lazy. There is no real functional change expected except due to
the first reason above.

4 years ago[Attributor] Replace call graph call sites after function replacement
Johannes Doerfert [Thu, 16 Apr 2020 03:21:17 +0000 (22:21 -0500)]
[Attributor] Replace call graph call sites after function replacement

The CallGraphUpdater allows to directly alter call site information and
we should do so. This might appease the windows buildbot that crashes
during the SCC traversal.

4 years ago[X86][MC][NFC] Refine code in X86MCCodeEmitter
Shengchen Kan [Thu, 16 Apr 2020 02:36:31 +0000 (10:36 +0800)]
[X86][MC][NFC] Refine code in X86MCCodeEmitter

As we mentioned in D78180, merge some if clauses and use CamelCase for
variables, etc.

4 years ago[NFC, msan] Increase stack in small stack tests
Vitaly Buka [Thu, 16 Apr 2020 02:36:11 +0000 (19:36 -0700)]
[NFC, msan] Increase stack in small stack tests

Test fails in our setup if used with libunwind.
It needs just few bytest to pass.

4 years agoFix memory leak introduced by llvmorg-11-init-11960-gbab6df86aef.
Richard Smith [Thu, 16 Apr 2020 02:38:49 +0000 (19:38 -0700)]
Fix memory leak introduced by llvmorg-11-init-11960-gbab6df86aef.

4 years ago[Attributor] Remove large and seemingly useless test
Johannes Doerfert [Thu, 9 Apr 2020 00:04:57 +0000 (19:04 -0500)]
[Attributor] Remove large and seemingly useless test

This was supposed to be part of D76588 already.

4 years ago[CallGraphUpdater][NFC] Minor updates to D77855
Johannes Doerfert [Thu, 9 Apr 2020 20:43:31 +0000 (15:43 -0500)]
[CallGraphUpdater][NFC] Minor updates to D77855

I uploaded the old version accidentally instead of the one with these
minor adjustments requested by the reviewers.

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

4 years ago[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part I)
Shengchen Kan [Wed, 15 Apr 2020 05:37:46 +0000 (13:37 +0800)]
[X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part I)

Summary:
The function in X86MCCodeEmitter has too many parameters to make it look
messy, and some parameters are unnecessary. This is the first patch to
reduce their parameters.

The follwing operations are cheap
```
unsigned Opcode = MI.getOpcode();
const MCInstrDesc &Desc = MCII.get(Opcode);
uint64_t TSFlags = Desc.TSFlags;
```
So if we pass a `MCInst`, we don't need to pass `MCInstrDesc`;
if we pass a `MCInstrDesc`, we don't need to pass `TSFlags`.

Reviewers: craig.topper, MaskRay, pengfei

Reviewed By: craig.topper

Subscribers: annita.zhang, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[MC] Replace MCSection*::getName() with MCSection::getName(). NFC
Fangrui Song [Wed, 15 Apr 2020 22:49:05 +0000 (15:49 -0700)]
[MC] Replace MCSection*::getName() with MCSection::getName(). NFC

I plan to use MCSection::getName() in D78138. Having the function in the base class is also convenient for debugging.

Reviewed By: rnk

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

4 years ago[Attributor] Unify testing (=updates,prefixes,run configurations,...)
Johannes Doerfert [Thu, 9 Apr 2020 00:04:57 +0000 (19:04 -0500)]
[Attributor] Unify testing (=updates,prefixes,run configurations,...)

When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.

Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }

Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.

Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.

An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.

Tests have been adjusted in the process but we tried to keep their
intend unchanged.

Reviewed By: sstefan1

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

4 years agoAnother attempt of D77452 - da0e91fee614e8686f48db28e6507c8abe061fc2
Walter Erquinigo [Sat, 4 Apr 2020 02:42:58 +0000 (19:42 -0700)]
Another attempt of D77452 - da0e91fee614e8686f48db28e6507c8abe061fc2
[intel-pt] Improve the way the test determines whether to run

- Now I'm creating a default value for the new test parameter
- I fixed a small mistake in the skipping logic of the test

... I forgot to clear the cmake cache when testing my diff

4 years ago[mlir][Inliner] Store the resolved call by-value instead of by-reference
River Riddle [Thu, 16 Apr 2020 00:41:31 +0000 (17:41 -0700)]
[mlir][Inliner] Store the resolved call by-value instead of by-reference

This avoids asan failures as more calls may be added during inlining, invalidating the reference.

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

4 years agoRevert "Attempt to fix build with MSVC."
Richard Smith [Thu, 16 Apr 2020 00:40:00 +0000 (17:40 -0700)]
Revert "Attempt to fix build with MSVC."

This reverts commit 30853cd689efd73a005163436673c13a29eca805.

The problem that this change was working around was fixed in
1132c75bd77a4ae5e4634e22ac693128e3f39e5c.

4 years agoRemove vptr dispatch from FoldingSet.
Richard Smith [Wed, 15 Apr 2020 22:00:08 +0000 (15:00 -0700)]
Remove vptr dispatch from FoldingSet.

Summary:
Instead of storing a vptr in each FoldingSet instance, form an
equivalent struct and pass it implicitly from FoldingSet into the
various FoldingSetBase methods.

This has three benefits:
 * FoldingSet becomes one pointer smaller.
 * Under LTO, the "virtual" functions are much easier to inline.
 * The element type no longer needs to be complete when instantiating
   FoldingSet<T>, only when instantiating an insert / lookup member.

Reviewers: rnk

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[Reassociate] Preserve AAManager and BasicAA analyses.
Alina Sbirlea [Wed, 15 Apr 2020 22:58:57 +0000 (15:58 -0700)]
[Reassociate] Preserve AAManager and BasicAA analyses.

Now Reassociate Pass invalidates the analysis results of AAManager and BasicAA,
but it saves GlobalsAA, although it seems that it should preserve them, since
it affects only Unary and Binary operators.

Author: kpolushin (Kirill)

Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D77137

4 years ago[MC] Rename MCSection*::getSectionName() to getName(). NFC
Fangrui Song [Wed, 15 Apr 2020 22:49:05 +0000 (15:49 -0700)]
[MC] Rename MCSection*::getSectionName() to getName(). NFC

A pending change will merge MCSection*::getName() to MCSection::getName().

4 years ago[CallGraphUpdater] Remove nodes from their SCC (old PM)
Johannes Doerfert [Thu, 9 Apr 2020 20:43:31 +0000 (15:43 -0500)]
[CallGraphUpdater] Remove nodes from their SCC (old PM)

Summary:
We can and should remove deleted nodes from their respective SCCs. We
did not do this before and this was a potential problem even though I
couldn't locally trigger an issue. Since the `DeleteNode` would assert
if the node was not in the SCC, we know we only remove nodes from their
SCC and only once (when run on all the Attributor tests).

Reviewers: lebedev.ri, hfinkel, fhahn, probinson, wristow, loladiro, sstefan1, uenoku

Subscribers: hiraditya, bollu, uenoku, llvm-commits

Tags: #llvm

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

4 years ago[CallGraphUpdater] Update the ExternalCallingNode for node replacements
Johannes Doerfert [Thu, 9 Apr 2020 20:21:24 +0000 (15:21 -0500)]
[CallGraphUpdater] Update the ExternalCallingNode for node replacements

Summary:
While it is uncommon that the ExternalCallingNode needs to be updated,
it can happen. It is uncommon because most functions listed as callees
have external linkage, modifying them is usually not allowed. That said,
there are also internal functions that have, or better had, their
"address taken" at construction time. We conservatively assume various
uses cause the address "to be taken". Furthermore, the user might have
become dead at some point. As a consequence, transformations, e.g., the
Attributor, might be able to replace a function that is listed
as callee of the ExternalCallingNode.

Since there is no function corresponding to the ExternalCallingNode, we
did just remove the node from the callee list if we replaced it (so
far). Now it would be preferable to replace it if needed and remove it
otherwise. However, removing the node has implications on the CGSCC
iteration. Locally, that caused some other nodes to be never visited
but it is for sure possible other (bad) side effects can occur. As it
seems conservatively safe to keep the new node in the callee list we
will do that for now.

Reviewers: lebedev.ri, hfinkel, fhahn, probinson, wristow, loladiro, sstefan1, uenoku

Subscribers: hiraditya, bollu, uenoku, llvm-commits

Tags: #llvm

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

4 years ago[CallGraphUpdater] Properly remove strongly connected components (oldPM)
Johannes Doerfert [Sun, 12 Apr 2020 16:52:06 +0000 (11:52 -0500)]
[CallGraphUpdater] Properly remove strongly connected components (oldPM)

Summary:
The old code did eliminate references from and to functions that were
about to be deleted only just before we deleted them. This can cause
references from other functions that are supposed to be deleted to still
exist, depending on the order. If the functions form a strongly
connected component the problem manifests regardless of the order in
which we try to actually delete the functions.

This patch introduces a two step deletion. First we remove all
references and then we delete the function. Note that this only affects
the old call graph. There should not be any functional changes if no old
style call graph was given.

To test this we delete two strongly connected functions instead of one
in an existing test.

Reviewers: hfinkel

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

4 years agoRevert "[intel-pt] Improve the way the test determines whether to run"
Walter Erquinigo [Wed, 15 Apr 2020 23:35:29 +0000 (16:35 -0700)]
Revert "[intel-pt] Improve the way the test determines whether to run"

This reverts commit da0e91fee614e8686f48db28e6507c8abe061fc2.

There's a failure in
http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/8584
caused by a missing python object.

4 years ago[intel-pt] Improve the way the test determines whether to run
Walter Erquinigo [Sat, 4 Apr 2020 02:42:58 +0000 (19:42 -0700)]
[intel-pt] Improve the way the test determines whether to run

Summary:
@labath raised a concern on the way I was skipping this test. I think that was
fair and I found a better way.
Now I'm skipping if the CMAKE flag LLDB_BUILD_INTEL_PT is false.
I added an enabled_plugins entry in the dotest configuration, which gets
set by lit or lldb-dotest. The only available plugin right now is
'intel-pt', but I imagine it will be useful in the future for other
kinds of plugins that get determined at configuration time. I didn't
want to add a new argument option --enable-intel-pt or something or the
sort, as it wouldn't be useful for other cases.

Reviewers: labath, clayborg

Subscribers: lldb-commits, labath

Tags: #lldb

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

4 years ago[SVE] Remove calls to getBitWidth from x86
Christopher Tetreault [Wed, 15 Apr 2020 22:29:30 +0000 (15:29 -0700)]
[SVE] Remove calls to getBitWidth from x86

Reviewers: efriedma, RKSimon, sdesmalen

Reviewed By: RKSimon

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[CallSite removal][CallSiteSplitting] Use CallBase instead of CallSite. NFC
Craig Topper [Wed, 15 Apr 2020 22:11:44 +0000 (15:11 -0700)]
[CallSite removal][CallSiteSplitting] Use CallBase instead of CallSite. NFC

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

4 years ago[CallSite removal][CloneFunction] Use CallSite instead of CallBase. NFC
Craig Topper [Wed, 15 Apr 2020 22:11:14 +0000 (15:11 -0700)]
[CallSite removal][CloneFunction] Use CallSite instead of CallBase. NFC

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

4 years ago[AMDGPU] Fixed lane mask in test. NFC.
Stanislav Mekhanoshin [Wed, 15 Apr 2020 22:16:14 +0000 (15:16 -0700)]
[AMDGPU] Fixed lane mask in test. NFC.

4 years ago[SVE] Fix unsigned is always >= 0
Christopher Tetreault [Wed, 15 Apr 2020 22:16:17 +0000 (15:16 -0700)]
[SVE] Fix unsigned is always >= 0

Reviewers: efriedma, sdesmalen

Reviewed By: sdesmalen

Subscribers: tschuett, rkruppe, psnobl, cfe-commits

Tags: #clang

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

4 years ago[LLVM][SupportTests] Ask the OS how large the page size is instead of guessing.
Michael Spencer [Wed, 15 Apr 2020 22:12:08 +0000 (15:12 -0700)]
[LLVM][SupportTests] Ask the OS how large the page size is instead of guessing.

PPC64 had a larger than expected page size. Instead of guessing just
use the same API that `MemoryBuffer` does to determine the page size.

4 years ago[AIX][PowerPC] Implement caller byval arguments in stack memory
Chris Bowler [Wed, 15 Apr 2020 21:57:31 +0000 (17:57 -0400)]
[AIX][PowerPC] Implement caller byval arguments in stack memory

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

4 years ago[PoisonChecking] Further clarify file scope comment, and update to match naming now...
Philip Reames [Wed, 15 Apr 2020 20:15:12 +0000 (13:15 -0700)]
[PoisonChecking] Further clarify file scope comment, and update to match naming now used in code

4 years ago[NFC] Adjust style and clarify comments in PoisonChecking
Philip Reames [Wed, 15 Apr 2020 20:11:10 +0000 (13:11 -0700)]
[NFC] Adjust style and clarify comments in PoisonChecking

4 years ago[NFC] Use new canCreatePoison to make code intent more clear in PoisonChecking
Philip Reames [Wed, 15 Apr 2020 19:34:48 +0000 (12:34 -0700)]
[NFC] Use new canCreatePoison to make code intent more clear in PoisonChecking

4 years ago[LLVM][SupportTests] Fix Windows build breakage
Michael Spencer [Wed, 15 Apr 2020 21:46:29 +0000 (14:46 -0700)]
[LLVM][SupportTests] Fix Windows build breakage

`MemoryBuffer::getOpenFile` take an OS file handle, not an int.

4 years ago[builtins] Fix unprototypes function declaration
Ayke van Laethem [Wed, 15 Apr 2020 13:32:58 +0000 (15:32 +0200)]
[builtins] Fix unprototypes function declaration

The following declarations were missing a prototype:

    FE_ROUND_MODE __fe_getround();
    int __fe_raise_inexact();

Discovered while fixing a bug in Clang related to unprototyped function
calls (see the previous commit).

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

4 years ago[AVR] Use the correct address space for non-prototyped function calls
Ayke van Laethem [Tue, 14 Apr 2020 16:13:41 +0000 (18:13 +0200)]
[AVR] Use the correct address space for non-prototyped function calls

Some function declarations like this:

    void foo();

do not have a type declaration, for that you'd use:

    void foo(void);

Clang internally bitcasts the variadic function declaration to a
function pointer, but doesn't use the correct address space on AVR. This
commit fixes that.

This fix is necessary to let Clang compile compiler-rt for AVR.

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

4 years ago[nfc] [lldb] Introduce DWARF callbacks (fixed-up)
Jan Kratochvil [Wed, 15 Apr 2020 21:39:40 +0000 (23:39 +0200)]
[nfc] [lldb] Introduce DWARF callbacks (fixed-up)

As requested by @labath in https://reviews.llvm.org/D73206#1949516
providing DWARF index callbacks refactorization.

It is a re-landing of the patch with a regression fix the previous
commit had.

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

4 years ago[NFC] correct "thier" to "their"
Josh Stone [Wed, 15 Apr 2020 21:38:43 +0000 (14:38 -0700)]
[NFC] correct "thier" to "their"

4 years ago[docs] Fix an RST error introduced in e823068306e.
Lang Hames [Wed, 15 Apr 2020 18:44:17 +0000 (11:44 -0700)]
[docs] Fix an RST error introduced in e823068306e.

This should fix the 'Explicit markup ends without a blank line' error seen on
http://lab.llvm.org:8011/builders/llvm-sphinx-docs.

Thanks to Daniel Sanders for spotting this.

4 years agoPR45561: Return a literal string rather than an error string to avoid returning refer...
David Blaikie [Wed, 15 Apr 2020 21:26:31 +0000 (14:26 -0700)]
PR45561: Return a literal string rather than an error string to avoid returning reference to local

Changing the underlying YAML support to allow returning a literal
string, rather than a StringRef, would probably be a bigger refactor so
I didn't do that.

4 years agoRemove extra ‘;’. NFC.
Michael Liao [Wed, 15 Apr 2020 21:19:48 +0000 (17:19 -0400)]
Remove extra â€˜;’. NFC.

4 years agoRevert "[lit] Keep original cfg file case around."
Nico Weber [Wed, 15 Apr 2020 21:17:18 +0000 (17:17 -0400)]
Revert "[lit] Keep original cfg file case around."

This reverts commit bc3f54de1827e58655c34477d09211cbc42589bd.

The patch breaks in the following two scenarios:

1. When manually passing an absolute path to llvm-lit with a lower-case
   drive letter: `python bin\llvm-lit.py -sv c:\llvm-project\clang\test\PCH`

2. When the PWD has a lower-case drive letter, like after running
   `cd c:\` with a lower-case "c:" (cmd's default is upper-case, but
   it takes case-ness from what's passed to `cd` apparently).

4 years ago[Clang] Expose RequiresNullTerminator in FileManager.
Michael Spencer [Thu, 9 Apr 2020 03:29:39 +0000 (20:29 -0700)]
[Clang] Expose RequiresNullTerminator in FileManager.

This is needed to fix the reason
0a2be46cfdb698fe (Modules: Invalidate out-of-date PCMs as they're
discovered) and 5b44a4b07fc1d ([modules] Do not cache invalid state for
modules that we attempted to load.) were reverted.

These patches changed Clang to use `isVolatile` when loading modules.
This had the side effect of not using mmap when loading modules, and
thus greatly increased memory usage.

The reason it wasn't using mmap is because `MemoryBuffer` plays some
games with file size when you request null termination, and it has to
disable these when `isVolatile` is set as the size may change by the
time it's mmapped. Clang by default passes
`RequiresNullTerminator = true`, and `shouldUseMmap` ignored if
`RequiresNullTerminator` was even requested.

This patch adds `RequiresNullTerminator` to the `FileManager` interface
so Clang can use it when loading modules, and changes `shouldUseMmap` to
only take volatility into account if `RequiresNullTerminator` is true.
This is fine as both `mmap` and a `read` loop are vulnerable to
modifying the file while reading, but are immune to the rename Clang
does when replacing a module file.

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

4 years ago[AMDGPU] Move DWARF proposal to separate file
Tony [Tue, 14 Apr 2020 04:55:43 +0000 (00:55 -0400)]
[AMDGPU] Move DWARF proposal to separate file

- Move DWARF proposal for heterogeneous debugging to a separate file.
- Add references.

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

4 years ago[MLIR] Improve support for 0-dimensional Affine Maps.
Jeremy Bruestle [Wed, 15 Apr 2020 18:12:47 +0000 (11:12 -0700)]
[MLIR] Improve support for 0-dimensional Affine Maps.

Summary:
Modified AffineMap::get to remove support for the overload which allowed
an ArrayRef of AffineExpr but no context (and gathered the context from a
presumed first entry, resulting in bugs when there were 0 results).

Instead, we support only a ArrayRef and a context, and a version which
takes a single AffineExpr.

Additionally, removed some now needless case logic which previously
special cased which call to AffineMap::get to use.

Reviewers: flaub, bondhugula, rriddle!, nicolasvasilache, ftynse, ulysseB, mravishankar, antiagainst, aartbik

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

Tags: #llvm

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

4 years ago[Attributor] KindToAbstractAttributeMap: use SmallDenseMap
Roman Lebedev [Wed, 15 Apr 2020 21:12:45 +0000 (00:12 +0300)]
[Attributor] KindToAbstractAttributeMap: use SmallDenseMap

Summary:
While this is less efficient to allocate huge `SmallDenseMap` for each `IRPosition` in `AAMap`,
in the larger picture this is much better, since we'd eventually either fill each `IRPosition`,
with each possible attribute, or at least quert for it, which would allocate it anyway.
So we are better off pre-allocating.

Old:
```
   0.3460 ( 40.7%)   0.0183 ( 33.9%)   0.3643 ( 40.3%)   0.3644 ( 40.3%)  Deduce and propagate attributes (CGSCC pass)
   0.1135 ( 13.4%)   0.0080 ( 14.7%)   0.1215 ( 13.4%)   0.1215 ( 13.4%)  Deduce and propagate attributes
```
```
total runtime: 19.48s.
bytes allocated in total (ignoring deallocations): 575.02MB (29.51MB/s)
calls to allocation functions: 908876 (46644/s)
temporary memory allocations: 276654 (14198/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 944.78MB
total memory leaked: 8.85MB
```
New:
```
   0.3223 ( 38.1%)   0.0299 ( 53.6%)   0.3522 ( 39.1%)   0.3522 ( 39.1%)  Deduce and propagate attributes (CGSCC pass)
   0.1150 ( 13.6%)   0.0037 (  6.7%)   0.1188 ( 13.2%)   0.1188 ( 13.2%)  Deduce and propagate attributes
```
```
total runtime: 19.06s.
bytes allocated in total (ignoring deallocations): 363.21MB (19.06MB/s)
calls to allocation functions: 679660 (35658/s)
temporary memory allocations: 83472 (4379/s)
peak heap memory consumption: 27.00MB
peak RSS (including heaptrack overhead): 931.66MB
total memory leaked: 8.85MB
```

Diff:
```
total runtime: -0.42s.
bytes allocated in total (ignoring deallocations): -211.81MB (498.38MB/s)
calls to allocation functions: -229216 (539331/s)
temporary memory allocations: -193182 (454545/s)
peak heap memory consumption: 321.54KB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

Reviewers: jdoerfert, sstefan1, uenoku

Reviewed By: jdoerfert

Subscribers: uenoku, llvm-commits

Tags: #llvm

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

4 years ago[MustExecute] checkForAllContext(): use pre-increment
Roman Lebedev [Wed, 15 Apr 2020 21:12:17 +0000 (00:12 +0300)]
[MustExecute] checkForAllContext(): use pre-increment

Summary:
You'd think there is no difference, but this halves (yikes!) compiler memory usage
on `test-suite/MultiSource/Applications/SPASS/top.c` test,
because `MustBeExecutedIterator operator++()` is, well, post-increment,
it must create a duplicate of existing `MustBeExecutedIterator`,
which involves duplicating `VisitedSetTy Visited` which is `DenseSet`..

Old
```
   0.3573 ( 42.9%)   0.0264 ( 33.7%)   0.3837 ( 42.1%)   0.3837 ( 42.1%)  Deduce and propagate attributes (CGSCC pass)
   0.1011 ( 12.1%)   0.0199 ( 25.4%)   0.1210 ( 13.3%)   0.1210 ( 13.3%)  Deduce and propagate attributes
```
```
total runtime: 20.04s.
bytes allocated in total (ignoring deallocations): 1.09GB (54.63MB/s)
calls to allocation functions: 1142410 (57020/s)
temporary memory allocations: 500538 (24983/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 944.85MB
total memory leaked: 8.85MB
```
New:
```
   0.3309 ( 39.8%)   0.0164 ( 33.3%)   0.3473 ( 39.5%)   0.3473 ( 39.5%)  Deduce and propagate attributes (CGSCC pass)
   0.1152 ( 13.9%)   0.0076 ( 15.5%)   0.1229 ( 14.0%)   0.1229 ( 14.0%)  Deduce and propagate attributes
```
```
total runtime: 19.49s.
bytes allocated in total (ignoring deallocations): 575.07MB (29.51MB/s)
calls to allocation functions: 909059 (46651/s)
temporary memory allocations: 276923 (14211/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 942.90MB
total memory leaked: 8.85MB
```
Diff:
```
total runtime: -0.55s.
bytes allocated in total (ignoring deallocations): -519.41MB (946.11MB/s)
calls to allocation functions: -233351 (425047/s)
temporary memory allocations: -223615 (407313/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[llvm][CodeGen] Rename SVE gather prefetch intrinsics. [NFC]
Francesco Petrogalli [Wed, 15 Apr 2020 20:46:51 +0000 (21:46 +0100)]
[llvm][CodeGen] Rename SVE gather prefetch intrinsics. [NFC]

Summary:
The renaming is necessary to make the naming scheme uniform with other
gather/scatter load/stores SVE intrinsics.

The naming of variables and functions have been adapted to make it
explicit whether we are dealing with a scalar offset (which is
unscaled) or an index (which is scaled according to the data type of
the lanes of the vector).

Reviewers: andwar, sdesmalen, rengolin

Reviewed By: andwar

Subscribers: tschuett, hiraditya, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Docs] Split testing in running and debugging
Jonas Devlieghere [Wed, 15 Apr 2020 20:04:18 +0000 (13:04 -0700)]
[lldb/Docs] Split testing in running and debugging

Separate running the tests from debugging the test. This is preparatory
for a new section coming soon.

4 years ago[PowerPC] Clear the set of symbols that need to be updated in MCTargetStreamer
Nemanja Ivanovic [Wed, 15 Apr 2020 20:40:51 +0000 (15:40 -0500)]
[PowerPC] Clear the set of symbols that need to be updated in MCTargetStreamer

We have added code to correct the .localentry values on assignments. However, we
never clear the set so presumably it will still contain the (now dangling)
MCSymbol pointers across a call to finish() and reset() in the streamer.

This is based on my speculation that it is the reason we are getting
segmentation faults mentioned in https://bugs.llvm.org/show_bug.cgi?id=45366

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

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

4 years ago[NFC] Correcting minor typo.
Nate Voorhies [Wed, 15 Apr 2020 19:28:06 +0000 (12:28 -0700)]
[NFC] Correcting minor typo.

Summary: Hande -> Handle

Reviewers: xazax.hun

Reviewed By: xazax.hun

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

4 years agoAttempt to fix build with MSVC.
Richard Smith [Wed, 15 Apr 2020 20:26:22 +0000 (13:26 -0700)]
Attempt to fix build with MSVC.

MSVC appears to instantiate the virtual members of FoldingSet when
instantiating the class definition, thereby requiring the element type
to be defined so that its hash function is known.

This is intended to be a temporary fix; ideally, FoldingSet should not
require this.

4 years agoImprove diagnostic when constant-evaluating a std::initializer_list with
Richard Smith [Wed, 15 Apr 2020 20:23:56 +0000 (13:23 -0700)]
Improve diagnostic when constant-evaluating a std::initializer_list with
an unexpected form.

4 years ago[CallSite removal][SimpleLoopUnswitch] Use CallBase instead of CallSite. NFC
Craig Topper [Wed, 15 Apr 2020 19:49:20 +0000 (12:49 -0700)]
[CallSite removal][SimpleLoopUnswitch] Use CallBase instead of CallSite. NFC

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

4 years agoFix DataFlowSanitizer implementation of strchr() so that strchr(..., '\0') returns...
Sam Kerner [Wed, 15 Apr 2020 20:07:28 +0000 (13:07 -0700)]
Fix DataFlowSanitizer implementation of strchr() so that strchr(..., '\0') returns a pointer to '\0'.

Summary:

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

Reviewers: pcc, morehouse

Reviewed By: morehouse

Subscribers: morehouse, #sanitizers

Tags: #sanitizers

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

4 years ago[pstl] Added missing double-underscore prefixes to some types
Ismail Pazarbasi [Mon, 13 Apr 2020 13:21:38 +0000 (15:21 +0200)]
[pstl] Added missing double-underscore prefixes to some types

Summary:
Some of the `move_` types were used with leading double-underscores, but
they were declared without `__` prefix.

This patch adds double-underscores to all `move_` types, and their uses.

Reviewers: MikeDvorskiy, ldionne, EricWF, rodgert, #libc

Reviewed By: MikeDvorskiy, ldionne, #libc

Subscribers: dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[SelectionDAG] Fix usage of Align constructing MachineMemOperands.
Eli Friedman [Tue, 7 Apr 2020 21:05:29 +0000 (14:05 -0700)]
[SelectionDAG] Fix usage of Align constructing MachineMemOperands.

The "Align" passed into getMachineMemOperand etc. is the alignment of
the MachinePointerInfo, not the alignment of the memory operation.
(getAlign() on a MachineMemOperand automatically reduces the alignment
to account for this.)

We were passing on wrong (overconservative) alignment in a bunch of
places. Fix a bunch of these, mostly in legalization.  And while I'm
here, switch to the new Align APIs.

The test changes are all scheduling changes: the biggest effect of
preserving large alignments is that it improves alias analysis, so the
scheduler has more freedom.

(I was originally just trying to do a minor cleanup in
SelectionDAGBuilder, but I accidentally went deeper down the rabbit
hole.)

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

4 years agoMove BinaryOperators.FPOptions to trailing storage
Melanie Blower [Fri, 10 Apr 2020 20:34:46 +0000 (13:34 -0700)]
Move BinaryOperators.FPOptions to trailing storage

Reviewers: rjmccall

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

4 years ago[ASTMatchers] Fix isDerivedFrom for recursive templates
Jan Korous [Wed, 15 Apr 2020 19:47:24 +0000 (12:47 -0700)]
[ASTMatchers] Fix isDerivedFrom for recursive templates

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

4 years ago[CallSite removal][SampleProfile] Use CallBase instead of CallSite. NFC
Craig Topper [Wed, 15 Apr 2020 19:10:10 +0000 (12:10 -0700)]
[CallSite removal][SampleProfile] Use CallBase instead of CallSite. NFC

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

4 years ago[clangd] Fix a crash for accessing a null field decl returned by findExplicitReferences.
Haojian Wu [Tue, 14 Apr 2020 22:16:10 +0000 (00:16 +0200)]
[clangd] Fix a crash for accessing a null field decl returned by findExplicitReferences.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[libc++] Remove the ability to run using the internal Lit shell
Louis Dionne [Mon, 13 Apr 2020 21:27:04 +0000 (17:27 -0400)]
[libc++] Remove the ability to run using the internal Lit shell

The new format requires using an external shell, and as we transition
and we can simplify config.py as we transition to the new format. Also,
frankly, I'd be quite surprised if that setting was still working anyway
because we have several .sh.cpp tests that likely don't work in Lit's
internal shell.

4 years agoEnable finding bitcode in wasm objects
Sam Clegg [Wed, 15 Apr 2020 18:35:35 +0000 (11:35 -0700)]
Enable finding bitcode in wasm objects

This commit fixes using functions in `IRObjectFile` to load bitcode from
wasm objects by recognizing the file magic for wasm and also inheriting
the default implementation of classifying sections as bitcode.

Patch By: alexcrichton

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

4 years ago[LICM] Try to merge debug locations when sinking.
Davide Italiano [Wed, 15 Apr 2020 19:28:34 +0000 (12:28 -0700)]
[LICM] Try to merge debug locations when sinking.

The current strategy LICM uses when sinking for debuginfo is
that of picking the debug location of one of the uses.
This causes stepping to be wrong sometimes, see, e.g. PR45523.

This patch introduces a generalization of getMergedLocation(),
that operates on a vector of locations instead of two, and try
to merge all them together, and use the new API in LICM.

<rdar://problem/61750950>

4 years ago[AArch64][NFC]Autogenerated checks.
Pavel Iliin [Wed, 15 Apr 2020 18:01:24 +0000 (19:01 +0100)]
[AArch64][NFC]Autogenerated checks.

4 years agoRework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are...
Richard Smith [Sun, 12 Apr 2020 05:15:29 +0000 (22:15 -0700)]
Rework how UuidAttr, CXXUuidofExpr, and GUID template arguments and constants are represented.

Summary:
Previously, we treated CXXUuidofExpr as quite a special case: it was the
only kind of expression that could be a canonical template argument, it
could be a constant lvalue base object, and so on. In addition, we
represented the UUID value as a string, whose source form we did not
preserve faithfully, and that we partially parsed in multiple different
places.

With this patch, we create an MSGuidDecl object to represent the
implicit object of type 'struct _GUID' created by a UuidAttr. Each
UuidAttr holds a pointer to its 'struct _GUID' and its original
(as-written) UUID string. A non-value-dependent CXXUuidofExpr behaves
like a DeclRefExpr denoting that MSGuidDecl object. We cache an APValue
representation of the GUID on the MSGuidDecl and use it from constant
evaluation where needed.

This allows removing a lot of the special-case logic to handle these
expressions. Unfortunately, many parts of Clang assume there are only
a couple of interesting kinds of ValueDecl, so the total amount of
special-case logic is not really reduced very much.

This fixes a few bugs and issues:
 * PR38490: we now support reading from GUID objects returned from
   __uuidof during constant evaluation.
 * Our Itanium mangling for a non-instantiation-dependent template
   argument involving __uuidof no longer depends on which CXXUuidofExpr
   template argument we happened to see first.
 * We now predeclare ::_GUID, and permit use of __uuidof without
   any header inclusion, better matching MSVC's behavior. We do not
   predefine ::__s_GUID, though; that seems like a step too far.
 * Our IR representation for GUID constants now uses the correct IR type
   wherever possible. We will still fall back to using the
      {i32, i16, i16, [8 x i8]}
   layout if a definition of struct _GUID is not available. This is not
   ideal: in principle the two layouts could have different padding.

Reviewers: rnk, jdoerfert

Subscribers: arphaman, cfe-commits, aeubanks

Tags: #clang

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

4 years ago[X86] Make v32i16/v64i8 legal types without avx512bw. Use custom splitting instead.
Craig Topper [Wed, 15 Apr 2020 19:03:39 +0000 (12:03 -0700)]
[X86] Make v32i16/v64i8 legal types without avx512bw. Use custom splitting instead.

This moves v32i16/v64i8 to a model consistent with how we
treat integer types with avx1.

This does change the ABI for types vXi16/vXi8 vectors larger than
512 bits to pass in multiple zmms instead of multiple ymms. We'd
already hacked some code to make v64i8/v32i16 pass in zmm.

Cost model is still a bit of a mess. In some place I tried to
match existing behavior. But really we need to account for
splitting and concating costs. Cost model for shuffles is
especially pessimistic.

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

4 years ago[libc++] Add a new target check-cxx-deps to build dependencies of the test suite
Louis Dionne [Wed, 15 Apr 2020 19:05:14 +0000 (15:05 -0400)]
[libc++] Add a new target check-cxx-deps to build dependencies of the test suite

When running the tests through `lit` directly instead of through `check-cxx`,
it is required to manually build the `cxx` (and often `cxx_experimental`)
targets. Instead of having to do that manually, this commit adds a new
target `check-cxx-deps` that does that for you.

4 years ago[MLIR] Introduce utility to hoist affine if/else conditions
Uday Bondhugula [Fri, 10 Apr 2020 11:42:49 +0000 (17:12 +0530)]
[MLIR] Introduce utility to hoist affine if/else conditions

This revision introduces a utility to unswitch affine.for/parallel loops
by hoisting affine.if operations past surrounding affine.for/parallel.
The hoisting works for both perfect/imperfect nests and in the presence
of else blocks. The hoisting is currently to as outermost a level as
possible.  Uses a test pass to test the utility.
Add convenience method Operation::getParentWithTrait<Trait>.

Depends on D77487.

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

4 years ago[ELF][test] Add --match-full-lines to map-file.s to check leading and trailing spaces
Fangrui Song [Wed, 15 Apr 2020 18:42:50 +0000 (11:42 -0700)]
[ELF][test] Add --match-full-lines to map-file.s to check leading and trailing spaces

Since we are going to touch so many lines, do some other cleanups.
Delete Inputs/map-file3.s and Inputs/map-file4.s which are tiny.

4 years agoRemove false positive in AvoidNonConstGlobalVariables.
Kim Viggedal [Wed, 15 Apr 2020 18:47:11 +0000 (14:47 -0400)]
Remove false positive in AvoidNonConstGlobalVariables.

Addresses post-commit review feedback from https://reviews.llvm.org/D70265

4 years ago[NFC] Silence compiler warning [-Wmissing-braces].
Huihui Zhang [Wed, 15 Apr 2020 18:43:17 +0000 (11:43 -0700)]
[NFC] Silence compiler warning [-Wmissing-braces].

clang/unittests/AST/ASTImporterFixtures.h:70:5: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    ArgVector(), ArgVector{"-fdelayed-template-parsing"},
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {

4 years agoAMDGPU/GlobalISel: Work around a selector crash
Matt Arsenault [Wed, 15 Apr 2020 18:37:31 +0000 (14:37 -0400)]
AMDGPU/GlobalISel: Work around a selector crash

Ideally types without a corresponding register class wouldn't reach
here, but we're currently missing some (in particular a 192-bit class
is missing).

4 years ago[X86] Add generic cpu target for the slow division tests
Simon Pilgrim [Wed, 15 Apr 2020 18:05:42 +0000 (19:05 +0100)]
[X86] Add generic cpu target for the slow division tests

Baseline for any change due to D75567

4 years agoUse maximum compression when packaging release tarballs.
Dimitry Andric [Wed, 15 Apr 2020 18:30:15 +0000 (20:30 +0200)]
Use maximum compression when packaging release tarballs.

Summary:
Since a full run of test-release.sh takes many hours (at least on my
poor systems), we might as well spend some extra time compressing the
tarball, in return for a quite a bit of gains for uploading and
downloading it.

As an example, the 10.0.0-rc4 .tar.xz tarball shrinks from 465MiB to
306MiB, about 52% smaller.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoTurn off core dumps before starting the main body of test-release.sh.
Dimitry Andric [Wed, 15 Apr 2020 18:29:20 +0000 (20:29 +0200)]
Turn off core dumps before starting the main body of test-release.sh.

Summary:
Some of the regression tests, such as those for the various sanitizers,
use huge shadow memory maps (showing up in top as 20 TiB).  If any of
those ever crashes, your test system's disk will be filled up until
everything falls over.  Set the ulimit for core dumps to 0 to prevent
this problem.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[libc++] Adjust XFAIL markup for modules tests on single-threaded systems
Louis Dionne [Wed, 15 Apr 2020 18:17:40 +0000 (14:17 -0400)]
[libc++] Adjust XFAIL markup for modules tests on single-threaded systems

When building these tests without modules in the whole test suite,
the __config_site macro definitions are not included anymore in the
%{compile_flags}. This causes the _LIBCPP_HAS_NO_THREADS define not
to be picked up, and the test to XPASS on single-threaded systems.

This is a stop-gap measure to fix the build bots, however the proper
solution would be to always pass the __config_site defines as compiler
macros, whether we build with modules or not.

4 years agoAdd FileCheck colons missed in D76210
Jon Roelofs [Mon, 13 Apr 2020 16:36:45 +0000 (10:36 -0600)]
Add FileCheck colons missed in D76210

https://reviews.llvm.org/D76210#inline-715185

4 years ago[lit] Keep original cfg file case around.
Nico Weber [Tue, 14 Apr 2020 00:12:51 +0000 (20:12 -0400)]
[lit] Keep original cfg file case around.

There's been some back and forth if the cfg paths in the
config_map should be normcase()d. The argument for is that
it allows using all-lower spelling in cmd on Windows, the
argument against that doing so is lossy.

Before the relative-paths-in-generated-lit.site.cfg.py work,
there was no downside to calling normcase(), but with it
we need a hack to recover the original case.

This time, normcase() the hashtable key, but store the original
cased key in addition to the value. This fixes both cons, at the
cost of a few bytes more memory.

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