Commit Graph

340415 Commits

Author SHA1 Message Date
Simon Pilgrim 3fd5d1c6e7 [X86][SSE] combineTargetShuffle - permilps(shufps(load(),x)) --> permilps(shufps(x,load()))
Moves lowerShuffleWithSHUFPS commutation code from rG30fcd29fe479 to catch cases during combine
2020-01-24 15:23:20 +00:00
Roman Lebedev a8c3608a27
[Sema] Provide declarations for MaximumAlignment, MaxAlignmentExponent variables
clang-armv7-linux-build-cache bot is complaining about undefined
references to these variables during linking, so by explicitly
placing them in some TU we should be able to fix that.
2020-01-24 18:18:15 +03:00
Sergey Dmitriev f69eba0772 [llvm-objcopy][COFF] Add support for --set-section-flags
Reviewers: jhenderson, MaskRay, alexshap, rupprecht, mstorsjo

Reviewed By: jhenderson

Subscribers: abrachet, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73107
2020-01-24 07:12:55 -08:00
Sam McCall 76fa5d50f3 [clangd] Remove pesky ;. NFC 2020-01-24 16:12:00 +01:00
Sam McCall 6ef1ccecf7 [clangd] Rename DiagnosticsConsumer -> ClangdServer::Callbacks, and make it optional
Summary:
This reflects its current function better and avoids confusion with clang::DiagnosticConsumer.

The old name/constructor is left around temporarily for compatibility.
(Metagame: merging with out-of-tree changes is harder than usual this month)

Reviewers: hokein

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73346
2020-01-24 15:59:32 +01:00
Roman Lebedev 1d0972ff5e
[Sema] Introduce MaximumAlignment value, to be used instead of magical constants
There is llvm::Value::MaximumAlignment, which is numerically
equivalent to these constants, but we can't use it directly
because we can't include llvm IR headers in clang Sema.
So instead, copy-paste the constant, and fixup the places to use it.

This was initially reviewed in https://reviews.llvm.org/D72998
2020-01-24 17:49:17 +03:00
Kazushi (Jam) Marukawa 08ebd8c79e [VE] aligned load/store isel patterns
Summary:
Aligned load/store isel patterns and tests for
i1/i8/16/32/64 (including extension and truncation) and fp32/64.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73276
2020-01-24 15:16:54 +01:00
Thomas Preud'homme 8e96697c7d FileCheck [9/12]: Add support for matching formats
Summary:
This patch is part of a patch series to add support for FileCheck
numeric expressions. This specific patch adds support for selecting a
matching format to match a numeric value against (ie. decimal, hex lower
case letters or hex upper case letters).

This commit allows to select what format a numeric value should be
matched against. The following formats are supported: decimal value,
lower case hex value and upper case hex value. Matching formats impact
both the format of numeric value to be matched as well as the format of
accepted numbers in a definition with empty numeric expression
constraint.

Default for absence of format is decimal value unless the numeric
expression constraint is non null and use a variable in which case the
format is the one used to define that variable. Conclict of format in
case of several variable being used is diagnosed and forces the user to
select a matching format explicitely.

This commit also enables immediates in numeric expressions to be in any
radix known to StringRef's GetAsInteger method, except for legacy
numeric expressions (ie [[@LINE+<offset>]] which only support decimal
immediates.

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

Reviewed By: jhenderson, arichardson

Subscribers: daltenty, MaskRay, hiraditya, llvm-commits, probinson, dblaikie, grimar, arichardson, kristina, hfinkel, rogfer01, JonChesterfield

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60389
2020-01-24 14:15:28 +00:00
Roman Lebedev 0a002f679b
[Sema] Try 2: Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`
Summary:
For `__builtin_assume_aligned()`, we do validate that the alignment
is not greater than `536870912` (D68824), but we don't do that for
`__attribute__((assume_aligned(N)))` attribute.
I suspect we should.

This was initially committed in a4cfb15d15
but reverted in 210f0882c9 due to
suspicious bot failures.

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D72994
2020-01-24 16:56:39 +03:00
Victor Huang 5cee34013c [PowerPC][Future] Add prefixed instruction paddi to future CPU
Future CPU will include support for prefixed instructions.
These prefixed instructions are formed by a 4 byte prefix
immediately followed by a 4 byte instruction effectively
making an 8 byte instruction. The new instruction paddi
is a prefixed form of addi.

This patch adds paddi and all of the support required
for that instruction. The majority of the patch deals with
supporting the new prefixed instructions. The addition of
paddi is mainly to allow for testing.

Differential Revision: https://reviews.llvm.org/D72569
2020-01-24 07:27:25 -06:00
Raphael Isemann 06ae3748db [lldb][NFC] Cleanup some if conditions in ASTImporterDelegate::Imported 2020-01-24 13:49:25 +01:00
Kadir Cetinkaya 1b996faa15
[clangd][Hover] Change arrow in return type back to →
Summary:
Currently 🡺 is used in hover response to represent return types, but it
is not widely available. Changing this back to original to support more clients.

Reviewers: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73336
2020-01-24 13:05:21 +01:00
Simon Pilgrim 5e62e162cd [X86][SSE] Add another shufps+shufps test for fold through commutation 2020-01-24 12:04:11 +00:00
Simon Pilgrim 30fcd29fe4 [X86][SSE] lowerShuffleWithSHUFPS - commute '2*V1+2*V2 elements' mask if it allows a loaded fold
As mentioned on D73023.
2020-01-24 12:04:10 +00:00
Guillaume Chatelet 805c157e8a [Alignment][NFC] Deprecate Align::None()
Summary:
This is a follow up on https://reviews.llvm.org/D71473#inline-647262.
There's a caveat here that `Align(1)` relies on the compiler understanding of `Log2_64` implementation to produce good code. One could use `Align()` as a replacement but I believe it is less clear that the alignment is one in that case.

Reviewers: xbolva00, courbet, bollu

Subscribers: arsenm, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, jrtc27, atanasyan, jsji, Jim, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73099
2020-01-24 12:53:58 +01:00
Clement Courbet 2ee218f365 [llvm-exegesis][NFC] Simplify code.
Summary:
What we're redoing already exists in the X86 backend, it's called
`X86II::getOperandBias`.

Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73340
2020-01-24 12:45:20 +01:00
Roman Lebedev ba545c814b
[Sema] Try 2: Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation
Summary:
`alloc_align` attribute takes parameter number, not the alignment itself,
so given **just** the attribute/function declaration we can't do any
sanity checking for said alignment.

However, at call site, given the actual `Expr` that is passed
into that parameter, we //might// be able to evaluate said `Expr`
as Integer Constant Expression, and perform the sanity checks.
But since there is no requirement for that argument to be an immediate,
we may fail, and that's okay.

However if we did evaluate, we should enforce the same constraints
as with `__builtin_assume_aligned()`/`__attribute__((assume_aligned(imm)))`:
said alignment is a power of two, and is not greater than our magic threshold


This was initially committed in c2a9061ac5
but reverted in 00756b1823 because of
suspicious bot failures.

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72996
2020-01-24 14:42:45 +03:00
Georgii Rymar 1af6209d64 [llvm-readelf] - Improve dumping of objects without a section header string table.
We have a test/Object/no-section-header-string-table.test which checks
what happens when an object does not have a section header string table.
It does not check the full output though.
Currently our output is different from GNU readelf, because the latter prints
"<no-strings>" instead of a section name, while we print nothing.

This patch fixes this, adds a proper test case and removes the one from test/Object,
as it is not a right folder for llvm-readelf tests.

Differential revision: https://reviews.llvm.org/D73193
2020-01-24 14:30:03 +03:00
Sam McCall 7d20e80225 [clangd] Show background index status using LSP 3.15 work-done progress notifications
Summary:
It simply shows the completed/total items on the background queue, e.g.
 indexing: 233/1000
The denominator is reset to zero every time the queue goes idle.

The protocol is fairly complicated here (requires creating a remote "progress"
resource before sending updates). We implement the full protocol, but I've added
an extension allowing it to be skipped to reduce the burden on clients - in
particular the lit test takes this shortcut.

The addition of background index progress to DiagnosticConsumer seems ridiculous
at first glance, but I believe that interface is trending in the direction of
"ClangdServer callbacks" anyway. It's due for a rename, but otherwise actually
fits.

Reviewers: kadircet, usaxena95

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, jfb, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73218
2020-01-24 12:21:08 +01:00
Simon Pilgrim e37cdbeeab [X86][SSE] Add shufps+shufps test for fold through commutation
As mentioned on D73023, lowerShuffleWithSHUFPS should be able to commute the shufps inputs to fold the second arg as it will then permute the shufps result anyway.
2020-01-24 11:16:44 +00:00
Pavel Labath d4b092b341 [lldb/DWARF] Remove a workaround from DebugNamesDWARFIndex
This was needed when asking a compile unit for its dwo component
triggered a infinite recursion if the dwo unit has not been already
parsed.

This has since been fixed.
2020-01-24 12:09:20 +01:00
Pavel Labath 77cedb0cdb [lldb] Fix nondeterminism in TestCppBitfields
The test was printing a char[3] variable without a terminating nul. The
memory after that variable (an unnamed bitfield) was not initialized. If
the memory happened to be nonzero, the summary provider for the variable
would run off into the next field.

This is probably not the right behavior (it should stop at the end of
the array), but this is not the purpose of this test. I have filed
pr44649 for this bug, and fixed the test to not depend on this behavior.
2020-01-24 12:09:20 +01:00
Sam Parker 0ae13766ff [NFC][ARM] Add test 2020-01-24 11:00:18 +00:00
Kerry McLaughlin 4c4861b577 [AArch64][SVE] Add intrinsics for FFR manipulation
Summary:
Implements the following intrinsics:
  - llvm.aarch64.sve.setffr
  - llvm.aarch64.sve.rdffr
  - llvm.aarch64.sve.rdffr.z
  - llvm.aarch64.sve.wrffr

Reviewers: sdesmalen, efriedma, dancgr, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73097
2020-01-24 10:58:12 +00:00
Raphael Isemann c0738d2480 [lldb][NFC] Fix formatting in ASTImporterDelegate::ImportImpl 2020-01-24 11:57:06 +01:00
Raphael Isemann 36f12d2638 [lldb][NFC] Delete unused ClangASTImporter::CompleteDecl 2020-01-24 11:54:12 +01:00
Simon Pilgrim 0b45c2264a [SelectionDAG] rot(x, y) --> x iff ComputeNumSignBits(x) == BitWidth(x)
Rotating an 0/-1 value by any amount will always result in the same 0/-1 value
2020-01-24 10:35:57 +00:00
Guillaume Chatelet aba80d0734 [llvm-libc] Add memory function benchmarks
Summary:
This patch adds a benchmarking infrastructure for llvm-libc memory functions.

In a nutshell, the code can benchmark small and large buffers for the memcpy, memset and memcmp functions.
It also produces graphs of size vs latency by running targets of the form `render-libc-{memcpy|memset|memcmp}-benchmark-{small|big}`.

The configurations are provided as JSON files and the benchmark also produces a JSON file.
This file is then parsed and rendered as a PNG file via the `render.py` script (make sure to run `pip3 install matplotlib scipy numpy`).
The script can take several JSON files as input and will superimpose the curves if they are from the same host.

TODO:
 - The code benchmarks whatever is available on the host but should be configured to benchmark the -to be added- llvm-libc memory functions.
 - Add a README file with instructions and rationale.
 - Produce scores to track the performance of the functions over time to allow for regression detection.

Reviewers: sivachandra, ckennelly

Subscribers: mgorny, MaskRay, libc-commits

Tags: #libc-project

Differential Revision: https://reviews.llvm.org/D72516
2020-01-24 11:30:58 +01:00
Alex Zinenko b901335193 [mlir] Use all_of instead of a manual loop in IntrinsicGen. NFC
This was suggested in post-commit review of D72926.
2020-01-24 11:29:35 +01:00
James Henderson 0298a87511 [doc][llvm-objcopy] Remove redundant COFF-specific sub-heading
The sub-heading used to contain the --only-keep-debug switch as that
switch wasn't implemented for ELF at one point. Since the switch is now
in the generic options section, and there are no other options in this
sub-heading, it is pointless and can be deleted.
2020-01-24 10:25:39 +00:00
Sam Parker ddbc077895 [NFC][ARM] Make some params members instead.
Add MachineLoopInfo and ReachingDefAnalysis as members of
LowOverheadLoop instead of passing them several times to different
methods.
2020-01-24 10:19:17 +00:00
Sam McCall d3260bf5b2 [clangd] Errors in TestTU cause test failures unless suppressed with error-ok.
Summary:
The historic behavior of TestTU is to gather diagnostics and otherwise ignore
them. So if a test has a syntax error, and doesn't assert diagnostics, it
silently misbehaves.
This can be annoying when developing tests, as evidenced by various tests
gaining "assert no diagnostics" where that's not really the point of the test.

This patch aims to make that default behavior. For the first error
(not warning), TestTU will call ADD_FAILURE().

This can be suppressed with a comment containing "error-ok". For now that will
suppress any errors in the TU. We can make this stricter later -verify style.
(-verify itself is hard to reuse because of DiagnosticConsumer interfaces...)
A magic-comment was chosen over a TestTU option because of table-driven tests.

In addition to the behavior change, this patch:
  - adds //error-ok where we're knowingly testing invalid code
    (e.g. for diagnostics, crash-resilience, or token-level tests)
  - fixes a bunch of errors in the checked-in tests, mostly trivial (missing ;)
  - removes a bunch of now-redundant instances of "assert no diagnostics"

Reviewers: kadircet

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73199
2020-01-24 11:16:27 +01:00
Simon Pilgrim 7e12325586 [X86] Add test showing failure to remove vector rotate of allsignbits
Rotating an 0/-1 value by any amount will always result in the same 0/-1 value
2020-01-24 10:12:51 +00:00
Raphael Isemann 326c39b569 [clang][NFC] Remove redundant cast
This cast just casts Decl* to Decl*.
2020-01-24 11:07:33 +01:00
Sam McCall b3b68c0f80 [Format] Fix 'auto x(T&&, T &&)->F' with PAS_Left.
Summary:
An heuristic targetting `x && x->foo` was targed overly broadly and caused the
last T&& to be treated as a binary operator.

Reviewers: hokein

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73334
2020-01-24 11:03:46 +01:00
Djordje Todorovic 035c106f37 [DWARF][test] Test all the call-site realted attrs
Adding the test for the call site encoding in DWARF5 vs GNU extensions.
Some of the attributes were not covered by any test.

Differential Revision: https://reviews.llvm.org/D73266
2020-01-24 10:53:52 +01:00
Awanish Pandey c83602fdf5 Recommit "[DWARF5][clang]: Added support for DebugInfo generation for auto return type for C++ member functions."
Summary:
This was reverted in e45fcfc3aa due to
libcxx build failure. This revision addresses that case.

Original commit message:
    This patch will provide support for auto return type for the C++ member
    functions.

    This patch includes clang side implementation of this feature.

    Patch by: Awanish Pandey <Awanish.Pandey@amd.com>

    Reviewers: dblaikie, aprantl, shafik, alok, SouraVX, jini.susan.george
    Reviewed by: dblaikie

    Differential Revision: https://reviews.llvm.org/D70524
2020-01-24 14:50:17 +05:30
Fangrui Song daabc9a028 [WholeProgramDevirt][test] Fix test after D73094 2020-01-24 00:46:18 -08:00
Evgeny Leviant 8973fae195 [WPD] Allow load/save bitcoded index when running opt -wholeprogramdevirt
Differential revision: https://reviews.llvm.org/D73094
2020-01-24 00:31:39 -08:00
Fangrui Song 041fa5ad7c [lldb] Fix file header of Host/posix/FileSystemPosix.cpp 2020-01-24 00:29:53 -08:00
Fangrui Song 253379a56f [PowerPC] Delete IsDarwin from AsmPrinter functions 2020-01-24 00:22:24 -08:00
Raphael Isemann 808142876c [lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).

This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).

Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 08:52:55 +01:00
Jonas Devlieghere 4274a610b3 [llvm][TextAPI/MachO] Extend TBD_V3 unittest to verify writing
The existing unit tests cover a wide variety of reading TBD files but
lack coverages on the writing side. Case in point is the macCatalyst
case which we're able to read, but not write.

This patch extends the unit test dealing with valid input to write their
content again to verify the writer.

Differential revision: https://reviews.llvm.org/D73328
2020-01-23 23:18:10 -08:00
Jonas Devlieghere b14937cd1a [llvm][TextAPI/MachO] Update variable names in unit tests. (NFC)
This changes the variables names to match the TBD version.

Differential revision: https://reviews.llvm.org/D73326
2020-01-23 23:14:24 -08:00
Pierre Habouzit 52311d0483 [objc_direct] do not add direct properties to the serialization array
If we do, then the property_list_t length is wrong
and class_getProperty gets very sad.

Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Radar-Id: rdar://problem/58804805
Differential Revision: https://reviews.llvm.org/D73219
2020-01-23 22:39:47 -08:00
Pierre Habouzit 7596d3c50c [objc_direct] Allow for direct messages be sent to `self` when it is a Class
Sending a message to `self` when it is const and within a class method
is safe because we know that `self` is the Class itself.

We can only relax this warning in ARC.

Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Radar-Id: rdar://problem/58581965
Differential Revision: https://reviews.llvm.org/D72747
2020-01-23 22:39:28 -08:00
Fangrui Song a50567a31c [PowerPC][MC] Delete PPCMCExpr::IsDarwin 2020-01-23 22:30:08 -08:00
Fangrui Song d600ab3bb5 [Frontend] Delete some unneeded CC1 options 2020-01-23 22:01:04 -08:00
Jonas Devlieghere be2bc6b1d0 [lldb/Util] Remove reproducers after replay
Except for debugging purposes there's no point in leaving the reproducer
behind on disk after replay. This patch adds a cleanup in the replay
case.
2020-01-23 21:46:50 -08:00
Jonas Devlieghere d92f77606a [lldb/Util] Fix Python 3 incompatibility in lldb-repro
This fixes: TypeError: Unicode-objects must be encoded before hashing
2020-01-23 21:41:49 -08:00