platform/upstream/llvm.git
4 years ago[clangd] Fix the annotate tweak after rL366893
Haojian Wu [Thu, 25 Jul 2019 08:48:05 +0000 (08:48 +0000)]
[clangd] Fix the annotate tweak after rL366893

Summary:
After rL366893, the annoate tweak is not activated when we select the
whole file (the commonAncestor is TUDecl but we intend to return null).

This patch fixes this, and also avoid traversing the TUDecl.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 366996

4 years ago[PowerPC][NFC] Make `getDefMIPostRA` public
Kai Luo [Thu, 25 Jul 2019 08:36:44 +0000 (08:36 +0000)]
[PowerPC][NFC] Make `getDefMIPostRA` public

llvm-svn: 366995

4 years agoSymbolVendor: Remove the type list member
Pavel Labath [Thu, 25 Jul 2019 08:22:05 +0000 (08:22 +0000)]
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

4 years ago[LV] Scalar Epilogue Lowering. NFC.
Sjoerd Meijer [Thu, 25 Jul 2019 08:06:02 +0000 (08:06 +0000)]
[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

4 years ago[clangd] Provide help text to users who run `clangd` in a terminal.
Sam McCall [Thu, 25 Jul 2019 08:00:54 +0000 (08:00 +0000)]
[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

4 years ago[clangd] Also accept flags from CLANGD_FLAGS variable.
Sam McCall [Thu, 25 Jul 2019 07:54:48 +0000 (07:54 +0000)]
[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

4 years ago[PowerPC][NFC] Added `getDefMIPostRA` method
Kai Luo [Thu, 25 Jul 2019 07:47:52 +0000 (07:47 +0000)]
[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

4 years ago[Clang] New loop pragma vectorize_predicate
Sjoerd Meijer [Thu, 25 Jul 2019 07:33:13 +0000 (07:33 +0000)]
[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

4 years ago[ELF][MIPS] Improve tests
Fangrui Song [Thu, 25 Jul 2019 07:12:23 +0000 (07:12 +0000)]
[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

4 years ago[MC] Add MCInstrAnalysis::evaluateMemoryOperandAddress
Seiya Nuta [Thu, 25 Jul 2019 06:57:09 +0000 (06:57 +0000)]
[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

4 years ago[BasicAA] Temporarily disable two tests
George Burgess IV [Thu, 25 Jul 2019 06:53:59 +0000 (06:53 +0000)]
[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

4 years agoLLGS: fix tracking execve on linux
Pavel Labath [Thu, 25 Jul 2019 06:38:33 +0000 (06:38 +0000)]
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

4 years ago[llvm-objdump][NFC] Make the PrettyPrinter::printInst() output buffered
Seiya Nuta [Thu, 25 Jul 2019 06:38:27 +0000 (06:38 +0000)]
[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

4 years agocli-wrapper-mpxtable.cpp: fix file header
Fangrui Song [Thu, 25 Jul 2019 05:15:50 +0000 (05:15 +0000)]
cli-wrapper-mpxtable.cpp: fix file header

llvm-svn: 366983

4 years ago[TableGen] Fix comments/headers referencing clang (NFC)
Jonas Devlieghere [Thu, 25 Jul 2019 04:38:46 +0000 (04:38 +0000)]
[TableGen] Fix comments/headers referencing clang (NFC)

Remove references to clang's TableGen implementation. Presumably these
files were originally copied over.

llvm-svn: 366982

4 years agoImplement change #4 of P1466: Change weekday to accept both 0 and 7 as Sunday. Add...
Marshall Clow [Thu, 25 Jul 2019 03:26:05 +0000 (03:26 +0000)]
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

4 years ago[lit] Protect full test suite from FILECHECK_OPTS
Joel E. Denny [Thu, 25 Jul 2019 03:14:32 +0000 (03:14 +0000)]
[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

4 years agoRevert "[Sema] Enable -Wimplicit-float-conversion for integral to floating point...
Petr Hosek [Thu, 25 Jul 2019 03:11:49 +0000 (03:11 +0000)]
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

4 years agogithub-upload-release.py: Fix script name in examples
Tom Stellard [Thu, 25 Jul 2019 01:49:49 +0000 (01:49 +0000)]
github-upload-release.py: Fix script name in examples

llvm-svn: 366978

4 years agoAdd github-release.py script
Tom Stellard [Thu, 25 Jul 2019 01:43:36 +0000 (01:43 +0000)]
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

4 years ago[PowerPC] exclude more icmps in LSR which is converted in later hardware loop pass
Chen Zheng [Thu, 25 Jul 2019 01:22:08 +0000 (01:22 +0000)]
[PowerPC] exclude more icmps in LSR which is converted in later hardware loop pass
Differential Revision: https://reviews.llvm.org/D64795

llvm-svn: 366976

4 years ago[FileCollector] Remove LLDB shim around llvm::FileCollector (NFC)
Jonas Devlieghere [Thu, 25 Jul 2019 01:08:10 +0000 (01:08 +0000)]
[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

4 years ago[FileSystem] Fix ambiguous symbol on Windows.
Jonas Devlieghere [Thu, 25 Jul 2019 00:56:31 +0000 (00:56 +0000)]
[FileSystem] Fix ambiguous symbol on Windows.

The using declarations make FileCollector ambiguous. Specify that
FileSystem takes an lldb_private::FileCollector.

llvm-svn: 366974

4 years ago[FileCollector] Update unit test to match coding style.
Jonas Devlieghere [Thu, 25 Jul 2019 00:46:58 +0000 (00:46 +0000)]
[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

4 years ago[Sema] Enable -Wimplicit-float-conversion for integral to floating point precision...
Ziang Wan [Thu, 25 Jul 2019 00:32:50 +0000 (00:32 +0000)]
[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

4 years ago[llvm-lipo] Implement alignment function in -create
Shoaib Meenai [Thu, 25 Jul 2019 00:29:19 +0000 (00:29 +0000)]
[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

4 years ago[Object] Add public MaxSectionAlignment to MachOUniversal
Shoaib Meenai [Thu, 25 Jul 2019 00:29:13 +0000 (00:29 +0000)]
[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

4 years ago[llvm-lipo] Add test for -verify_archs
Shoaib Meenai [Thu, 25 Jul 2019 00:29:07 +0000 (00:29 +0000)]
[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

4 years ago[sanitizer_common] Allow customization of StartSymbolizerSubprocess
Julian Lettner [Thu, 25 Jul 2019 00:19:02 +0000 (00:19 +0000)]
[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

4 years ago[FileCollector] Change coding style from LLDB to LLVM (NFC)
Jonas Devlieghere [Thu, 25 Jul 2019 00:17:39 +0000 (00:17 +0000)]
[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

4 years ago[Remarks][NFC] Rename remarks::Parser to remarks::RemarkParser
Francis Visoiu Mistrih [Thu, 25 Jul 2019 00:16:56 +0000 (00:16 +0000)]
[Remarks][NFC] Rename remarks::Parser to remarks::RemarkParser

llvm-svn: 366965

4 years ago[docs] Split out a section on LoopInfo in the new loop documentation
Philip Reames [Wed, 24 Jul 2019 23:46:13 +0000 (23:46 +0000)]
[docs] Split out a section on LoopInfo in the new loop documentation

llvm-svn: 366964

4 years ago[ARM] Remove dead code from ARMConstantIslands.
Eli Friedman [Wed, 24 Jul 2019 23:36:14 +0000 (23:36 +0000)]
[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

4 years ago[InstCombine] Swap order of checks to improve compile time (NFC)
Evandro Menezes [Wed, 24 Jul 2019 23:31:04 +0000 (23:31 +0000)]
[InstCombine] Swap order of checks to improve compile time (NFC)

llvm-svn: 366962

4 years agoApply a few more reviewer suggestions from D65164
Philip Reames [Wed, 24 Jul 2019 23:30:56 +0000 (23:30 +0000)]
Apply a few more reviewer suggestions from D65164

llvm-svn: 366961

4 years agoDefine some basic terminology around loops in our documentation
Philip Reames [Wed, 24 Jul 2019 23:24:13 +0000 (23:24 +0000)]
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

4 years ago[AArch64][GlobalISel] Select immediate modes for ADD when selecting G_GEP
Jessica Paquette [Wed, 24 Jul 2019 23:11:01 +0000 (23:11 +0000)]
[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

4 years agoFix unittest build issue in r366956
Alex Lorenz [Wed, 24 Jul 2019 23:10:35 +0000 (23:10 +0000)]
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

4 years ago[AArch64][GlobalISel] Don't try to use GISel if subtarget doesn't have neon or fp.
Amara Emerson [Wed, 24 Jul 2019 23:00:04 +0000 (23:00 +0000)]
[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

4 years ago[Support] move FileCollector from LLDB to llvm/Support
Alex Lorenz [Wed, 24 Jul 2019 22:59:20 +0000 (22:59 +0000)]
[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

4 years ago[Codegen] (X & (C l>>/<< Y)) ==/!= 0 --> ((X <</l>> Y) & C) ==/!= 0 fold
Roman Lebedev [Wed, 24 Jul 2019 22:57:22 +0000 (22:57 +0000)]
[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

4 years ago[AArch64][GlobalISel] Fold G_MUL into XRO load addressing mode when possible
Jessica Paquette [Wed, 24 Jul 2019 22:49:42 +0000 (22:49 +0000)]
[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

4 years agoRevert "NFC: utils/perf-training: Python 3 compatibility for lit.cfg"
Azharuddin Mohammed [Wed, 24 Jul 2019 22:42:50 +0000 (22:42 +0000)]
Revert "NFC: utils/perf-training: Python 3 compatibility for lit.cfg"

This reverts commit 9178b10163f758cbf8a5290ea6a827990427ddc0 (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

4 years agoIR: Teach GlobalIndirectSymbol::getBaseObject() to handle more kinds of expressions.
Peter Collingbourne [Wed, 24 Jul 2019 22:23:05 +0000 (22:23 +0000)]
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

4 years ago[GlobalISel] Support for inlining memcpy, memset and memmove calls.
Amara Emerson [Wed, 24 Jul 2019 22:17:31 +0000 (22:17 +0000)]
[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

4 years ago[Symbol] Fix some botched logic in Variable::GetLanguage
Alex Langford [Wed, 24 Jul 2019 22:12:02 +0000 (22:12 +0000)]
[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

4 years ago[Transforms] move copying of load metadata to helper function; NFC
Sanjay Patel [Wed, 24 Jul 2019 22:11:11 +0000 (22:11 +0000)]
[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

4 years ago[WebAssembly] Set __tls_align to 1 when there is no TLS
Guanzhong Chen [Wed, 24 Jul 2019 21:48:14 +0000 (21:48 +0000)]
[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

4 years ago[CodeGen] Add missing comment (NFC)
Evandro Menezes [Wed, 24 Jul 2019 21:45:14 +0000 (21:45 +0000)]
[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

4 years ago[Remarks] Add support for serializing metadata for every remark streamer
Francis Visoiu Mistrih [Wed, 24 Jul 2019 21:29:44 +0000 (21:29 +0000)]
[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

4 years ago[InstCombine] Teach foldOrOfICmps to allow icmp eq MIN_INT/MAX to be part of a range...
Craig Topper [Wed, 24 Jul 2019 20:57:29 +0000 (20:57 +0000)]
[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

4 years ago[LLD] Do not print additional newlines after reaching error limit
Alexander Richardson [Wed, 24 Jul 2019 20:56:23 +0000 (20:56 +0000)]
[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

4 years ago[AArch64][GlobalISel] Fix a crash during s128 G_ICMP legalization due to r366317.
Amara Emerson [Wed, 24 Jul 2019 20:46:42 +0000 (20:46 +0000)]
[AArch64][GlobalISel] Fix a crash during s128 G_ICMP legalization due to r366317.

r366317 added a legalization for s128 G_ICMP narrow scalar which tried to hard
code the result type of the new legalized G_SELECT. Change this to instead use
type of the original G_ICMP result and allow the target to legalize it if necessary
later.

llvm-svn: 366943

4 years agoLet CorrelatedValuePropagation preserve LazyValueInfo
David Bolvansky [Wed, 24 Jul 2019 20:27:32 +0000 (20:27 +0000)]
Let CorrelatedValuePropagation preserve LazyValueInfo

Summary:
This patch makes CorrelatedValuePropagation preserve LazyValueInfo by adding LazyValueInfo::eraseValue & calling it whenever an instruction is erased.

Passes `make check` , test-suite, and SPECrate 2017.

Patch by aqjune (Juneyoung Lee)

Reviewers: reames, mzolotukhin

Reviewed By: reames

Subscribers: xbolva00, llvm-commits

Tags: #llvm

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

llvm-svn: 366942

4 years agoFix exporting SARIF files from scan-build on Windows.
Aaron Ballman [Wed, 24 Jul 2019 20:03:27 +0000 (20:03 +0000)]
Fix exporting SARIF files from scan-build on Windows.

In Perl, -z is defined as checking if a "file has zero size" and makes no mention what it does when given a directory. It looks like the behavior differs across platforms, which is why on Windows the SARIF file was always being deleted.

Patch by Joe Ranieri.

llvm-svn: 366941

4 years ago[Remarks][NFC] Rename remarks::Serializer to remarks::RemarkSerializer
Francis Visoiu Mistrih [Wed, 24 Jul 2019 19:47:57 +0000 (19:47 +0000)]
[Remarks][NFC] Rename remarks::Serializer to remarks::RemarkSerializer

llvm-svn: 366939

4 years ago[AMDGPU] Increase kernel padding
Stanislav Mekhanoshin [Wed, 24 Jul 2019 19:40:13 +0000 (19:40 +0000)]
[AMDGPU] Increase kernel padding

To support prefetch mode 3 we need to pad current
cacheline and fill 3 cachelines after. Current padding
is only sufficient for mode 2.

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

llvm-svn: 366938

4 years agoRevert "[yaml2obj] - Allow custom fields for the SHT_UNDEF sections."
JF Bastien [Wed, 24 Jul 2019 18:29:33 +0000 (18:29 +0000)]
Revert "[yaml2obj] - Allow custom fields for the SHT_UNDEF sections."

It fails on macOS with the following error:
  https://reviews.llvm.org/D65140#1599522

llvm-svn: 366937

4 years ago[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)
Jonas Devlieghere [Wed, 24 Jul 2019 17:56:10 +0000 (17:56 +0000)]
[Logging] Replace Log::Printf with LLDB_LOG macro (NFC)

This patch replaces explicit calls to log::Printf with the new LLDB_LOGF
macro. The macro is similar to LLDB_LOG but supports printf-style format
strings, instead of formatv-style format strings.

So instead of writing:

  if (log)
    log->Printf("%s\n", str);

You'd write:

  LLDB_LOG(log, "%s\n", str);

This change was done mechanically with the command below. I replaced the
spurious if-checks with vim, since I know how to do multi-line
replacements with it.

  find . -type f -name '*.cpp' -exec \
  sed -i '' -E 's/log->Printf\(/LLDB_LOGF\(log, /g' "{}" +

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

llvm-svn: 366936

4 years agoFix signed/unsigned comparison warning. NFCI.
Simon Pilgrim [Wed, 24 Jul 2019 17:44:22 +0000 (17:44 +0000)]
Fix signed/unsigned comparison warning. NFCI.

llvm-svn: 366935

4 years ago[ARM] Rewrite how VCMP are lowered, using a single node
David Green [Wed, 24 Jul 2019 17:36:47 +0000 (17:36 +0000)]
[ARM] Rewrite how VCMP are lowered, using a single node

This removes the VCEQ/VCNE/VCGE/VCEQZ/etc nodes, just using two called VCMP and
VCMPZ with an extra operand as the condition code. I believe this will make
some combines simpler, allowing us to just look at these codes and not the
operands. It also helps fill in a missing VCGTUZ MVE selection without adding
extra nodes for it.

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

llvm-svn: 366934

4 years ago[DAGCombine] matchBinOpReduction - add partial reduction matching
Simon Pilgrim [Wed, 24 Jul 2019 17:29:56 +0000 (17:29 +0000)]
[DAGCombine] matchBinOpReduction - add partial reduction matching

This patch adds support for recognizing cases where a larger vector type is being used to reduce just the elements in the lower subvector:

e.g. <8 x i32> reduction pattern in a <16 x i32> vector:

<4,5,6,7,u,u,u,u,u,u,u,u,u,u,u,u>
<2,3,u,u,u,u,u,u,u,u,u,u,u,u,u,u>
<1,u,u,u,u,u,u,u,u,u,u,u,u,u,u,u>

matchBinOpReduction returns the lower extracted subvector in such cases, assuming isExtractSubvectorCheap accepts the extraction.

I've only enabled it for X86 reduction sums so far. I intend to enable it for the bitop/minmax cases in future patches, and eventually I think its worth turning it on all the time. This is mainly just a case of ensuring calls to matchBinOpReduction don't make assumptions on the vector width based on the original vector extraction.

Fixes the x86 partial reduction sum cases in PR33758 and PR42023.

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

llvm-svn: 366933

4 years ago[lldb] Configure debugserver_vers.c from CMake
Stefan Granitz [Wed, 24 Jul 2019 17:28:24 +0000 (17:28 +0000)]
[lldb] Configure debugserver_vers.c from CMake

llvm-svn: 366932

4 years ago[ARM] Disable MVE fptosi and friends
David Green [Wed, 24 Jul 2019 17:26:26 +0000 (17:26 +0000)]
[ARM] Disable MVE fptosi and friends

The prevents us from trying to convert an i1 predicate vector to a float, or
vice-versa. Better patterns are possible, which will follow in a subsequent
commit. For now we just expand them.

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

llvm-svn: 366931

4 years ago[AArch64][GlobalISel] Make vector dup optimization look at last elt of ZeroVec
Jessica Paquette [Wed, 24 Jul 2019 17:18:51 +0000 (17:18 +0000)]
[AArch64][GlobalISel] Make vector dup optimization look at last elt of ZeroVec

Fix an off-by-one error which made us not look at the last element of the
zero vector. This caused a miscompile in 188.ammp.

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

llvm-svn: 366930

4 years agoclang-format: Add another test like r366926
Nico Weber [Wed, 24 Jul 2019 17:15:47 +0000 (17:15 +0000)]
clang-format: Add another test like r366926

llvm-svn: 366929

4 years ago[ARM] More MVE compare vector splat combines for ANDs
David Green [Wed, 24 Jul 2019 17:08:09 +0000 (17:08 +0000)]
[ARM] More MVE compare vector splat combines for ANDs

Adds some extra r register compare combines, this time for ANDs.

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

llvm-svn: 366928

4 years agogn build: Merge r366919
Nico Weber [Wed, 24 Jul 2019 17:04:44 +0000 (17:04 +0000)]
gn build: Merge r366919

llvm-svn: 366927

4 years agoclang-format: Add a test that shows that some code I thought was dead is not dead.
Nico Weber [Wed, 24 Jul 2019 17:01:57 +0000 (17:01 +0000)]
clang-format: Add a test that shows that  some code I thought was dead is not dead.

llvm-svn: 366926

4 years ago[InstCombine] Adjusted pow-exp tests for Windows [NFC]
David Bolvansky [Wed, 24 Jul 2019 17:01:20 +0000 (17:01 +0000)]
[InstCombine] Adjusted pow-exp tests for Windows [NFC]

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

Reviewers: efriedma, hans

Reviewed By: hans

Subscribers: spatel, llvm-commits

Tags: #llvm

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

llvm-svn: 366925

4 years ago[ARM] MVE compare vector splat combine
David Green [Wed, 24 Jul 2019 16:58:41 +0000 (16:58 +0000)]
[ARM] MVE compare vector splat combine

MVE VCMP instructions can use a general purpose register as the second operand.
This adds the combines for it, selecting from a compare of a vdup.

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

llvm-svn: 366924

4 years ago[llvm-objdump] Emit warning if --start-address/--stop-address specify range outside...
Yuanfang Chen [Wed, 24 Jul 2019 16:55:30 +0000 (16:55 +0000)]
[llvm-objdump] Emit warning if --start-address/--stop-address specify range outside file's address range.

NB: the warning is about the input file itself regardless of the options used
such as `-r`, `-s` etc..

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

Reviewers: jhenderson, grimar, MaskRay, rupprecht

Reviewed by: MaskRay, jhenderson

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

llvm-svn: 366923

4 years ago[SelectionDAG] makeEquivalentMemoryOrdering - early out for equal chains (PR42727)
Simon Pilgrim [Wed, 24 Jul 2019 16:53:14 +0000 (16:53 +0000)]
[SelectionDAG] makeEquivalentMemoryOrdering - early out for equal chains (PR42727)

If we are already using the same chain for the old/new memory ops then just return.

Fixes PR42727 which had getLoad() reusing an existing node.

llvm-svn: 366922

4 years ago[AMDGPU][MC][GFX10] Enabled GFX10 assembly with arbitrary wavesize assumed by the...
Dmitry Preobrazhensky [Wed, 24 Jul 2019 16:50:17 +0000 (16:50 +0000)]
[AMDGPU][MC][GFX10] Enabled GFX10 assembly with arbitrary wavesize assumed by the code

Reviewers: rampitec, arsenm

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

llvm-svn: 366921

4 years ago[ARM] Better OR's for MVE compares
David Green [Wed, 24 Jul 2019 16:42:09 +0000 (16:42 +0000)]
[ARM] Better OR's for MVE compares

This adds a DeMorgan combine for OR's of compares to turn them into AND's,
helping prevent them from going into and out of gpr registers. It also fills in
the VCLE and VCLT nodes that MVE can select, allowing it to invert more
compares.

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

llvm-svn: 366920

4 years ago[Remarks] Simplify the creation of remark serializers
Francis Visoiu Mistrih [Wed, 24 Jul 2019 16:36:35 +0000 (16:36 +0000)]
[Remarks] Simplify the creation of remark serializers

Introduce two new functions to create a serializer, and add support for
more combinations to the YAMLStrTabSerializer.

llvm-svn: 366919

4 years ago[scudo][standalone] Optimization pass
Kostya Kortchinsky [Wed, 24 Jul 2019 16:36:01 +0000 (16:36 +0000)]
[scudo][standalone] Optimization pass

Summary:
This introduces a bunch of small optimizations with the purpose of
making the fastpath tighter:
- tag more conditions as `LIKELY`/`UNLIKELY`: as a rule of thumb we
  consider that every operation related to the secondary is unlikely
- attempt to reduce the number of potentially extraneous instructions
- reorganize the `Chunk` header to not straddle a word boundary and
  use more appropriate types

Note that some `LIKELY`/`UNLIKELY` impact might be less obvious as
they are in slow paths (for example in `secondary.cc`), but at this
point I am throwing a pretty wide net, and it's consistant and doesn't
hurt.

This was mosly done for the benfit of Android, but other platforms
benefit from it too. An aarch64 Android benchmark gives:
- before:
```
  BM_youtube/min_time:15.000/repeats:4/manual_time_mean              445244 us       659385 us            4
  BM_youtube/min_time:15.000/repeats:4/manual_time_median            445007 us       658970 us            4
  BM_youtube/min_time:15.000/repeats:4/manual_time_stddev               885 us         1332 us            4
```
- after:
```
  BM_youtube/min_time:15.000/repeats:4/manual_time_mean       415697 us       621925 us            4
  BM_youtube/min_time:15.000/repeats:4/manual_time_median     415913 us       622061 us            4
  BM_youtube/min_time:15.000/repeats:4/manual_time_stddev        990 us         1163 us            4
```

Additional since `-Werror=conversion` is enabled on some platforms we
are built on, enable it upstream to catch things early: a few sign
conversions had slept through and needed additional casting.

Reviewers: hctim, morehouse, eugenis, vitalybuka

Reviewed By: vitalybuka

Subscribers: srhines, mgorny, javed.absar, kristof.beyls, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 366918

4 years ago[AMDGPU] Add all vgpr classes to asm parser
Stanislav Mekhanoshin [Wed, 24 Jul 2019 16:21:18 +0000 (16:21 +0000)]
[AMDGPU] Add all vgpr classes to asm parser

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

llvm-svn: 366917

4 years agoAMDGPU: Fix test after r366913
Matt Arsenault [Wed, 24 Jul 2019 16:05:55 +0000 (16:05 +0000)]
AMDGPU: Fix test after r366913

llvm-svn: 366916

4 years agoAMDGPU/GlobalISel: Don't assume instruction can be erased when selecting exts
Matt Arsenault [Wed, 24 Jul 2019 16:05:53 +0000 (16:05 +0000)]
AMDGPU/GlobalISel: Don't assume instruction can be erased when selecting exts

The G_ANYEXT handling can end up reaching selectCOPY, which mutates
the instruction in place.

llvm-svn: 366915

4 years ago[SDAG] convert (sub x, 1) to (add x, -1) in ctpop expansion; NFC
Sanjay Patel [Wed, 24 Jul 2019 15:43:50 +0000 (15:43 +0000)]
[SDAG] convert (sub x, 1) to (add x, -1) in ctpop expansion; NFC

We canonicalize to the add form, so create that directly for efficiency.

llvm-svn: 366914

4 years agoAMDGPU: Only allow FP types for format buffer intrinics
Matt Arsenault [Wed, 24 Jul 2019 15:37:51 +0000 (15:37 +0000)]
AMDGPU: Only allow FP types for format buffer intrinics

The code already somewhat assumes this is the case anyway.

llvm-svn: 366913

4 years ago[AIX][lit] Don't depend on psutil on AIX
David Tenty [Wed, 24 Jul 2019 15:04:27 +0000 (15:04 +0000)]
[AIX][lit] Don't depend on psutil on AIX

Summary:
On AIX psutil can run into problems with permissions to read the process
tree, which causes problems for python timeout tests which need to kill off
a test and it's children.

This patch adds a workaround by invoking shell via subprocess and using a
platform specific option to ps to list all the descendant processes so we can
kill them. We add some checks so lit can tell whether timeout tests are
supported with out exposing whether we are utilizing the psutil
implementation or the alternative.

Reviewers: hubert.reinterpretcast, andusy, davide, delcypher

Reviewed By: delcypher

Subscribers: davide, delcypher, christof, lldb-commits, libcxx-commits, llvm-commits

Tags: #lldb, #libc, #llvm

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

llvm-svn: 366912

4 years ago[Support] Fix `-ftime-trace-granularity` option
Anton Afanasyev [Wed, 24 Jul 2019 14:55:40 +0000 (14:55 +0000)]
[Support] Fix `-ftime-trace-granularity` option

Summary:
Move `-ftime-trace-granularity` option to frontend options. Without patch
this option is showed up in the help for any tool that links libSupport.

Reviewers: sammccall

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 366911

4 years ago[ARM] Better AND's for MVE compares
David Green [Wed, 24 Jul 2019 14:42:05 +0000 (14:42 +0000)]
[ARM] Better AND's for MVE compares

Add a number of folds to convert and(vcmp, vcmp) into a single VPT block, where
the second vcmp becomes predicated on the first.

The VCMP; VPST; VCMP will eventually be converted to VPT; VCMP in the
VPTBlockPass.

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

llvm-svn: 366910

4 years ago[ARM] MVE floating point compares and selects
David Green [Wed, 24 Jul 2019 14:28:22 +0000 (14:28 +0000)]
[ARM] MVE floating point compares and selects

Much like integers, this adds MVE floating point compares and select. It
requires a lot more buildvector/shuffle code because we may need to expand the
compares without mve.fp, and requires support for and/or because of the way we
lower llvm condition codes.

Some original code by David Sherwood

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

llvm-svn: 366909

4 years ago[llvm-ar][test] Fix move operation tests
Owen Reynolds [Wed, 24 Jul 2019 14:26:18 +0000 (14:26 +0000)]
[llvm-ar][test] Fix move operation tests

This fixes two tests that did not remove existing archives
before testing due to mistyped archive names.

llvm-svn: 366908

4 years ago[ARM] Basic And/Or/Xor handling for MVE predicates
David Green [Wed, 24 Jul 2019 14:17:54 +0000 (14:17 +0000)]
[ARM] Basic And/Or/Xor handling for MVE predicates

This adds some basic, "worst case" handling for MVE predicate Or/And/Xor. It
does this by going into and out of GPRs, doing the operation on scalars.

Code by David Sherwood.

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

llvm-svn: 366907

4 years agoSilence a conversion warning after r366887. NFC
Paul Robinson [Wed, 24 Jul 2019 14:15:02 +0000 (14:15 +0000)]
Silence a conversion warning after r366887. NFC

llvm-svn: 366906

4 years ago[ARM] Make sure that the constant pool does not keep in the middle of an IT block.
Simi Pallipurath [Wed, 24 Jul 2019 13:54:14 +0000 (13:54 +0000)]
[ARM] Make sure that the constant pool does not keep in the middle of an IT block.

This change make sure that llvm does not emit an invalid IT block
by putting the constant pool in the middle of an IT block.

We have code to try to avoid putting a constant island in the middle of an
IT block, but it only works if we see an IT between the one currently
referencing CPE and possible insertion point. If the first instruction
we look at is the VLDRD after the IT , we never see the IT and does not
realize that the instruction doing the load could be in an IT block itself.

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

Change-Id: I24cecb37cded75e8992870bd997f6226853bd920
llvm-svn: 366905

4 years agoTest commit. NFC.
Sjoerd Meijer [Wed, 24 Jul 2019 13:30:36 +0000 (13:30 +0000)]
Test commit. NFC.

Removed 2 trailing whitespaces in 2 files that used to be in different
repos to test my new github monorepo workflow.

llvm-svn: 366904

4 years agoFix @skipIfSanitized decorator
Pavel Labath [Wed, 24 Jul 2019 13:05:56 +0000 (13:05 +0000)]
Fix @skipIfSanitized decorator

To run the test the decorator function should return None, not False.
Returning anything other than None skips the test.

llvm-svn: 366903

4 years ago[InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp
Jay Foad [Wed, 24 Jul 2019 12:50:10 +0000 (12:50 +0000)]
[InstSimplify] Rename SimplifyFPUnOp and SimplifyFPBinOp

Summary:
SimplifyFPBinOp is a variant of SimplifyBinOp that lets you specify
fast math flags, but the name is misleading because both functions
can simplify both FP and non-FP ops. Instead, overload SimplifyBinOp
so that you can optionally specify fast math flags.

Likewise for SimplifyFPUnOp.

Reviewers: spatel

Reviewed By: spatel

Subscribers: xbolva00, cameron.mcinally, eraman, hiraditya, haicheng, zzheng, llvm-commits

Tags: #llvm

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

llvm-svn: 366902

4 years ago[InstCombine] add tests for load narrowing; NFC
Sanjay Patel [Wed, 24 Jul 2019 12:44:21 +0000 (12:44 +0000)]
[InstCombine] add tests for load narrowing; NFC

Baseline results for D64432.

llvm-svn: 366901

4 years ago[clangd] Add categories to help options, and only show clangd options.
Sam McCall [Wed, 24 Jul 2019 12:41:52 +0000 (12:41 +0000)]
[clangd] Add categories to help options, and only show clangd options.

Summary:
Restricting the categories prevents extra unwanted options from creeping into
help (D60663), and removes a bunch of noise from --help-hidden.

While here, remove `static` from the opts in favor of an anon namespace, to
reduce the noise level.

Reviewers: hokein

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

Tags: #clang

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

llvm-svn: 366900

4 years ago[FileCheck] Use ASSERT for fatal unit tests
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:34 +0000 (12:38 +0000)]
[FileCheck] Use ASSERT for fatal unit tests

Summary:
A number of EXPECT statements in FileCheck's unit tests are dependent
from results of other values being tested. This commit changes those
earlier test to use ASSERT instead of EXPECT to avoid cascade errors
when they are all related to the same issue.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

> llvm-svn: 366862

llvm-svn: 366899

4 years ago[FileCheck]] Canonicalize caret location testing
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:29 +0000 (12:38 +0000)]
[FileCheck]] Canonicalize caret location testing

Summary:
Testing of caret location in diagnostic message is currently made with
CHECK directive with the following general format:
CHECK: {{^         \^$}}

James Henderson suggested the following would be more readable:
CHECK: {{^}}         ^{{$}}

and when whole lines can be matched (as is the case for command-line
testing where error messages do not include path):
CHECK:         ^
using the option --match-full-lines.

This commit implements these 2 changes on all existing caret position
tests. It also aligns the caret to the character it is trying to match
in the above line.

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: JonChesterfield, rogfer01, hfinkel, kristina, rnk, tra, arichardson, grimar, dblaikie, probinson, llvm-commits, hiraditya

Tags: #llvm

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

> llvm-svn: 366861

llvm-svn: 366898

4 years agoFileCheck [8/12]: Define numeric var from expr
Thomas Preud'homme [Wed, 24 Jul 2019 12:38:22 +0000 (12:38 +0000)]
FileCheck [8/12]: Define numeric var from expr

Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch lift the restriction for a
numeric expression to either be a variable definition or a numeric
expression to try to match.

This commit allows a numeric variable to be set to the result of the
evaluation of a numeric expression after it has been matched
successfully. When it happens, the variable is allowed to be used on
the same line since its value is known at match time.

It also makes use of this possibility to reuse the parsing code to
parse a command-line definition by crafting a mirror string of the
-D option with the equal sign replaced by a colon sign, e.g. for option
'-D#NUMVAL=10' it creates the string
'-D#NUMVAL=10 (parsed as [[#NUMVAL:10]])' where the numeric expression
is parsed to define NUMVAL. This result in a few tests needing updating
for the location diagnostics on top of the tests for the new feature.

It also enables empty numeric expression which match any number without
defining a variable. This is done here rather than in commit #5 of the
patch series because it requires to dissociate automatic regex insertion
in RegExStr from variable definition which would make commit #5 even
bigger than it already is.

Copyright:
    - Linaro (changes up to diff 183612 of revision D55940)
    - GraphCore (changes in later versions of revision D55940 and
                 in new revision created off D55940)

Reviewers: jhenderson, chandlerc, jdenny, probinson, grimar, arichardson, rnk

Subscribers: hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, tra, rnk, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

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

> llvm-svn: 366860

llvm-svn: 366897

4 years ago[llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case and rewrit...
George Rimar [Wed, 24 Jul 2019 12:24:43 +0000 (12:24 +0000)]
[llvm-objdump] - Import the test/Object/X86/no-start-symbol.test test case and rewrite it to use YAML.

This patch removes test/Object/X86/no-start-symbol.test (rewrites
it to use YAML and moves it to llvm-objdump tests folder).

(This test was initially introduced in rL239039, but now there
is no reason to keep the precompiled binary it seems).

DIfferential revision: https://reviews.llvm.org/D65136

llvm-svn: 366896

4 years ago[Object/llvm-readobj] - Cleanup testing of the dynamic objects.
George Rimar [Wed, 24 Jul 2019 12:20:42 +0000 (12:20 +0000)]
[Object/llvm-readobj] - Cleanup testing of the dynamic objects.

This patch touches a few test cases:

It removes dtflags.elf-x86-64 binary and elf-dtflags.test.
elf-dtflags.test is excessive because we have the
elf-dynamic-tags.test which test all non-machine specific tags.

It removes testing of --dynamic-table from test\Object\readobj-shared-object.test
(we have the elf-dynamic-tags.test for that), and simplifies this test case.

It moves testing of the headers from readobj-shared-object.test
to elf-file-headers.test.

Adds test/tools/llvm-readobj/elf-file-types.test and test/tools/llvm-readobj/elf-loadname.test.

It opens road for removing the readobj-shared-object.test completely soon.

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

llvm-svn: 366895