platform/upstream/llvm.git
4 years ago[OPENMP]Fix thread id passed to outlined region in sequential parallel
Alexey Bataev [Thu, 17 Oct 2019 14:36:43 +0000 (14:36 +0000)]
[OPENMP]Fix thread id passed to outlined region in sequential parallel
regions.

The real global thread id must be passed to the outlined region instead
of the zero thread id.

llvm-svn: 375119

4 years ago[OpenCL] Preserve addrspace in CGClass (PR43145)
Sven van Haastregt [Thu, 17 Oct 2019 14:12:51 +0000 (14:12 +0000)]
[OpenCL] Preserve addrspace in CGClass (PR43145)

PR43145 revealed two places where Clang was attempting to create a
bitcast without considering the address space of class types during
C++ class code generation.

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

llvm-svn: 375118

4 years ago[clangd] Use our own relation kind.
Haojian Wu [Thu, 17 Oct 2019 14:08:28 +0000 (14:08 +0000)]
[clangd] Use our own relation kind.

Summary:
Move the RelationKind from Serialization.h to Relation.h. This patch doesn't
introduce any breaking changes.

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 375117

4 years ago[lit] Extend internal diff to support `-` argument
Joel E. Denny [Thu, 17 Oct 2019 14:03:06 +0000 (14:03 +0000)]
[lit] Extend internal diff to support `-` argument

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` doesn't
recognize `-` as a command-line option.  This patch adds support for
`-` to mean stdin.

Reviewed By: probinson, rnk

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

llvm-svn: 375116

4 years ago[lit] Make internal diff work in pipelines
Joel E. Denny [Thu, 17 Oct 2019 14:02:42 +0000 (14:02 +0000)]
[lit] Make internal diff work in pipelines

When using lit's internal shell, RUN lines like the following
accidentally execute an external `diff` instead of lit's internal
`diff`:

```
 # RUN: program | diff file -
 # RUN: not diff file1 file2 | FileCheck %s
```

Such cases exist now, in `clang/test/Analysis` for example.  We are
preparing patches to ensure lit's internal `diff` is called in such
cases, which will then fail because lit's internal `diff` cannot
currently be used in pipelines and doesn't recognize `-` as a
command-line option.

To enable pipelines, this patch moves lit's `diff` implementation into
an out-of-process script, similar to lit's `cat` implementation.  A
follow-up patch will implement `-` to mean stdin.

Reviewed By: probinson, stella.stamenova

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

llvm-svn: 375114

4 years ago[AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large models
Xiangling Liao [Thu, 17 Oct 2019 13:20:25 +0000 (13:20 +0000)]
[AIX] TOC pseudo expansion for 64bit large + 64bit small + 32bit large models

This patch provides support for peudo ops including ADDIStocHA8, ADDIStocHA, LWZtocL,
LDtoc, LDtocL for AIX, lowering them from MIR to assembly.

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

llvm-svn: 375113

4 years ago[OpenCL] Add doc to describe OpenCL support
Sven van Haastregt [Thu, 17 Oct 2019 12:56:02 +0000 (12:56 +0000)]
[OpenCL] Add doc to describe OpenCL support

The idea of this page is to document work in progress functionality
and also describe the plan of future development work.

Patch by Anastasia Stulova.

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

llvm-svn: 375111

4 years ago[mips] [builtins] Remove clear_mips_cache
Zoran Jovanovic [Thu, 17 Oct 2019 12:21:14 +0000 (12:21 +0000)]
[mips] [builtins] Remove clear_mips_cache
Differential Revision: https://reviews.llvm.org/D69021

llvm-svn: 375110

4 years ago[AMDGPU] Improve code size cost model
Daniil Fukalov [Thu, 17 Oct 2019 12:15:35 +0000 (12:15 +0000)]
[AMDGPU] Improve code size cost model

Summary:
Added estimation for zero size insertelement, extractelement
and llvm.fabs operators.
Updated inline/unroll parameters default values.

Reviewers: rampitec, arsenm

Reviewed By: arsenm

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

Tags: #llvm

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

llvm-svn: 375109

4 years ago[ARM][MVE] Enable truncating masked stores
Sam Parker [Thu, 17 Oct 2019 12:11:18 +0000 (12:11 +0000)]
[ARM][MVE] Enable truncating masked stores

Allow us to generate truncating masked store which take v4i32 and
v8i16 vectors and can store to v4i8, v4i16 and v8i8 and memory.
Removed support for unaligned masked stores.

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

llvm-svn: 375108

4 years ago[docs][llvm-ar] Fix option:: O after r375106
Fangrui Song [Thu, 17 Oct 2019 11:56:26 +0000 (11:56 +0000)]
[docs][llvm-ar] Fix option:: O after r375106

docs-llvm-html fails => unknown option: O

There are lots of formatting issues in the file but they will be fixed by D68998.

llvm-svn: 375107

4 years ago[llvm-ar] Implement the O modifier: display member offsets inside the archive
Fangrui Song [Thu, 17 Oct 2019 11:34:29 +0000 (11:34 +0000)]
[llvm-ar] Implement the O modifier: display member offsets inside the archive

Since GNU ar 2.31, the 't' operation prints member offsets beside file
names if the 'O' modifier is specified. 'O' is ignored for thin
archives.

Reviewed By: gbreynoo, ruiu

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

llvm-svn: 375106

4 years ago[llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist
Fangrui Song [Thu, 17 Oct 2019 11:21:54 +0000 (11:21 +0000)]
[llvm-objcopy] --add-symbol: fix crash if SHT_SYMTAB does not exist

Exposed by D69041. If SHT_SYMTAB does not exist, ELFObjcopy.cpp:handleArgs will crash due
to a null pointer dereference.

  for (const NewSymbolInfo &SI : Config.ELF->SymbolsToAdd) {
    ...
    Obj.SymbolTable->addSymbol(

Fix this by creating .symtab and .strtab on demand in ELFBuilder<ELFT>::readSections,
if --add-symbol is specified.

Reviewed By: grimar

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

llvm-svn: 375105

4 years agoInclude leading attributes in DeclStmt's SourceRange
Stephan Bergmann [Thu, 17 Oct 2019 11:20:21 +0000 (11:20 +0000)]
Include leading attributes in DeclStmt's SourceRange

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

llvm-svn: 375104

4 years agoJumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null derefe...
Simon Pilgrim [Thu, 17 Oct 2019 11:19:41 +0000 (11:19 +0000)]
JumpThreadingPass::UnfoldSelectInstr - silence static analyzer dyn_cast<> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.

llvm-svn: 375103

4 years agoclang-tidy - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 17 Oct 2019 11:12:53 +0000 (11:12 +0000)]
clang-tidy - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375102

4 years agoSemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 17 Oct 2019 11:12:31 +0000 (11:12 +0000)]
SemaExprCXX - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375101

4 years ago[LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)
Roman Lebedev [Thu, 17 Oct 2019 11:01:29 +0000 (11:01 +0000)]
[LoopIdiom] BCmp: check, not assert that loop exits exit out of the loop (PR43687)

We can't normally stumble into that assertion because a tautological
*conditional* `br` in loop body is required, one that always
branches to loop latch. But that should have been always folded
to an unconditional branch before we get it.
But that is not guaranteed if the pass is run standalone.
So let's just promote the assertion into a proper check.

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

llvm-svn: 375100

4 years agoSemaDeclObjC - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Thu, 17 Oct 2019 10:35:29 +0000 (10:35 +0000)]
SemaDeclObjC - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 375097

4 years ago[LLD][ELF] - Update test cases after llvm-readobj output format change.
George Rimar [Thu, 17 Oct 2019 10:23:59 +0000 (10:23 +0000)]
[LLD][ELF] - Update test cases after llvm-readobj output format change.

The change was:

SHT_GNU_verdef { -> VersionDefinitions [
SHT_GNU_verneed { -> VersionRequirements [
Version symbols [ -> VersionSymbols [
EH_FRAME Header [ -> EHFrameHeader {

llvm-svn: 375096

4 years ago[llvm-readobj] - Refine the LLVM-style output to be consistent.
George Rimar [Thu, 17 Oct 2019 10:23:48 +0000 (10:23 +0000)]
[llvm-readobj] - Refine the LLVM-style output to be consistent.

Our LLVM-style output was inconsistent.
This patch changes the output in the following way:

SHT_GNU_verdef { -> VersionDefinitions [
SHT_GNU_verneed { -> VersionRequirements [
Version symbols [ -> VersionSymbols [
EH_FRAME Header [ -> EHFrameHeader {

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

llvm-svn: 375095

4 years agoReland: Dead Virtual Function Elimination
Oliver Stannard [Thu, 17 Oct 2019 09:58:57 +0000 (09:58 +0000)]
Reland: Dead Virtual Function Elimination

Remove dead virtual functions from vtables with
replaceNonMetadataUsesWith, so that CGProfile metadata gets cleaned up
correctly.

Original commit message:

Currently, it is hard for the compiler to remove unused C++ virtual
functions, because they are all referenced from vtables, which are referenced
by constructors. This means that if the constructor is called from any live
code, then we keep every virtual function in the final link, even if there
are no call sites which can use it.

This patch allows unused virtual functions to be removed during LTO (and
regular compilation in limited circumstances) by using type metadata to match
virtual function call sites to the vtable slots they might load from. This
information can then be used in the global dead code elimination pass instead
of the references from vtables to virtual functions, to more accurately
determine which functions are reachable.

To make this transformation safe, I have changed clang's code-generation to
always load virtual function pointers using the llvm.type.checked.load
intrinsic, instead of regular load instructions. I originally tried writing
this using clang's existing code-generation, which uses the llvm.type.test
and llvm.assume intrinsics after doing a normal load. However, it is possible
for optimisations to obscure the relationship between the GEP, load and
llvm.type.test, causing GlobalDCE to fail to find virtual function call
sites.

The existing linkage and visibility types don't accurately describe the scope
in which a virtual call could be made which uses a given vtable. This is
wider than the visibility of the type itself, because a virtual function call
could be made using a more-visible base class. I've added a new
!vcall_visibility metadata type to represent this, described in
TypeMetadata.rst. The internalization pass and libLTO have been updated to
change this metadata when linking is performed.

This doesn't currently work with ThinLTO, because it needs to see every call
to llvm.type.checked.load in the linkage unit. It might be possible to
extend this optimisation to be able to use the ThinLTO summary, as was done
for devirtualization, but until then that combination is rejected in the
clang driver.

To test this, I've written a fuzzer which generates random C++ programs with
complex class inheritance graphs, and virtual functions called through object
and function pointers of different types. The programs are spread across
multiple translation units and DSOs to test the different visibility
restrictions.

I've also tried doing bootstrap builds of LLVM to test this. This isn't
ideal, because only classes in anonymous namespaces can be optimised with
-fvisibility=default, and some parts of LLVM (plugins and bugpoint) do not
work correctly with -fvisibility=hidden. However, there are only 12 test
failures when building with -fvisibility=hidden (and an unmodified compiler),
and this change does not cause any new failures for either value of
-fvisibility.

On the 7 C++ sub-benchmarks of SPEC2006, this gives a geomean code-size
reduction of ~6%, over a baseline compiled with "-O2 -flto
-fvisibility=hidden -fwhole-program-vtables". The best cases are reductions
of ~14% in 450.soplex and 483.xalancbmk, and there are no code size
increases.

I've also run this on a set of 8 mbed-os examples compiled for Armv7M, which
show a geomean size reduction of ~3%, again with no size increases.

I had hoped that this would have no effect on performance, which would allow
it to awlays be enabled (when using -fwhole-program-vtables). However, the
changes in clang to use the llvm.type.checked.load intrinsic are causing ~1%
performance regression in the C++ parts of SPEC2006. It should be possible to
recover some of this perf loss by teaching optimisations about the
llvm.type.checked.load intrinsic, which would make it worth turning this on
by default (though it's still dependent on -fwhole-program-vtables).

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

llvm-svn: 375094

4 years agoTry to fix the assert in Alignment::alignAddr to work on 32-bit
Hans Wennborg [Thu, 17 Oct 2019 09:01:39 +0000 (09:01 +0000)]
Try to fix the assert in Alignment::alignAddr to work on 32-bit

Hopefully fixing the AlignmentDeathTest.AlignAddr failures (e.g. at
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925)

llvm-svn: 375090

4 years ago[Analysis] Don't assume that unsigned overflow can't happen in EmitGEPOffset (PR42699)
Mikhail Maltsev [Thu, 17 Oct 2019 08:59:06 +0000 (08:59 +0000)]
[Analysis] Don't assume that unsigned overflow can't happen in EmitGEPOffset (PR42699)

Summary:
Currently when computing a GEP offset using the function EmitGEPOffset
for the following instruction

  getelementptr inbounds i32, i32* %p, i64 %offs

we get

  mul nuw i64 %offs, 4

Unfortunately we cannot assume that unsigned wrapping won't happen
here because %offs is allowed to be negative.

Making such assumptions can lead to miscompilations: see the new test
test24_neg_offs in InstCombine/icmp.ll. Without the patch InstCombine
would generate the following comparison:

   icmp eq i64 %offs, 4611686018427387902; 0x3ffffffffffffffe

Whereas the correct value to compare with is -2.

This patch replaces the NUW flag with NSW in the multiplication
instructions generated by EmitGEPOffset and adjusts the test suite.

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

Reviewers: chandlerc, craig.topper, ostannard, lebedev.ri, spatel, efriedma, nlopes, aqjune

Reviewed By: lebedev.ri

Subscribers: reames, lebedev.ri, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375089

4 years agoRevert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of the secti...
Hans Wennborg [Thu, 17 Oct 2019 08:52:29 +0000 (08:52 +0000)]
Revert r374931 "[llvm-objdump] Use a counter for llvm-objdump -h instead of the section index."

This broke llvm-objdump in 32-bit builds, see e.g.
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925

> Summary:
> When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).
>
> While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.
>
> Reviewers: grimar, jhenderson, espindola
>
> Reviewed By: grimar
>
> Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay
>
> Tags: #llvm
>
> Differential Revision: https://reviews.llvm.org/D68848

llvm-svn: 375088

4 years ago[ARM][MVE] Change VPST to use, not def, VPR
Sam Parker [Thu, 17 Oct 2019 08:46:31 +0000 (08:46 +0000)]
[ARM][MVE] Change VPST to use, not def, VPR

Unlike VPT, VPST just uses the current value of VPR.P0.

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

llvm-svn: 375087

4 years ago[DFAPacketizer] Use DFAEmitter. NFC.
James Molloy [Thu, 17 Oct 2019 08:34:29 +0000 (08:34 +0000)]
[DFAPacketizer] Use DFAEmitter. NFC.

Summary:
This is a NFC change that removes the NFA->DFA construction and emission logic from DFAPacketizerEmitter and instead uses the generic DFAEmitter logic. This allows DFAPacketizer to use the Automaton class from Support and remove a bunch of logic there too.

After this patch, DFAPacketizer is mostly logic for grepping Itineraries and collecting functional units, with no state machine logic. This will allow us to modernize by removing the 16-functional-unit limit and supporting non-itinerary functional units. This is all for followup patches.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375086

4 years ago[DAGCombine][ARM] Enable extending masked loads
Sam Parker [Thu, 17 Oct 2019 07:55:55 +0000 (07:55 +0000)]
[DAGCombine][ARM] Enable extending masked loads

Add generic DAG combine for extending masked loads.

Allow us to generate sext/zext masked loads which can access v4i8,
v8i8 and v4i16 memory to produce v4i32, v8i16 and v4i32 respectively.

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

llvm-svn: 375085

4 years ago[Alignment][NFC] Use Align for TargetFrameLowering/Subtarget
Guillaume Chatelet [Thu, 17 Oct 2019 07:49:39 +0000 (07:49 +0000)]
[Alignment][NFC] Use Align for TargetFrameLowering/Subtarget

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, sbc100, jgravelle-google, hiraditya, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, Jim, lenary, s.egerton, pzheng, llvm-commits

Tags: #llvm

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

llvm-svn: 375084

4 years ago[ThinLTO] Import virtual method with single implementation in hybrid mode
Eugene Leviant [Thu, 17 Oct 2019 07:46:18 +0000 (07:46 +0000)]
[ThinLTO] Import virtual method with single implementation in hybrid mode

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

llvm-svn: 375083

4 years ago[llvm-ar] Simplify and make two global variables static. NFC
Fangrui Song [Thu, 17 Oct 2019 06:15:34 +0000 (06:15 +0000)]
[llvm-ar] Simplify and make two global variables static. NFC

llvm-svn: 375082

4 years ago[lld][WebAssebmly] Preserve custom import attributes with LTO
Sam Clegg [Thu, 17 Oct 2019 05:16:54 +0000 (05:16 +0000)]
[lld][WebAssebmly] Preserve custom import attributes with LTO

Undefined symbols in WebAssembly can come with custom `import-module`
and `import-field` attributes.  However when reading symbols from
bitcode object files during LTO those curtom attributes are not
available.

Once we compile the LTO object and read in the symbol table from the
object file we have access to these custom attributes.  In this case,
when undefined symbols are added and a symbol already exists in the
SymbolTable we can't simple return it, we may need to update the
symbol's attributes.

Fixes: PR43211

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

llvm-svn: 375081

4 years agoRevert "Include sanitize blacklist and other extra deps as part of scan-deps output"
Kousik Kumar [Thu, 17 Oct 2019 04:50:12 +0000 (04:50 +0000)]
Revert "Include sanitize blacklist and other extra deps as part of scan-deps output"

This test is failing on Windows bots, revert for now (will check the right fix and retry the patch).

Summary: This reverts commit 962ca076e51c25a7a08f4e0d329c65328a635bdb.

Reviewers: Bigcheese, jkorous, arphaman

Subscribers: dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 375079

4 years ago[lld][WebAssembly] Fix for weak references to data symbols in archives
Sam Clegg [Thu, 17 Oct 2019 03:21:02 +0000 (03:21 +0000)]
[lld][WebAssembly] Fix for weak references to data symbols in archives

Fix a bug where were not handling relocations against weakly undefined
data symbol.  Add a test for this case.  Also ensure that the weak
references to data symbols are not pulled in from archive files by
default (but are if `-u <name>` is added to the command line).

Fixes: PR43696

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

llvm-svn: 375077

4 years agoClang-formatting of some files in LiveRangeCalc header (LiveRangeCalc.h)
Marcello Maggioni [Thu, 17 Oct 2019 03:12:58 +0000 (03:12 +0000)]
Clang-formatting of some files in LiveRangeCalc header (LiveRangeCalc.h)

NFC

llvm-svn: 375076

4 years agoMove LiveRangeCalc header to publicily available position. NFC
Marcello Maggioni [Thu, 17 Oct 2019 03:12:51 +0000 (03:12 +0000)]
Move LiveRangeCalc header to publicily available position. NFC

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

llvm-svn: 375075

4 years agoInclude sanitize blacklist and other extra deps as part of scan-deps output
Kousik Kumar [Thu, 17 Oct 2019 02:14:44 +0000 (02:14 +0000)]
Include sanitize blacklist and other extra deps as part of scan-deps output

Summary:
Clang's -M mode includes these extra dependencies in its output and clang-scan-deps
should have equivalent behavior, so adding these extradeps to output just like
how its being done for ".d" file generation mode.

Reviewers: arphaman, dexonsmith, Bigcheese, jkorous

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 375074

4 years agodelete SWIG typemaps for FILE*
Lawrence D'Anna [Thu, 17 Oct 2019 01:35:22 +0000 (01:35 +0000)]
delete SWIG typemaps for FILE*

Summary:
The SWIG typemaps for FILE* are no longer used, so
this patch deletes them.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 375073

4 years agoSBCommandReturnObject: change LLDB_RECORD_METHOD(..., FILE *, ...) to use LLDB_RECORD...
Fangrui Song [Thu, 17 Oct 2019 01:28:07 +0000 (01:28 +0000)]
SBCommandReturnObject: change LLDB_RECORD_METHOD(..., FILE *, ...) to use LLDB_RECORD_DUMMY

POSIX says FILE is a typedef to a structure containing information about
a file. The structure is unspecified, i.e. it may be an incomplete type, as is the case on musl
(`struct _IO_FILE` is an implementation detail that is not exposed).

`LLDB_RECORD_METHOD(..., (FILE *), ...)` transitively uses sizeof(FILE)
and requires the structure to be complete.  Change it to
LLDB_RECORD_DUMMY to fix the build failure on musl (regression of
D57475).

Reviewed By: JDevlieghere, labath, lawrence_danna

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

llvm-svn: 375072

4 years agoCorrect placement of #ifndef NDEBUG in r375067
Daniel Sanders [Thu, 17 Oct 2019 01:21:53 +0000 (01:21 +0000)]
Correct placement of #ifndef NDEBUG in r375067

llvm-svn: 375071

4 years agoFix unused variable in r375066
Daniel Sanders [Thu, 17 Oct 2019 01:21:40 +0000 (01:21 +0000)]
Fix unused variable in r375066

llvm-svn: 375070

4 years agoRevert Tag CFI-generated data structures with "#pragma clang section" attributes.
Dmitry Mikulin [Thu, 17 Oct 2019 00:55:38 +0000 (00:55 +0000)]
Revert Tag CFI-generated data structures with "#pragma clang section" attributes.

This reverts r375022 (git commit e2692b3bc0327606748b6d291b9009d2c845ced5)

llvm-svn: 375069

4 years ago[CMake] Make it possible to set the RPATH in add_lldb_exectable.
Jonas Devlieghere [Thu, 17 Oct 2019 00:50:39 +0000 (00:50 +0000)]
[CMake] Make it possible to set the RPATH in add_lldb_exectable.

Make it possible to pass a build and install RPATH to
add_lldb_executable instead of having to call lldb_setup_rpaths after
the fact.

This fixes a real issue where setting an install RPATH with
lldb_setup_rpaths would only affect the symroot installation component.
Given that lldb_setup_rpaths sets a target property I would expect this
to be orthogonal to installation components. Regardless, it makes sense
to integrate this functionality in add_lldb_exectable.

llvm-svn: 375068

4 years ago[gicombiner] Add the run-time rule disable option
Daniel Sanders [Thu, 17 Oct 2019 00:37:04 +0000 (00:37 +0000)]
[gicombiner] Add the run-time rule disable option

Summary:
Each generated helper can be configured to generate an option that disables
rules in that helper. This can be used to bisect rulesets.

The disable bits are stored in a SparseVector as this is very cheap for the
common case where nothing is disabled. It gets more expensive the more rules
are disabled but you're generally doing that for debug purposes where
performance is less of a concern.

Depends on D68426

Reviewers: volkan, bogner

Reviewed By: volkan

Subscribers: hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 375067

4 years ago[GISel][CombinerHelper] Add concat_vectors(build_vector, build_vector) => build_vector
Quentin Colombet [Thu, 17 Oct 2019 00:34:32 +0000 (00:34 +0000)]
[GISel][CombinerHelper] Add concat_vectors(build_vector, build_vector) => build_vector

Teach the combiner helper how to flatten concat_vectors of build_vectors
into a build_vector.

Add this combine as part of AArch64 pre-legalizer combiner.

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

llvm-svn: 375066

4 years ago[lit] Improve lit.Run class
Julian Lettner [Thu, 17 Oct 2019 00:29:59 +0000 (00:29 +0000)]
[lit] Improve lit.Run class

* Push timing of overall test time into run module
* Make lit.Run a proper class
* Add a few TODO comments

llvm-svn: 375065

4 years ago[Reproducer] Set the working directory in the VFS
Jonas Devlieghere [Thu, 17 Oct 2019 00:24:37 +0000 (00:24 +0000)]
[Reproducer] Set the working directory in the VFS

Now that the VFS knows how to deal with virtual working directories, we
can set the current working directory to the one we recorded during
reproducer capture. This ensures that relative paths are resolved
correctly during replay.

llvm-svn: 375064

4 years ago[Concepts] ConceptSpecializationExprs mangling
Saar Raz [Thu, 17 Oct 2019 00:16:01 +0000 (00:16 +0000)]
[Concepts] ConceptSpecializationExprs mangling

Implement mangling for CSEs to match regular template-ids.
Reviewed as part of D41569 <https://reviews.llvm.org/D41569>.

Re-commit fixing failing test.

llvm-svn: 375063

4 years agoRevert "make ConstString allocate memory in non-tiny chunks"
Raphael Isemann [Thu, 17 Oct 2019 00:02:32 +0000 (00:02 +0000)]
Revert "make ConstString allocate memory in non-tiny chunks"

As discussed in https://reviews.llvm.org/D68549, the actual issue
here seems to be that the BumpPtrAllocator is growing far too slow
because of the 256 different StringPools used as the backend for ConstString.
At the same time the original patch made ConstString allocate memory in
256MiB slabs for the same reason, meaning that the RSS usage of LLDB increased
by a few hundred MiB for all users without bringing any noticeable speedup
for most of them.

llvm-svn: 375062

4 years ago[Reproducer] Support dumping the reproducer CWD
Jonas Devlieghere [Thu, 17 Oct 2019 00:02:00 +0000 (00:02 +0000)]
[Reproducer] Support dumping the reproducer CWD

Add support for dumping the current working directory with
`reproducer dump -p cwd`.

llvm-svn: 375061

4 years ago[Reproducer] Add LoadBuffer<> helper (NFC)
Jonas Devlieghere [Thu, 17 Oct 2019 00:01:57 +0000 (00:01 +0000)]
[Reproducer] Add LoadBuffer<> helper (NFC)

Introduce a helper method named LoadBuffer in the Loader to abstract
reading a reproducer file from disk.

llvm-svn: 375060

4 years ago[Reproducer] Capture the debugger's working directory
Jonas Devlieghere [Thu, 17 Oct 2019 00:01:53 +0000 (00:01 +0000)]
[Reproducer] Capture the debugger's working directory

This patch extends the reproducer to capture the debugger's current
working directory. This information will be used later to set the
current working directory of the VFS.

llvm-svn: 375059

4 years ago[lit] Fix another test case that r374652 missed
Joel E. Denny [Wed, 16 Oct 2019 23:58:58 +0000 (23:58 +0000)]
[lit] Fix another test case that r374652 missed

llvm-svn: 375058

4 years ago[gicombiner] Hoist pure C++ combine into the tablegen definition
Daniel Sanders [Wed, 16 Oct 2019 23:53:35 +0000 (23:53 +0000)]
[gicombiner] Hoist pure C++ combine into the tablegen definition

Summary:
This is just moving the existing C++ code around and will be NFC w.r.t
AArch64. Renamed 'CombineBr' to something more descriptive
('ElideByByInvertingCond') at the same time.

The remaining combines in AArch64PreLegalizeCombiner require features that
aren't implemented at this point and will be hoisted as they are added.

Depends on D68424

Reviewers: bogner, volkan

Subscribers: kristof.beyls, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 375057

4 years ago[lit] Remove unnecessary usage of lit.Run
Julian Lettner [Wed, 16 Oct 2019 23:31:32 +0000 (23:31 +0000)]
[lit] Remove unnecessary usage of lit.Run

llvm-svn: 375056

4 years ago[lit] Do not create semaphores when we do not need them
Julian Lettner [Wed, 16 Oct 2019 23:25:46 +0000 (23:25 +0000)]
[lit] Do not create semaphores when we do not need them

Parallelism groups and semaphores are only required for parallel
execution.

llvm-svn: 375055

4 years ago[lit] Factor out separate methods for parallel and serial execution
Julian Lettner [Wed, 16 Oct 2019 23:25:41 +0000 (23:25 +0000)]
[lit] Factor out separate methods for parallel and serial execution

llvm-svn: 375054

4 years ago[NFC] Fix unused var in release builds
Jordan Rupprecht [Wed, 16 Oct 2019 23:09:56 +0000 (23:09 +0000)]
[NFC] Fix unused var in release builds

llvm-svn: 375053

4 years agoRevert [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in...
Jordan Rupprecht [Wed, 16 Oct 2019 22:59:02 +0000 (22:59 +0000)]
Revert [support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

This reverts r375051 (git commit a409afaad64ce83ea44cc30ee5f96b6e613a6e98)

The patch does not work on Windows due to `\` in filenames being interpreted as escaping rather than literal path separators when used by lld linker scripts.

llvm-svn: 375052

4 years ago[support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places
Jordan Rupprecht [Wed, 16 Oct 2019 22:31:16 +0000 (22:31 +0000)]
[support] GlobPattern: add support for `\` and `[!...]`, and allow `]` in more places

Summary: Update GlobPattern in libSupport to handle a few more cases. It does not fully match the `fnmatch` used by GNU objcopy since named character classes (e.g. `[[:digit:]]`) are not supported, but this should support most existing use cases (mostly just `*` is what's used anyway).

This will be used to implement the `--wildcard` flag in llvm-objcopy to be more compatible with GNU objcopy.

This is split off of D66613 to land the libSupport changes separately. The llvm-objcopy part will land soon.

Reviewers: jhenderson, MaskRay, evgeny777, espindola, alexshap

Reviewed By: MaskRay

Subscribers: nickdesaulniers, emaste, arichardson, hiraditya, jakehehrlich, abrachet, seiya, llvm-commits

Tags: #llvm

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

undo objcopy changes to make this libsupport only

llvm-svn: 375051

4 years ago[Utils] Cleanup similar cases to MergeBlockIntoPredecessor.
Alina Sbirlea [Wed, 16 Oct 2019 22:23:20 +0000 (22:23 +0000)]
[Utils] Cleanup similar cases to MergeBlockIntoPredecessor.

Summary:
There are two cases where a block is merged into its predecessor and the
MergeBlockIntoPredecessor API is not used. Update the API so it can be
reused in the other cases, in order to avoid code duplication.

Cleanup motivated by D68659.

Reviewers: chandlerc, sanjoy.google, george.burgess.iv

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 375050

4 years ago[lit] Print warning if we fail to delete temp directory
Julian Lettner [Wed, 16 Oct 2019 22:20:28 +0000 (22:20 +0000)]
[lit] Print warning if we fail to delete temp directory

llvm-svn: 375049

4 years ago[lit] Skip creation of tmp dir if we don't actually run any tests
Julian Lettner [Wed, 16 Oct 2019 22:20:25 +0000 (22:20 +0000)]
[lit] Skip creation of tmp dir if we don't actually run any tests

llvm-svn: 375048

4 years ago[lit] Remove return value from print_summary function
Julian Lettner [Wed, 16 Oct 2019 21:58:21 +0000 (21:58 +0000)]
[lit] Remove return value from print_summary function

llvm-svn: 375047

4 years ago[lit] Small refactoring and cleanups in main.py
Julian Lettner [Wed, 16 Oct 2019 21:53:20 +0000 (21:53 +0000)]
[lit] Small refactoring and cleanups in main.py

* Remove outdated precautions for Python versions < 2.7
* Remove dead code related to `maxIndividualTestTime` option
* Move printing of test and result summary out of main into its own
  function

Reviewed By: rnk

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

llvm-svn: 375046

4 years agoUpdate ReleaseNotes: expand the section on enabling MemorySSA
Alina Sbirlea [Wed, 16 Oct 2019 21:52:09 +0000 (21:52 +0000)]
Update ReleaseNotes: expand the section on enabling MemorySSA

llvm-svn: 375045

4 years ago[dsymutil] Print warning/error for unknown/missing arguments.
Jonas Devlieghere [Wed, 16 Oct 2019 21:48:41 +0000 (21:48 +0000)]
[dsymutil] Print warning/error for unknown/missing arguments.

After changing dsymutil to use libOption, we lost error reporting for
missing required arguments (input files). Additionally, we stopped
complaining about unknown arguments. This patch fixes both and adds a
test.

llvm-svn: 375044

4 years ago[AArch64] Fix offset calculation
Shoaib Meenai [Wed, 16 Oct 2019 21:41:05 +0000 (21:41 +0000)]
[AArch64] Fix offset calculation

r374772 changed Offset to be an int64_t but left NewOffset as an int.
Scale is unsigned, so in the calculation `Offset - NewOffset * Scale`,
`NewOffset * Scale` was promoted to unsigned and was then zero-extended
to 64 bits, leading to an incorrect computation which manifested as an
out-of-memory when building the Swift standard library for Android
aarch64. Promote NewOffset to int64_t to fix this, and promote
EmittableOffset as well, since its one user passes it to a function
which takes an int64_t anyway.

Test case based on a suggestion by Sander de Smalen!

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

llvm-svn: 375043

4 years agoGlobalISel: Implement lower for G_SADDO/G_SSUBO
Matt Arsenault [Wed, 16 Oct 2019 20:46:32 +0000 (20:46 +0000)]
GlobalISel: Implement lower for G_SADDO/G_SSUBO

Port directly from SelectionDAG, minus the path using
ISD::SADDSAT/ISD::SSUBSAT.

llvm-svn: 375042

4 years ago[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.
Martin Storsjo [Wed, 16 Oct 2019 20:38:44 +0000 (20:38 +0000)]
[Symbolize] Use the local MSVC C++ demangler instead of relying on dbghelp. NFC.

This allows making a couple llvm-symbolizer tests run in all
environments.

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

llvm-svn: 375041

4 years agoRemove a stale comment, noted in post commit review for rL375038
Philip Reames [Wed, 16 Oct 2019 20:27:10 +0000 (20:27 +0000)]
Remove a stale comment, noted in post commit review for rL375038

llvm-svn: 375040

4 years ago[clangd] Add the missing dependency on `clangLex`.
Michael Liao [Wed, 16 Oct 2019 20:22:54 +0000 (20:22 +0000)]
[clangd] Add the missing dependency on `clangLex`.

llvm-svn: 375039

4 years ago[IndVars] Fix a miscompile in off-by-default loop predication implementation
Philip Reames [Wed, 16 Oct 2019 19:58:26 +0000 (19:58 +0000)]
[IndVars] Fix a miscompile in off-by-default loop predication implementation

The problem is that we can have two loop exits, 'a' and 'b', where 'a' and 'b' would exit at the same iteration, 'a' precedes 'b' along some path, and 'b' is predicated while 'a' is not. In this case (see the previously submitted test case), we causing the loop to exit through 'b' whereas it should have exited through 'a'.

This only applies to loop exits where the exit counts are not provably inequal, but that isn't as much of a restriction as it appears. If we could order the exit counts, we'd have already removed one of the two exits. In theory, we might be able to prove inequality w/o ordering, but I didn't really explore that piece. Instead, I went for the obvious restriction and ensured we didn't predicate exits following non-predicateable exits.

Credit goes to Evgeny Brevnov for figuring out the problematic case. Fuzzing probably also found it (failures seen), but due to some silly infrastructure problems I hadn't gotten to the results before Evgeny hand reduced it from a benchmark (he manually enabled the transform). Once this is fixed, I'll try to filter through the fuzzer failures to see if there's anything additional lurking.

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

llvm-svn: 375038

4 years ago[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFCI.
Martin Storsjo [Wed, 16 Oct 2019 19:39:56 +0000 (19:39 +0000)]
[LLDB] Use the llvm microsoft demangler instead of the windows dbghelp api. NFCI.

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

llvm-svn: 375034

4 years ago[AMDGPU] Do not combine dpp mov reading physregs
Stanislav Mekhanoshin [Wed, 16 Oct 2019 19:28:25 +0000 (19:28 +0000)]
[AMDGPU] Do not combine dpp mov reading physregs

We cannot be sure physregs will stay unchanged.

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

llvm-svn: 375033

4 years agoAdd arm64_32 support to lldb, an ILP32 codegen
Jason Molenda [Wed, 16 Oct 2019 19:14:49 +0000 (19:14 +0000)]
Add arm64_32 support to lldb, an ILP32 codegen
that runs on arm64 ISA targets, specifically
Apple watches.

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

llvm-svn: 375032

4 years agoReplace platform-dependent `stat` with `llvm::sys::fs::status`. NFC intended.
Volodymyr Sapsai [Wed, 16 Oct 2019 19:12:34 +0000 (19:12 +0000)]
Replace platform-dependent `stat` with `llvm::sys::fs::status`. NFC intended.

Reviewers: bruno, sammccall

Reviewed By: sammccall

Subscribers: jkorous, dexonsmith, arphaman, ributzka, cfe-commits

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

llvm-svn: 375031

4 years ago[AMDGPU] Do not combine dpp with physreg def
Stanislav Mekhanoshin [Wed, 16 Oct 2019 18:48:54 +0000 (18:48 +0000)]
[AMDGPU] Do not combine dpp with physreg def

We will remove dpp mov along with the physreg def otherwise.

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

llvm-svn: 375030

4 years ago[android/process list] support showing process arguments
Walter Erquinigo [Wed, 16 Oct 2019 18:47:05 +0000 (18:47 +0000)]
[android/process list] support showing process arguments

Summary:
The qfProcessInfo and qsProcessInfo packets currently don't set the processes' arguments, however the platform process list -v command tries to print it.
In this diff I'm adding the arguments as part of the packet, and now the command shows the arguments just like on mac.

On Mac:

507    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/secd
503    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/secinitd
501    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/languageassetd --firstLogin
497    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/trustd --agent
496    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/lsd
494    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /System/Library/Frameworks/CoreTelephony.framework/Support/CommCenter -L
491    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/sbin/distnoted agent
489    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/libexec/UserEventAgent (Aqua)
484    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /usr/sbin/cfprefsd agent
483    1      wallace    1876110778 wallace    1876110778 x86_64-apple-macosx      /System/Library/Frameworks/LocalAuthentication.framework/Support/coreauthd
On android:

1561   1016   root       0                     0          aarch64-unknown-linux-android  /system/bin/ip6tables-restore--noflush -w -v
1805   982    1000       1000                  1000                                      android:drmService
1811   982    10189      10189                 10189                                     com.qualcomm.embms:remote
1999   1      1000       1000                  1000       aarch64-unknown-linux-android  /system/bin/tlc_serverCCM
2332   982    10038      10038                 10038                                     com.android.systemui
2378   983    1053       1053                  1053                                      webview_zygote
2448   982    5013       5013                  5013                                      com.sec.location.nsflp2
2465   982    10027      10027                 10027                                     com.google.android.gms.persistent

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

llvm-svn: 375029

4 years ago[llvm-ar] Implement the V modifier as an alias for --version
Jordan Rupprecht [Wed, 16 Oct 2019 18:39:52 +0000 (18:39 +0000)]
[llvm-ar] Implement the V modifier as an alias for --version

Summary: Also update the help modifier (h) so that it works as a modifier and not just as a standalone `h`. For example, `llvm-ar h` prints the help message, but `llvm-ar xh` currently prints `unknown option h`.

Reviewers: MaskRay, gbreynoo

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 375028

4 years agoFix darwin-ld-lto test for some speical path
Steven Wu [Wed, 16 Oct 2019 18:12:41 +0000 (18:12 +0000)]
Fix darwin-ld-lto test for some speical path

Fix the test by not assuming the prefix path of the temp directory can
be matched by a regex.

rdar://problem/56259195

llvm-svn: 375027

4 years ago[OPENMP]Allow priority clause in combined task-based directives.
Alexey Bataev [Wed, 16 Oct 2019 18:09:37 +0000 (18:09 +0000)]
[OPENMP]Allow priority clause in combined task-based directives.

The expression of the priority clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 375026

4 years ago[SLP] avoid reduction transform on patterns that the backend can load-combine (2nd...
Sanjay Patel [Wed, 16 Oct 2019 18:06:24 +0000 (18:06 +0000)]
[SLP] avoid reduction transform on patterns that the backend can load-combine (2nd try)

The 1st attempt at this modified the cost model in a bad way to avoid the vectorization,
but that caused problems for other users (the loop vectorizer) of the cost model.

I don't see an ideal solution to these 2 related, potentially large, perf regressions:
https://bugs.llvm.org/show_bug.cgi?id=42708
https://bugs.llvm.org/show_bug.cgi?id=43146

We decided that load combining was unsuitable for IR because it could obscure other
optimizations in IR. So we removed the LoadCombiner pass and deferred to the backend.
Therefore, preventing SLP from destroying load combine opportunities requires that it
recognizes patterns that could be combined later, but not do the optimization itself (
it's not a vector combine anyway, so it's probably out-of-scope for SLP).

Here, we add a cost-independent bailout with a conservative pattern match for a
multi-instruction sequence that can probably be reduced later.

In the x86 tests shown (and discussed in more detail in the bug reports), SDAG combining
will produce a single instruction on these tests like:

  movbe   rax, qword ptr [rdi]

or:

  mov     rax, qword ptr [rdi]

Not some (half) vector monstrosity as we currently do using SLP:

  vpmovzxbq       ymm0, dword ptr [rdi + 1] # ymm0 = mem[0],zero,zero,..
  vpsllvq ymm0, ymm0, ymmword ptr [rip + .LCPI0_0]
  movzx   eax, byte ptr [rdi]
  movzx   ecx, byte ptr [rdi + 5]
  shl     rcx, 40
  movzx   edx, byte ptr [rdi + 6]
  shl     rdx, 48
  or      rdx, rcx
  movzx   ecx, byte ptr [rdi + 7]
  shl     rcx, 56
  or      rcx, rdx
  or      rcx, rax
  vextracti128    xmm1, ymm0, 1
  vpor    xmm0, xmm0, xmm1
  vpshufd xmm1, xmm0, 78          # xmm1 = xmm0[2,3,0,1]
  vpor    xmm0, xmm0, xmm1
  vmovq   rax, xmm0
  or      rax, rcx
  vzeroupper
  ret

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

llvm-svn: 375025

4 years ago[lldb] move more things from python to cmake
Haibo Huang [Wed, 16 Oct 2019 18:00:21 +0000 (18:00 +0000)]
[lldb] move more things from python to cmake

Summary: Move the copy of six.py, lldb.py and macosx/heap

Reviewers: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 375024

4 years ago[lit] Fix a test case that r374652 missed
Joel E. Denny [Wed, 16 Oct 2019 17:56:12 +0000 (17:56 +0000)]
[lit] Fix a test case that r374652 missed

llvm-svn: 375023

4 years agoTag CFI-generated data structures with "#pragma clang section" attributes.
Dmitry Mikulin [Wed, 16 Oct 2019 17:51:40 +0000 (17:51 +0000)]
Tag CFI-generated data structures with "#pragma clang section" attributes.

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

llvm-svn: 375022

4 years ago[NFC][XCOFF][AIX] Rename ControlSections to CsectGroup
Jason Liu [Wed, 16 Oct 2019 17:36:31 +0000 (17:36 +0000)]
[NFC][XCOFF][AIX] Rename ControlSections to CsectGroup

The name of ControlSections is not expressive enough to convey what they really are.
CsectGroup can better communicate the concept of grouping csects together since they have similar property.

Reviewer: daltenty

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

llvm-svn: 375021

4 years ago[lit] Fix internal diff's --strip-trailing-cr and use it
Joel E. Denny [Wed, 16 Oct 2019 17:21:57 +0000 (17:21 +0000)]
[lit] Fix internal diff's --strip-trailing-cr and use it

Using GNU diff, `--strip-trailing-cr` removes a `\r` appearing before
a `\n` at the end of a line.  Without this patch, lit's internal diff
only removes `\r` if it appears as the last character.  That seems
useless.  This patch fixes that.

This patch also adds `--strip-trailing-cr` to some tests that fail on
Windows bots when D68664 is applied.  Based on what I see in the bot
logs, I think the following is happening.  In each test there, lit
diff is comparing a file with `\r\n` line endings to a file with `\n`
line endings.  Without D68664, lit diff reads those files in text
mode, which in Windows causes `\r\n` to be replaced with `\n`.
However, with D68664, lit diff reads the files in binary mode instead
and thus reports that every line is different, just as GNU diff does
(at least under Ubuntu).  Adding `--strip-trailing-cr` to those tests
restores the previous behavior while permitting the behavior of lit
diff to be more like GNU diff.

Reviewed By: rnk

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

llvm-svn: 375020

4 years agoCombinerHelper - silence dead assignment warnings. NFCI.
Simon Pilgrim [Wed, 16 Oct 2019 17:21:50 +0000 (17:21 +0000)]
CombinerHelper - silence dead assignment warnings. NFCI.

Copy the NewAlignment value to Alignment first and then use that to update the stack frame object alignments.

llvm-svn: 375019

4 years ago[lit] Clean up internal diff's encoding handling
Joel E. Denny [Wed, 16 Oct 2019 17:21:24 +0000 (17:21 +0000)]
[lit] Clean up internal diff's encoding handling

As suggested by rnk at D67643#1673043, instead of reading files
multiple times until an appropriate encoding is found, read them once
as binary, and then try to decode what was read.

For Python >= 3.5, don't fail when attempting to decode the
`diff_bytes` output in order to print it.

Avoid failures for Python 2.7 used on some Windows bots by
transforming diff output with `lit.util.to_string` before writing it
to stdout.

Finally, add some tests for encoding handling.

Reviewed By: rnk

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

llvm-svn: 375018

4 years ago[OPENMP]Use different addresses for zeroed thread_id/bound_id.
Alexey Bataev [Wed, 16 Oct 2019 16:59:01 +0000 (16:59 +0000)]
[OPENMP]Use different addresses for zeroed thread_id/bound_id.

When the parallel region is called directly in the sequential region,
the zeroed tid/bound id are used. But they must point to the different
memory locations as the parameters are marked as noalias.

llvm-svn: 375017

4 years ago[AMDGPU] Supress unused sdwa insts generation
Stanislav Mekhanoshin [Wed, 16 Oct 2019 16:58:06 +0000 (16:58 +0000)]
[AMDGPU] Supress unused sdwa insts generation

Do not generate non-existing sdwa instructions. It reduces the
number of generated instructions by 185.

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

llvm-svn: 375016

4 years ago[Remarks] Fix warning for ambigous `else` behind EXPECT macro
Francis Visoiu Mistrih [Wed, 16 Oct 2019 16:43:34 +0000 (16:43 +0000)]
[Remarks] Fix warning for ambigous `else` behind EXPECT macro

http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/31902/steps/ninja%20check%201/logs/stdio

llvm-svn: 375015

4 years ago[Remarks] Fix unit test by only checking for the path
Francis Visoiu Mistrih [Wed, 16 Oct 2019 16:35:09 +0000 (16:35 +0000)]
[Remarks] Fix unit test by only checking for the path

http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/39536/steps/ninja%20check%201/logs/FAIL%3A%20LLVM-Unit%3A%3AYAMLRemarks.ParsingBadMeta

llvm-svn: 375014

4 years ago[SVE][IR] Small TypeSize improvements left out of initial commit
Graham Hunter [Wed, 16 Oct 2019 16:33:41 +0000 (16:33 +0000)]
[SVE][IR] Small TypeSize improvements left out of initial commit

The commit for D53137 left out the last round of improvements
requested by reviewers. Adding those in now.

llvm-svn: 375013

4 years ago[DWARF5] Added support for DW_AT_noreturn attribute to be emitted for
Adrian Prantl [Wed, 16 Oct 2019 16:30:38 +0000 (16:30 +0000)]
[DWARF5] Added support for DW_AT_noreturn attribute to be emitted for
C++ class member functions.

Patch by Sourabh Singh Tomar!

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

llvm-svn: 375012

4 years ago[Remarks] Use StringRef::contains to avoid differences in error string
Francis Visoiu Mistrih [Wed, 16 Oct 2019 16:18:12 +0000 (16:18 +0000)]
[Remarks] Use StringRef::contains to avoid differences in error string

Different OSs have different error strings:

http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/39534/steps/ninja%20check%201/logs/FAIL%3A%20LLVM-Unit%3A%3AYAMLRemarks.ParsingBadMeta

llvm-svn: 375011

4 years ago[AArch64,Assembler] Compiler support for ID_MMFR5_EL1
Mark Murray [Wed, 16 Oct 2019 15:59:06 +0000 (15:59 +0000)]
[AArch64,Assembler] Compiler support for ID_MMFR5_EL1

Summary: Add read-only system register ID_MMFR5_EL1 and unit tests.

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 375010

4 years ago[Codegen] Adjust saturation test. NFC.
David Green [Wed, 16 Oct 2019 15:50:42 +0000 (15:50 +0000)]
[Codegen] Adjust saturation test. NFC.

Add some extra sat tests and adjust some of the existing tests to use signext where it would naturally be.

llvm-svn: 375009

4 years ago[Remarks] Add support for prepending a path to external files
Francis Visoiu Mistrih [Wed, 16 Oct 2019 15:40:59 +0000 (15:40 +0000)]
[Remarks] Add support for prepending a path to external files

This helps with testing and debugging for paths that are assumed
absolute.

It also uses a FileError to provide the file path it's trying to open.

llvm-svn: 375008