Commit Graph

323062 Commits

Author SHA1 Message Date
Pavel Labath f46e8974de SymbolVendor: Remove the type list member
Summary:
Similarly to the compile unit lists, the list of types can also be
managed by the symbol file itself.

Since the only purpose of this list seems to be to maintain an owning
reference to all the types a symbol file has created (items are only
ever added to the list, never retrieved), I remove the passthrough
functions in SymbolVendor and Module. I also tighten the interface of
the function (return a reference instead of a pointer, make it protected
instead of public).

Reviewers: clayborg, JDevlieghere, jingham

Subscribers: lldb-commits

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

llvm-svn: 366994
2019-07-25 08:22:05 +00:00
Sjoerd Meijer 5c606cef79 [LV] Scalar Epilogue Lowering. NFC.
This refactors boolean 'OptForSize' that was passed around in a lot of places.
It controlled folding of the tail loop, the scalar epilogue, into the main loop
but code-size reasons may not be the only reason to do this. Thus, this is a
first step to generalise the concept of tail-loop folding, and hence OptForSize
has been renamed and is using an enum ScalarEpilogueStatus that holds the
status how the epilogue should be lowered.

This will be followed up by D65197, that picks up the predicate loop hint and
performs the tail-loop folding.

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

llvm-svn: 366993
2019-07-25 08:06:02 +00:00
Sam McCall 85d2fe7861 [clangd] Provide help text to users who run `clangd` in a terminal.
Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366992
2019-07-25 08:00:54 +00:00
Sam McCall 8faffec4e2 [clangd] Also accept flags from CLANGD_FLAGS variable.
This simplifies various workflows, particularly in debugging/development.
e.g. editors will tend to propagate flags, so you can run
`env CLANGD_FLAGS=-input-mirror-file=/tmp/mirror vim foo.cc` rather than
change the configuration in a persistent way.
(This also gives us a generic lever when we don't know how to customize
the flags in some particular LSP client).

While here, add a test for this and other startup logging, and fix a
couple of direct writes to errs() that should have been logs.

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

llvm-svn: 366991
2019-07-25 07:54:48 +00:00
Kai Luo 5c8af53806 [PowerPC][NFC] Added `getDefMIPostRA` method
Summary:
In PostRA phase, we often have to find out the most recent definition
of a register.  This patch adds getDefMIPostRA so that other methods
can use it rather than implementing it repeatedly.

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

llvm-svn: 366990
2019-07-25 07:47:52 +00:00
Sjoerd Meijer a48f58c97f [Clang] New loop pragma vectorize_predicate
This adds a new vectorize predication loop hint:

  #pragma clang loop vectorize_predicate(enable)

that can be used to indicate to the vectoriser that all (load/store)
instructions should be predicated (masked). This allows, for example, folding
of the remainder loop into the main loop.

This patch will be followed up with D64916 and D65197. The former is a
refactoring in the loopvectorizer and the groundwork to make tail loop folding
a more general concept, and in the latter the actual tail loop folding
transformation will be implemented.

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

llvm-svn: 366989
2019-07-25 07:33:13 +00:00
Fangrui Song 3e023a6dbc [ELF][MIPS] Improve tests
* Add --no-show-raw-insn to llvm-objdump -d tests
* When linking an executable with %t.so, the path %t.so will be recorded
  in the DT_NEEDED entry if %t.so doesn't have DT_SONAME. .dynstr will
  have varying lengths on different systems. Add -soname to make tests
  more robust.

llvm-svn: 366988
2019-07-25 07:12:23 +00:00
Seiya Nuta 21277e3ec2 [MC] Add MCInstrAnalysis::evaluateMemoryOperandAddress
Summary:
Add a new method which tries to compute the target address referenced by an operand.

This patch supports x86_64 RIP-relative addressing for now.

It is necessary to print referenced symbol names in llvm-objdump.

Reviewers: andreadb, MaskRay, grosbach, jgalenson, craig.topper

Reviewed By: MaskRay, craig.topper

Subscribers: bcain, rupprecht, jhenderson, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 366987
2019-07-25 06:57:09 +00:00
George Burgess IV cd16fadb9c [BasicAA] Temporarily disable two tests
These tests are breaking three independent upstream buildbots (as well
downstream ones). These breakages have appeared mysteriously,
consistently, and during different revisions. Sadly, none of
{ASAN,TSAN,MSAN,UBSAN} flag anything, so the cause here is nonobvious.

Until we've figured this out, it seems best to disable these tests
entirely, so that the affected bots don't remain silent about any other,
unrelated failures.

Please see PR42719 for more information.

llvm-svn: 366986
2019-07-25 06:53:59 +00:00
Pavel Labath ee74c9e5fd LLGS: fix tracking execve on linux
Summary:
Due to a logic error, lldb-server ended up asserting/crashing every time
the debugged process attempted an execve(). This fixes the error, and
extends TestExec to work on other platforms too. The "extension"
consists of avoiding non-standard posix_spawn extensions and using the
classic execve() call, which should be available on any platform that
actually supports re-execing. I change the test decorator from
@skipUnlessDarwin to @skipIfWindows.

Reviewers: clayborg, jasonmolenda

Subscribers: lldb-commits

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

llvm-svn: 366985
2019-07-25 06:38:33 +00:00
Seiya Nuta d5177643f0 [llvm-objdump][NFC] Make the PrettyPrinter::printInst() output buffered
Summary:
Every time PrettyPrinter::printInst is called, stdout is flushed and it makes llvm-objdump slow. This patches adds a string
buffer to prevent stdout from being flushed.

Benchmark results (./llvm-objdump-master: without this patch,  ./bin/llvm-objcopy: with this patch):

  $ hyperfine --warmup 10 './llvm-objdump-master -d ./bin/llvm-objcopy' './bin/llvm-objdump -d ./bin/llvm-objcopy'
  Benchmark #1: ./llvm-objdump-master -d ./bin/llvm-objcopy
    Time (mean ± σ):      2.230 s ±  0.050 s    [User: 1.533 s, System: 0.682 s]
    Range (min … max):    2.115 s …  2.278 s    10 runs

  Benchmark #2: ./bin/llvm-objdump -d ./bin/llvm-objcopy
    Time (mean ± σ):     386.4 ms ±  13.0 ms    [User: 376.6 ms, System: 6.1 ms]
    Range (min … max):   366.1 ms … 407.0 ms    10 runs

  Summary
    './bin/llvm-objdump -d ./bin/llvm-objcopy' ran
      5.77 ± 0.23 times faster than './llvm-objdump-master -d ./bin/llvm-objcopy'

Reviewers: alexshap, Bigcheese, jhenderson, rupprecht, grimar, MaskRay

Reviewed By: jhenderson, MaskRay

Subscribers: dexonsmith, jhenderson, javed.absar, kristof.beyls, rupprecht, llvm-commits

Tags: #llvm

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

llvm-svn: 366984
2019-07-25 06:38:27 +00:00
Fangrui Song 5b406d7058 cli-wrapper-mpxtable.cpp: fix file header
llvm-svn: 366983
2019-07-25 05:15:50 +00:00
Jonas Devlieghere 9870f6ad2c [TableGen] Fix comments/headers referencing clang (NFC)
Remove references to clang's TableGen implementation. Presumably these
files were originally copied over.

llvm-svn: 366982
2019-07-25 04:38:46 +00:00
Marshall Clow db99d3a2a2 Implement change #4 of P1466: Change weekday to accept both 0 and 7 as Sunday. Add accessors 'c_encoding' and 'iso_encoding' to provide different interpretations of the weekday. Remove 'operator unsigned'
llvm-svn: 366981
2019-07-25 03:26:05 +00:00
Joel E. Denny 272a9db115 [lit] Protect full test suite from FILECHECK_OPTS
lit's test suite calls lit multiple times for various sample test
suites.  `FILECHECK_OPTS` is safe for FileCheck calls in lit's test
suite.  It's not safe for FileCheck calls in the sample test suites,
whose output affects the results of lit's test suite.

Without this patch, only one such sample test suite is protected from
`FILECHECK_OPTS`, and I admit I haven't discovered other cases for
which I can produce false failures using `FILECHECK_OPTS`.  However,
it's hard to predict the future, especially false passes.  Thus, this
patch protects all existing and future sample test suites from
`FILECHECK_OPTS` (and the deprecated
`FILECHECK_DUMP_INPUT_ON_FAILURE`).

Reviewed By: probinson

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

llvm-svn: 366980
2019-07-25 03:14:32 +00:00
Petr Hosek f55f51b7be Revert "[Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss"
This reverts commit r366972 which broke the following tests:

  Clang :: CXX/dcl.decl/dcl.init/dcl.init.list/p7-0x.cpp
  Clang :: CXX/dcl.decl/dcl.init/dcl.init.list/p7-cxx11-nowarn.cpp

llvm-svn: 366979
2019-07-25 03:11:49 +00:00
Tom Stellard f181dd99cf github-upload-release.py: Fix script name in examples
llvm-svn: 366978
2019-07-25 01:49:49 +00:00
Tom Stellard 925ccdbfd7 Add github-release.py script
Summary:
This script can be used for uploading relases sources and binaries
to github.

Reviewers: hans

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 366977
2019-07-25 01:43:36 +00:00
Chen Zheng a2d74d3d90 [PowerPC] exclude more icmps in LSR which is converted in later hardware loop pass
Differential Revision: https://reviews.llvm.org/D64795

llvm-svn: 366976
2019-07-25 01:22:08 +00:00
Jonas Devlieghere e9be72a3b3 [FileCollector] Remove LLDB shim around llvm::FileCollector (NFC)
The FileCollector got lifted into LLVM and a shim was introduced in LLDB
to keep the old API that takes FileSpecs. This patch removes that shim
and converts the arguments in place.

llvm-svn: 366975
2019-07-25 01:08:10 +00:00
Jonas Devlieghere 69b63da167 [FileSystem] Fix ambiguous symbol on Windows.
The using declarations make FileCollector ambiguous. Specify that
FileSystem takes an lldb_private::FileCollector.

llvm-svn: 366974
2019-07-25 00:56:31 +00:00
Jonas Devlieghere 3e4e0478bb [FileCollector] Update unit test to match coding style.
I changed the FileCollector coding style but didn't update the
corresponding unit test.

llvm-svn: 366973
2019-07-25 00:46:58 +00:00
Ziang Wan 2028d97d09 [Sema] Enable -Wimplicit-float-conversion for integral to floating point precision loss
Issue an warning when the code tries to do an implicit int -> float
conversion, where the float type ha a narrower significant than the
float type.

The new warning is controlled by flag -Wimplicit-int-float-conversion,
under -Wimplicit-float-conversion and -Wconversion.

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

llvm-svn: 366972
2019-07-25 00:32:50 +00:00
Shoaib Meenai 5aee1c6b10 [llvm-lipo] Implement alignment function in -create
Summary:
Removes hard coded valuse for alignment in -create.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

llvm-svn: 366970
2019-07-25 00:29:19 +00:00
Shoaib Meenai a67f6f1746 [Object] Add public MaxSectionAlignment to MachOUniversal
Change MAXSECTALIGN to a public MaxSectionAlignment in MachOUniversal.
Will be used in a follow-up.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

llvm-svn: 366969
2019-07-25 00:29:13 +00:00
Shoaib Meenai 7418b10b16 [llvm-lipo] Add test for -verify_archs
Add test to verify clean failure, exit code 1 for valid architecture not
present in the universal binary.

Patch by Anusha Basana <anusha.basana@gmail.com>

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

llvm-svn: 366968
2019-07-25 00:29:07 +00:00
Julian Lettner 758f6da687 [sanitizer_common] Allow customization of StartSymbolizerSubprocess
Summary:
Make SymbolizerProcess::StartSymbolizerSubprocess virtual and protected
to allow subclasses to customize it via "override and call".

Subscribers: kubamracek, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 366967
2019-07-25 00:19:02 +00:00
Jonas Devlieghere eb1b4c5d4c [FileCollector] Change coding style from LLDB to LLVM (NFC)
This patch changes the coding style of the FileCollector from the LLDB
to the LLVM coding style. Alex recently lifted it into LLVM and I
volunteered to do the conversion.

llvm-svn: 366966
2019-07-25 00:17:39 +00:00
Francis Visoiu Mistrih ab56cf8914 [Remarks][NFC] Rename remarks::Parser to remarks::RemarkParser
llvm-svn: 366965
2019-07-25 00:16:56 +00:00
Philip Reames 85fd8cea0b [docs] Split out a section on LoopInfo in the new loop documentation
llvm-svn: 366964
2019-07-24 23:46:13 +00:00
Eli Friedman 82e109279d [ARM] Remove dead code from ARMConstantIslands.
tLDRHi is not a pc-relative load; it can't directly refer to a
constant pool or jump table.

llvm-svn: 366963
2019-07-24 23:36:14 +00:00
Evandro Menezes 5cd5f9b65d [InstCombine] Swap order of checks to improve compile time (NFC)
llvm-svn: 366962
2019-07-24 23:31:04 +00:00
Philip Reames 904494944b Apply a few more reviewer suggestions from D65164
llvm-svn: 366961
2019-07-24 23:30:56 +00:00
Philip Reames 58b4787a22 Define some basic terminology around loops in our documentation
I've noticed a lot of confusion around this area recently with key terms being misused in a number of threads. To help reign that in, let's go ahead and document the current terminology and meaning thereof.

My hope is to grow this over time into a broader discussion of canonical loop forms - yes, there are more than one ... many more than one - but for the moment, simply having the key terminology is a good stopping place.

Note: I am landing this *without* an LGTM.  All feedback so far has been positive, and trying to apply all of the suggested changes/extensions would cause the review to never end.  Instead, I decided to land it with the obvious fixes made based on reviewer comments, then iterate from there.

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

llvm-svn: 366960
2019-07-24 23:24:13 +00:00
Jessica Paquette 728b18f29f [AArch64][GlobalISel] Select immediate modes for ADD when selecting G_GEP
Before, we weren't able to select things like this for G_GEP:

add	x0, x8, #8

And instead we'd materialize the 8.

This teaches GISel to do that. It gives some considerable code size savings
on 252.eon-- about 4%!

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

llvm-svn: 366959
2019-07-24 23:11:01 +00:00
Alex Lorenz 75c64a66c1 Fix unittest build issue in r366956
I marked the fields as private, but they're needed by the unittest.
I'll have to fix that up separarely in a follow-up.

llvm-svn: 366958
2019-07-24 23:10:35 +00:00
Amara Emerson de81bd0faa [AArch64][GlobalISel] Don't try to use GISel if subtarget doesn't have neon or fp.
Throughout the legalizerinfo we currently make the assumption that the target
has neon and FP target features available. Fixing it will require a refactor of
the whole thing, so until then make sure we fall back.

Works around PR42734

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

llvm-svn: 366957
2019-07-24 23:00:04 +00:00
Alex Lorenz 86814bf658 [Support] move FileCollector from LLDB to llvm/Support
The file collector class is useful for creating reproducers,
not just for LLDB, but for other tools as well in LLVM/Clang.

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

llvm-svn: 366956
2019-07-24 22:59:20 +00:00
Roman Lebedev 017e272c3a [Codegen] (X & (C l>>/<< Y)) ==/!= 0 --> ((X <</l>> Y) & C) ==/!= 0 fold
Summary:
This was originally reported in D62818.
https://rise4fun.com/Alive/oPH

InstCombine does the opposite fold, in hope that `C l>>/<< Y` expression
will be hoisted out of a loop if `Y` is invariant and `X` is not.
But as it is seen from the diffs here, if it didn't get hoisted,
the produced assembly is almost universally worse.

Much like with my recent "hoist add/sub by/from const" patches,
we should get almost universal win if we hoist constant,
there is almost always an "and/test by imm" instruction,
but "shift of imm" not so much, so we may avoid having to
materialize the immediate, and thus need one less register.
And since we now shift not by constant, but by something else,
the live-range of that something else may reduce.

Special care needs to be applied not to disturb x86 `BT` / hexagon `tstbit`
instruction pattern. And to not get into endless combine loop.

Reviewers: RKSimon, efriedma, t.p.northover, craig.topper, spatel, arsenm

Reviewed By: spatel

Subscribers: hiraditya, MaskRay, wuzish, xbolva00, nikic, nemanjai, jvesely, wdng, nhaehnle, javed.absar, tpr, kristof.beyls, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 366955
2019-07-24 22:57:22 +00:00
Jessica Paquette 68499112cf [AArch64][GlobalISel] Fold G_MUL into XRO load addressing mode when possible
If we have a G_MUL, and either the LHS or the RHS of that mul is the legal
shift value for a load addressing mode, we can fold it into the load.

This gives some code size savings on some SPEC tests. The best are around 2%
on 300.twolf and 3% on 254.gap.

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

llvm-svn: 366954
2019-07-24 22:49:42 +00:00
Azharuddin Mohammed 5f4426e517 Revert "NFC: utils/perf-training: Python 3 compatibility for lit.cfg"
This reverts commit 9178b10163 (r365969).

We are back to using Python2 and this is failing. This should instead be made
to be compatible with both Python 2 and 3.

llvm-svn: 366953
2019-07-24 22:42:50 +00:00
Peter Collingbourne 72391ab4f1 IR: Teach GlobalIndirectSymbol::getBaseObject() to handle more kinds of expressions.
For aliases, any expression that lowers at the MC level to global_object or
global_object+constant is valid at the object file level. getBaseObject()
should return a result if the aliasee ends up being of that form even if
the IR used to produce it is somewhat unconventional.

Note that this is different from what stripInBoundsOffsets() and that family
of functions is doing. Those functions are concerned about semantic properties
of IR, whereas here we only care about the lowering result.

Therefore reimplement getBaseObject() in a way that matches the lowering
result. This fixes a crash when producing a summary for aliases such as
that in the included test case.

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

llvm-svn: 366952
2019-07-24 22:23:05 +00:00
Amara Emerson 13af1ed8e3 [GlobalISel] Support for inlining memcpy, memset and memmove calls.
This introduces a new family of combiner helper routines that re-use the
target specific cost model from SelectionDAG, and generate inline implementations
of the memcpy family of intrinsics.

The combines are only enabled at optimization levels higher than -O0, and give
very substantial performance improvements.

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

llvm-svn: 366951
2019-07-24 22:17:31 +00:00
Alex Langford eb6782758a [Symbol] Fix some botched logic in Variable::GetLanguage
Summary:
I messed up the logic for this. Fixing with some improvements suggested
by Pavel.

Reviewers: labath, jdoerfert

Subscribers: lldb-commits

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

llvm-svn: 366950
2019-07-24 22:12:02 +00:00
Sanjay Patel 86e9f9dc26 [Transforms] move copying of load metadata to helper function; NFC
There's another proposed load combine that can make use of this code
in D64432.

llvm-svn: 366949
2019-07-24 22:11:11 +00:00
Guanzhong Chen 87186b2447 [WebAssembly] Set __tls_align to 1 when there is no TLS
Summary:
We want the tool conventions to state that `__tls_align` will be a power of 2.
It makes sense to not have an exception for when there is no TLS.

Reviewers: tlively, sunfish

Reviewed By: tlively

Subscribers: dschuff, sbc100, jgravelle-google, aheejin, llvm-commits

Tags: #llvm

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

llvm-svn: 366948
2019-07-24 21:48:14 +00:00
Evandro Menezes 5202b55ca6 [CodeGen] Add missing comment (NFC)
Add similar comments on the load limits pertaining to `memcmp()` similar to
those for other string functions.

llvm-svn: 366947
2019-07-24 21:45:14 +00:00
Francis Visoiu Mistrih 62388e3846 [Remarks] Add support for serializing metadata for every remark streamer
This allows every serializer format to implement metaSerializer() and
return the corresponding meta serializer.

llvm-svn: 366946
2019-07-24 21:29:44 +00:00
Craig Topper e9abc8177a [InstCombine] Teach foldOrOfICmps to allow icmp eq MIN_INT/MAX to be part of a range comparision. Similar for foldAndOfICmps
We can treat icmp eq X, MIN_UINT as icmp ule X, MIN_UINT and allow
it to merge with icmp ugt X, C. Similar for the other constants.

We can do simliar for icmp ne X, (U)INT_MIN/MAX in foldAndOfICmps. And we already handled UINT_MIN there.

Fixes PR42691.

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

llvm-svn: 366945
2019-07-24 20:57:29 +00:00
Alexander Richardson a8104b4927 [LLD] Do not print additional newlines after reaching error limit
Summary:
This could previously happen if errors that are emitted after reaching the
error limit. In that case, the flag inside the newline() function will be
set to true which causes the next call to print a newline even though the
actual message will be discarded.

Reviewers: ruiu, grimar, MaskRay, espindola

Reviewed By: ruiu

Subscribers: emaste, llvm-commits

Tags: #llvm

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

llvm-svn: 366944
2019-07-24 20:56:23 +00:00