Commit Graph

379428 Commits

Author SHA1 Message Date
Jeremy Morse
e05c10380c [DebugInfo] Re-engineer a test to be stricter, add XFails
In the LLVM-IR for this test, the inlined argument "b" in the "a" function
is optimized out on certain architectures, not on others. This hasn't been
reported as a test failure since 93faeecd8f and ff2073a51 because we would
create a variable that looks like this:

  DW_TAG_formal_parameter
    DW_AT_abstract_origin

With no further information (and no location). With D95617 however, we
stop emitting such variables.

Prior to landing D95617: make this test stricter by checking that the
variable mentioned above has a location. We have to accept that on certain
architectures this goes missing, so add those to the XFail list.

I've run a few experiments, and right now it looks likely only powerpc64
still drops the variable location.
2021-02-08 10:12:33 +00:00
Fraser Cormack
b46aac125d [RISCV] Support the scalable-vector fadd reduction intrinsic
This patch adds support for both the fadd reduction intrinsic, in both
the ordered and unordered modes.

The fmin and fmax intrinsics are not currently supported due to a
discrepancy between the LLVM semantics and the RVV ISA behaviour with
regards to signaling NaNs. This behaviour is likely fixed in version 2.3
of the RISC-V F/D/Q extension, but until then the intrinsics can be left
unsupported.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D95870
2021-02-08 09:52:27 +00:00
David Sherwood
3bbaece5a0 [Analysis] Remove unused functions from TargetLibraryInfo
A simple clean-up to remove dead code.

Differential Revision: https://reviews.llvm.org/D95934
2021-02-08 09:50:36 +00:00
Tres Popp
c2c83e97c3 Revert "Revert "Reorder MLIRContext location in BuiltinAttributes.h""
This reverts commit 511dd4f438 along with
a couple fixes.

Original message:
Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

Phabricator: https://reviews.llvm.org/D96111
2021-02-08 10:39:58 +01:00
Simon Pilgrim
db5abfbbb4 [WebAssembly] Fix multiclass template parameter types. NFC.
Fixes TableGen parser errors reported by D95874 due to incompatible types being used on multiclass templates.

Differential Revision: https://reviews.llvm.org/D96205
2021-02-08 09:36:56 +00:00
Jan Svoboda
6039f82145 Revert "[clang][cli] Report result of ParseLangArgs"
This reverts commit bff6d9bb

The change causes failure of Clang's Index/implicit-attrs.m test.
2021-02-08 10:18:15 +01:00
Jan Svoboda
63623982e1 [clang][cli] NFC: Mirror CreateFromArgs order in generateCC1CommandLine 2021-02-08 10:12:51 +01:00
Muhammad Omair Javaid
8561ad9296 Use remote regnums in expedited list, value regs and invalidate regs
Native register descriptions in LLDB specify lldb register numbers in
value_regs and invalidate_regs lists. These register numbers may not
match with Process gdb-remote register numbers which are generated by
native process after counting all registers in its register sets.

It was coincidentally not causing any problems as we never came across
a native target with dynamically changing register sets and register
numbers generated by counter matched with LLDB native register numbers.
This came up while testing target AArch64 SVE which can choose register
sets based on underlying hardware.

This patch fixes this behavior and always tries to use remote register
numbers while reading/writing registers over gdb-remote protocol.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D77043
2021-02-08 14:09:15 +05:00
Muhammad Omair Javaid
bec6b5e3ce [LLDB] Disable TestExprsChar.py, still fails on Arm/Linux
TestExprsChar.py was enabled on Arm as it passes on apple silicon but
still fails on Arm/Linux.
2021-02-08 14:05:36 +05:00
Jan Svoboda
bff6d9bb0f [clang][cli] Report result of ParseLangArgs
This patch correctly reports success/failure of `ParseLangArgs`. Besides being consistent with  other `Parse` functions, this is required to make round-tripping of `LangOptions` work.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95792
2021-02-08 09:56:33 +01:00
Raphael Isemann
0ebf904baf [modules] Put Frontend/OpenMP headers into a Clang module to fix the module build
These headers can be in a Clang module like the rest. This also fixes the
modules build that is currently struggling with these headers being textually
included in several other modules.
2021-02-08 09:54:45 +01:00
Jan Svoboda
c1b482e726 [clang][index] Mark file as C++ in parse-all-comments test
`CompilerInvocation::CreateFromArgs` doesn't always report command line parsing failures through the return value. Sometimes, errors are only reported via diagnostics.

Some clients like `c-index-test` only check the return value and don't check the state of `DiagnosticsEngine`.

If we were to start returning the correct return value from `CreateFromArgs`, this index test starts to fail, because it specifies `-std=c++11` for a C input, which is invalid.

This patch fixes that issue by adding forgotten `-x c++` argument.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95879
2021-02-08 09:42:44 +01:00
David Green
1b435eb8f3 [ARM] i16 insert-of-extract to VINS pattern
This adds another tablegen fold that converts an i16 odd-lane-insert of
an even-lane-extract into a VINS. We extract the existing f32 value from
the destination register and VINS the new value into it. The rest of the
backend then is able to optimize the INSERT_SUBREG / COPY_TO_REGCLASS /
EXTRACT_SUBREG.

Differential Revision: https://reviews.llvm.org/D95456
2021-02-08 08:41:07 +00:00
Jan Svoboda
0c42d87ea8 [clang][cli] Generate and round-trip preprocessor options
This patch implements generation of remaining preprocessor options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95366
2021-02-08 09:34:55 +01:00
Tres Popp
511dd4f438 Revert "Reorder MLIRContext location in BuiltinAttributes.h"
This reverts commit 7827753f98.
2021-02-08 09:32:42 +01:00
Tres Popp
7827753f98 Reorder MLIRContext location in BuiltinAttributes.h
Now the context is the first, rather than the last input.

This better matches the rest of the infrastructure and makes
it easier to move these types to being declaratively specified.

Differential Revision: https://reviews.llvm.org/D96111
2021-02-08 09:28:09 +01:00
Jan Svoboda
0e07383433 [clang][cli] Generate and round-trip analyzer options
This patch implements generation of remaining analyzer options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

Differential Revision: https://reviews.llvm.org/D95369
2021-02-08 09:26:01 +01:00
Djordje Todorovic
9abd8c1a4c [elf-core] Improve reading memory from core file
This patch tries to improve memory-read from core files
(in order to improve disassembly functionality).

I am using RHEL 7.7 (linux kernel 3.10) and for a lot of cases,
I was not able to disassemble some functions from backtrace when
debugging crashes from core files. It outputs some dummy code.

The cause of the problem was the fact we are returning all the zeros
from ProcessElfCore::ReadMemory() that is being called within
Disassembler::ParseInstructions() and it disassembles some dummy
opcodes from the buffer returned. Therefore, we are removing zero
bytes filling (padding) completely.

Differential Revision: https://reviews.llvm.org/D93939
2021-02-08 00:14:32 -08:00
Vladislav Vinogradov
035abe30c9 [mlir][ODS] Allow to specify custom namespace for NativeOpTrait
This will allow to use `NativeOpTrait` and Operations
declared outside of `mlir` namespace.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D96128
2021-02-08 10:25:45 +03:00
Max Kazantsev
0fc1738eb7 [Test] Add failing test for PR49087 2021-02-08 13:18:22 +07:00
Daniel Hwang
d72859ffa2 [scan-build-py] Update scan-build-py to allow outputing as SARIF
clang static analysis reports can be generated in html, plist, or sarif
format. This updates scan-build-py to be able to specify SARIF as the
desired output format, as previously it only support plist and html
formats.

Differential Revision: https://reviews.llvm.org/D94251
2021-02-07 18:25:50 -08:00
Fangrui Song
d3e13b58cd ELFObjectWriter: Don't de-duplicate STT_FILE symbols 2021-02-07 18:21:36 -08:00
Fangrui Song
09294642be ELFObjectWriter: Make STT_FILE precede associated local symbols 2021-02-07 17:51:40 -08:00
Fangrui Song
6042009633 [MC][test] Improve STT_FILE tests 2021-02-07 17:39:48 -08:00
Fangrui Song
980d28d955 ELFObjectWriter: Don't sort local symbols
GNU as does not sort local symbols. This has several advantages:

* The .symtab order is roughly the symbol occurrence order.
* The closest preceding STT_SECTION symbol is the definition of a local symbol.
* The closest preceding STT_FILE symbol is the defining file of a local symbol, if there are multiple default-version .file directives. (Not implemented in MC.)
2021-02-07 15:47:10 -08:00
Florian Hahn
ca268ed285
[ConstraintElimination] Decompose zext for unsigned compares.
For unsigned compares, zext should be a no-op and we can add the
extended value to the constraint system.
2021-02-07 20:53:06 +00:00
Florian Hahn
3bb6dc0b26
[LV] Replace some uses of VectorLoopValueMap with VPTransformState (NFC)
This patch updates some places where VectorLoopValueMap is accessed
directly to instead go through VPTransformState.

As we move towards managing created values exclusively in VPTransformState,
this ensures the use always can fetch the correct value.

This is in preparation for D92285, which switches to managing scalarized
values through VPValues.

In the future, the various fix* functions should be moved directly into
the VPlan codegen stage.

Reviewed By: gilr

Differential Revision: https://reviews.llvm.org/D95757
2021-02-07 18:28:21 +00:00
Florian Hahn
a14a59f2f2
[ConstraintElimination] Add additional tests.
Adds additional test cases with zexts, conditions that require temporary
indices.
2021-02-07 18:00:17 +00:00
Kazu Hirata
be23012d5a [Transforms/Utils] Use range-based for loops (NFC) 2021-02-07 09:49:36 -08:00
Kazu Hirata
92a6055835 [TableGen] Use ListSeparator (NFC) 2021-02-07 09:49:35 -08:00
Kazu Hirata
7b9f6c2d42 [SelectionDAG] Drop unnecessary const from a return type (NFC)
Identified with const-return-type.
2021-02-07 09:49:33 -08:00
poelmanc
5229edd667
[clang-tidy] fix modernize-loop-convert to retain needed array-like operator[]
`modernize-loop-convert` handles //array-like// objects like vectors fairly well, but strips slightly too much information from the iteration expression by converting:
```
  Vector<Vector<int>> X;
  for (int J = 0; J < X[5].size(); ++J)
    copyArg(X[5][J]);
```
to
```
  Vector<Vector<int>> X;
  for (int J : X) // should be for (int J : X[5])
    copyArg(J);
```
The `[5]` is a call to `operator[]` and gets stripped by `LoopConvertCheck::getContainerString`. This patch fixes that and adds several test cases.

Reviewed By: njames93

Differential Revision: https://reviews.llvm.org/D95771
2021-02-07 16:36:34 +00:00
Stephen Kelly
ddca007a29 Add code complete support for mapAnyOf 2021-02-07 16:03:05 +00:00
Stephen Kelly
04b69d9a60 Add clang-query support for mapAnyOf
Differential Revision: https://reviews.llvm.org/D94880
2021-02-07 15:40:15 +00:00
Stephen Kelly
816cc43281 [ASTMatchers] Extract parsing of bind token from the bind id
This will be extended to be able to parse "with" for mapAnyOf in
addition to "bind".
2021-02-07 15:40:15 +00:00
Stephen Kelly
8021078bc9 [ASTMatchers] Change internal method API
This will make it possible to parse matchers built dynamically.
2021-02-07 15:37:35 +00:00
Stephen Kelly
45e210dbeb [ASTMatchers] Make it possible to build mapAnyOf through the registry 2021-02-07 15:36:15 +00:00
Stephen Kelly
d3bccdcd50 [ASTMatchers ]Make MatcherDescriptors indicate the node type they match 2021-02-07 15:13:28 +00:00
Sanjay Patel
6fd91be354 [Reassociate] allow or->add with shl operands
As discussed in:
https://llvm.org/PR49055

We invert instcombine's add->or transform here
because it makes it easier to identify factorization
transforms like the mul in the motivating test.

This extends the logic added with:
https://reviews.llvm.org/rG70472f3
https://reviews.llvm.org/rG93f3d7f

(I intentionally kept the formatting fix in this patch
to provide more context about the calling logic.)
2021-02-07 09:45:19 -05:00
Stephen Kelly
e12d827991 Make it possible to store NodeKinds in ArgKind 2021-02-07 14:00:45 +00:00
Stephen Kelly
79fedadd6a [ASTMatchers] Add static constructor for ArgKinds of Matchers
It will soon be possible to store a node kind in an ArgKind, which will
also be contructed with an ASTNodeKind.  The desired Kind must be
expicit.
2021-02-07 13:43:04 +00:00
Simon Pilgrim
86dabf4226 [DAG] SelectionDAG::isSplatValue - handle OR/XOR cases
Add OR/XOR to the basic binops that we support when checking for a splat vector value
2021-02-07 13:27:57 +00:00
Simon Pilgrim
598ceb25d4 [X86][AVX] Fold extract_subvector(splat, c) -> extract_subvector(splat, 0)
We already do this for VBROADCASTs, extend this for any splat that SelectionDAG::isSplatValue recognises as well.
2021-02-07 11:42:41 +00:00
Florian Hahn
853c52c988
[ConstraintElimination] Require GEPs to be inbounds for decomposition.
During decomposition, we assume the no-wrap properties of inbound GEPs.
Make sure the decomposed GEP is actually inbounds.
2021-02-07 11:08:53 +00:00
Craig Topper
5f8ed1b220 [TableGen] Make all the fields in PatternToMatch private. NFCI
Add the few missing accessor methods. Use accessor methdods
everywhere.
2021-02-06 22:34:01 -08:00
Florian Hahn
14da287e18
[ConstraintElimination] Extend test coverage.
This patch adds a lot of additional tests, focusing on loops and GEP
arithmetic. Some of the tests expose existing problems, which will be
fixed soon.
2021-02-06 21:21:48 +00:00
Fangrui Song
e6810cab09 [Polly] Fix build after AssumptionCache change (D96168) 2021-02-06 11:56:15 -08:00
Dave Lee
3cc3762292 [lldb] Use assertIn/NotIn over assertTrue/False (NFC)
For improved failure messages, use `assertIn` over `assertTrue`.

Differential Revision: https://reviews.llvm.org/D96095
2021-02-06 11:52:01 -08:00
Fangrui Song
4b5dbc7a3b [ELF][test] Improve aarch64 tests 2021-02-06 11:50:57 -08:00
Kazu Hirata
28d3132089 [Analysis] Use range-based for loops (NFC) 2021-02-06 11:17:10 -08:00