platform/upstream/llvm.git
4 years ago[analyzer][NFC] Refactor the checker registration unit test file
Kirstóf Umann [Thu, 12 Sep 2019 20:20:58 +0000 (22:20 +0200)]
[analyzer][NFC] Refactor the checker registration unit test file

Nothing exciting to see here! The new interface allows for more fine tuning
(register but disable a checker, add custom checker registry functions, etc),
that was basically the point.

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

4 years ago[lldb/test] Fix arch arm for 32-bit armv7l/armv8l
Muhammad Omair Javaid [Mon, 9 Mar 2020 15:28:13 +0000 (20:28 +0500)]
[lldb/test] Fix arch arm for 32-bit armv7l/armv8l

This patch forces architecture "arm" if underlying os reports core
armv7l or armv8l. On linux systems 32 bit sysroot running on 64bit
AArch64 hardware reports armv7l or armv8l which is essently arm
32bit mode. This fixes 5 testcases on 32bit arm.

4 years ago[ELF] Postpone evaluation of ORIGIN/LENGTH in a MEMORY command
Fangrui Song [Fri, 6 Mar 2020 19:49:58 +0000 (11:49 -0800)]
[ELF] Postpone evaluation of ORIGIN/LENGTH in a MEMORY command

```
createFiles(args)
 readDefsym
 readerLinkerScript(*mb)
  ...
   readMemory
    readMemoryAssignment("ORIGIN", "org", "o") // eagerly evaluated
target = getTarget();
link(args)
 writeResult<ELFT>()
  ...
   finalizeSections()
    script->processSymbolAssignments()
     addSymbol(cmd) // with this patch, evaluated here
```

readMemoryAssignment eagerly evaluates ORIGIN/LENGTH and returns an uint64_t.
This patch postpones the evaluation to make

* --defsym and symbol assignments
* `CONSTANT(COMMONPAGESIZE)` (requires a non-null `lld::elf::target`)

work. If the expression somehow requires interaction with memory
regions, the circular dependency may cause the expression to evaluate to
a strange value. See the new test added to memory-err.s

Reviewed By: grimar

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

4 years agoFix Target Multiversioning renaming.
Erich Keane [Mon, 9 Mar 2020 15:06:58 +0000 (08:06 -0700)]
Fix Target Multiversioning renaming.

The initial implementation only did 'first declaration renaming' when
a default version came after. This is insufficient in cases where a
default does not exist, so this patch makes sure that we do the renaming
in all cases.

This renaming is necessary because we emit the first declaration before
knowing that it IS a target multiversion function, which would change
its name. The second declaration (the one that caused the
multiversioning) then needs to make sure that the first one has its name
changed to be consistent with the resolver usage.

4 years ago[lld] Add .clang-tidy to customize readability-identifier-naming.{Member,Parameter...
Fangrui Song [Sat, 7 Mar 2020 17:10:50 +0000 (09:10 -0800)]
[lld] Add .clang-tidy to customize readability-identifier-naming.{Member,Parameter,Variable}Case => camelBack

lld/.clang-tidy is almost identical to the top-level .clang-tidy, with the aforementioned customization.

Reviewed By: ruiu

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

4 years ago[llvm-objdump] Rename --disassemble-functions to --disassemble-symbols
Fangrui Song [Sat, 7 Mar 2020 20:55:44 +0000 (12:55 -0800)]
[llvm-objdump] Rename --disassemble-functions to --disassemble-symbols

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

The feature can disassemble data and the new option name reflects its
more generic usage.

Reviewed By: jhenderson

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

4 years ago[lldb] Fix windows build, second attempt
Pavel Labath [Mon, 9 Mar 2020 15:24:34 +0000 (16:24 +0100)]
[lldb] Fix windows build, second attempt

4 years ago[llvm-objdump][test] Move binary format specific tests under COFF/ ELF/ MachO/ XCOFF...
Fangrui Song [Sat, 7 Mar 2020 05:49:40 +0000 (21:49 -0800)]
[llvm-objdump][test] Move binary format specific tests under COFF/ ELF/ MachO/ XCOFF/ wasm/

Reviewed By: grimar

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

4 years ago[clangd] Bump vscode-clangd v0.0.21.
Haojian Wu [Mon, 9 Mar 2020 14:36:49 +0000 (15:36 +0100)]
[clangd] Bump vscode-clangd v0.0.21.

CHANGELOG:
- better ranking for completions
- enable dot-to-arrow fix in code completion

4 years ago[MLIR] Change custom printer/parser for loop.parallel and loop.reduce.
Alexander Belyaev [Mon, 9 Mar 2020 14:03:33 +0000 (15:03 +0100)]
[MLIR] Change custom printer/parser for loop.parallel and loop.reduce.

4 years ago[Hexagon] Fix match pattern in a testcase
Krzysztof Parzyszek [Mon, 9 Mar 2020 14:08:02 +0000 (09:08 -0500)]
[Hexagon] Fix match pattern in a testcase

4 years ago[lldb] Fix windows&freebsd builds for c0b1af68
Pavel Labath [Mon, 9 Mar 2020 13:55:43 +0000 (14:55 +0100)]
[lldb] Fix windows&freebsd builds for c0b1af68

4 years ago[Analyzer] Mark constant member functions const in CheckerManager
Adam Balogh [Mon, 9 Mar 2020 09:48:56 +0000 (10:48 +0100)]
[Analyzer] Mark constant member functions const in CheckerManager

Most of the getter functions (and a reporter function) in
`CheckerManager` are constant but not marked as `const`. This prevents
functions having only a constant reference to `CheckerManager` using
these member functions. This patch fixes this issue.

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

4 years ago[pstl] Clean up parameter uglifications
Thomas Rodgers [Mon, 9 Mar 2020 13:15:45 +0000 (09:15 -0400)]
[pstl] Clean up parameter uglifications

Summary: These were overlooked on an earlier uglification pass.

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

4 years ago[lldb] Return Unwinder& from Thread::GetUnwinder
Pavel Labath [Mon, 9 Mar 2020 13:10:41 +0000 (14:10 +0100)]
[lldb] Return Unwinder& from Thread::GetUnwinder

The function always returns a valid object. Let the return type reflect
that, and remove some null checks.

4 years ago[clangd][vscode] Enable dot-to-arrow fixes in clangd completion.
Haojian Wu [Fri, 6 Mar 2020 14:08:23 +0000 (15:08 +0100)]
[clangd][vscode] Enable dot-to-arrow fixes in clangd completion.

Summary:
The previous issue is that the item was filtered out by vscode, because
the prefix (which contains ".") are not matched against the filterText.

This patch works around it by adjusting the item filterText, inspired by
https://reviews.llvm.org/D75623.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[DebugInfo] Add check for .debug_line minimum_instruction_length of 0
James Henderson [Tue, 25 Feb 2020 16:07:16 +0000 (16:07 +0000)]
[DebugInfo] Add check for .debug_line minimum_instruction_length of 0

If the minimum_instruction_length of a debug line program is 0, no
address advancing via special opcodes, DW_LNS_const_add_pc, and
DW_LNS_advance_pc can occur, since the minimum_instruction_length is
used in a multiplication. This patch adds a warning reporting when this
issue occurs.

Reviewed by: probinson

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

4 years ago[DebugInfo] Prevent crash when .debug_line line_range is zero
James Henderson [Tue, 25 Feb 2020 15:08:07 +0000 (15:08 +0000)]
[DebugInfo] Prevent crash when .debug_line line_range is zero

The line_range value of a debug line program header is used in divisions
related to special opcodes and DW_LNS_const_add_pc opcodes. As such, a
value of 0 cannot be used. This change introduces a new warning, if such
a situation is identified, and does not perform the relevant
calculations.

Reviewed by: probinson, aprantl

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

4 years ago[DebugInfo] Report unsupported maximum_operations_per_instruction values
James Henderson [Wed, 19 Feb 2020 15:03:01 +0000 (15:03 +0000)]
[DebugInfo] Report unsupported maximum_operations_per_instruction values

This patch adds a check which reports an unsupported value of the
maximum_operations_per_instruction field in a debug line table header.
This is reported once per line table, at most, and only if the tablet
would otherwise need to use it (i.e. never for tables with version 3 or
less, or for tables which don't use DW_LNS_const_add_pc or special
opcodes). Unsupported values are currently any apart from 1.

Reviewed by: probinson, MaskRay

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

4 years ago[NFC][DebugInfo] Refactor address advancing operations to share code
James Henderson [Wed, 19 Feb 2020 14:03:02 +0000 (14:03 +0000)]
[NFC][DebugInfo] Refactor address advancing operations to share code

This change is a preparatory change for subsequent commits.

Reviewed by: probinson

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

4 years ago[lldb] Reduce duplication in the Disassembler class
Pavel Labath [Thu, 5 Mar 2020 13:42:03 +0000 (14:42 +0100)]
[lldb] Reduce duplication in the Disassembler class

Summary:
The class has two pairs of functions whose functionalities differ in
only how one specifies how much he wants to disasseble. One limits the
process by the size of the input memory region. The other based on the
total amount of instructions disassembled. They also differ in various
features (like error reporting) that were only added to one of the
versions.

There are various ways in which this could be addressed. This patch
does it by introducing a helper struct called "Limit", which is
effectively a pair specifying the value that you want to limit, and the
actual limit itself.

Reviewers: JDevlieghere

Subscribers: sdardis, jrtc27, atanasyan, lldb-commits

Tags: #lldb

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

4 years ago[XRay] Sanitize DOT labels in graph output
Alex Cameron [Mon, 9 Mar 2020 11:58:12 +0000 (11:58 +0000)]
[XRay] Sanitize DOT labels in graph output

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

This patch is to convert certain characters to their XML escape sequences when generating labels for a DOT graph.

I had trouble reproducing the exact issue described on the tracker. I ran `llvm-xray graph` on a log from a test program that included function templates but wasn't able to get the `dot` tool to complain about the `<` and `>` characters. The documentation also suggests that the escape sequences should only be necessary when using HTML string labels which XRay doesn't use (`label=<...>` as opposed to `label="..."`). Perhaps newer versions of Graphviz silently handle this in the case of quoted-string labels.

In any case, the generated labels still look correct after this patch and should also fix the reporter's issue.

I was a bit unsure how to add a test for this since the existing tests seem to only care about `func-id` rather than giving an actual name. If you could give me a hint on the best way to go about this, that'd be much appreciated!

Reviewers: dberris

Reviewed By: dberris

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

4 years ago[WPD] Provide a way to prevent functions from being devirtualized
evgeny [Mon, 9 Mar 2020 11:05:15 +0000 (14:05 +0300)]
[WPD] Provide a way to prevent functions from being devirtualized

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

4 years ago[CallSiteInfo] Enable the call site info only for -g + optimizations
Djordje Todorovic [Mon, 9 Mar 2020 10:02:35 +0000 (11:02 +0100)]
[CallSiteInfo] Enable the call site info only for -g + optimizations

Emit call site info only in the case of '-g' + 'O>0' level.

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

4 years ago[analyzer] Skip analysis of inherited ctor as top-level function
Gabor Marton [Mon, 9 Mar 2020 10:58:20 +0000 (11:58 +0100)]
[analyzer] Skip analysis of inherited ctor as top-level function

Summary:
This fixes a regression introduced in https://reviews.llvm.org/D74735

Reviewers: NoQ, Szelethus

Tags: #clang

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

4 years ago[ASTImporter] Added visibility check for variable templates.
Balázs Kéri [Mon, 9 Mar 2020 10:01:48 +0000 (11:01 +0100)]
[ASTImporter] Added visibility check for variable templates.

Summary:
ASTImporter makes now difference between variable templates
with same name in different translation units if not visible
outside.

Reviewers: a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

Subscribers: dkrupp, Szelethus, gamesh411, teemperor, martong, cfe-commits

Tags: #clang

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

4 years agoRevert "Recommit "[Driver] Default to -fno-common for all targets""
Sjoerd Meijer [Mon, 9 Mar 2020 10:37:28 +0000 (10:37 +0000)]
Revert "Recommit "[Driver] Default to -fno-common for all targets""

This reverts commit 2c36c23f3476baf3b9283ea387c579419a70b112.

Still problems in the test-suite, which I really thought I had fixed...

4 years ago[OpenCL] Fix 'any' and 'all' builtins
Sven van Haastregt [Mon, 9 Mar 2020 10:26:11 +0000 (10:26 +0000)]
[OpenCL] Fix 'any' and 'all' builtins

These should only be defined for signed integer types according to
OpenCL v2.0 s6.12.6.

4 years ago[AArch64] Add support for Fujitsu A64FX
KAWASHIMA Takahiro [Tue, 3 Mar 2020 12:52:27 +0000 (21:52 +0900)]
[AArch64] Add support for Fujitsu A64FX

A64FX is an Armv8.2-A CPU used in FUJITSU Supercomputer
PRIMEHPC FX1000, PRIMEHPC FX700, and supercomputer Fugaku.

https://www.fujitsu.com/global/products/computing/servers/supercomputer/specifications/

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

4 years agoRecommit "[Driver] Default to -fno-common for all targets"
Sjoerd Meijer [Mon, 9 Mar 2020 10:07:37 +0000 (10:07 +0000)]
Recommit "[Driver] Default to -fno-common for all targets"

This includes fixes for:
- test-suite: some benchmarks need to be compiled with -fcommon, see D75557.
- compiler-rt: one test needed -fcommon, and another a change, see D75520.

4 years ago[Analyzer][StreamChecker] Check for opened stream before operations.
Balázs Kéri [Mon, 9 Mar 2020 09:15:31 +0000 (10:15 +0100)]
[Analyzer][StreamChecker] Check for opened stream before operations.

Summary:
According to documentations, after an `fclose` call any other stream
operations cause undefined behaviour, regardless if the close failed
or not.
This change adds the check for the opened state before all other
(applicable) operations.

Reviewers: Szelethus

Reviewed By: Szelethus

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, cfe-commits

Tags: #clang

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

4 years ago[ExpandMemCmp] Properly constant-fold all compares.
Clement Courbet [Tue, 3 Mar 2020 12:17:21 +0000 (13:17 +0100)]
[ExpandMemCmp] Properly constant-fold all compares.

Summary:
This gets rid of duplicated code and diverging behaviour w.r.t.
constants.
Fixes PR45086.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFix build failure from rG223a43ee8d89
Nathan James [Mon, 9 Mar 2020 08:12:52 +0000 (08:12 +0000)]
Fix build failure from rG223a43ee8d89

4 years ago[ExpandMemCmp] Properly constant-fold all compares.
Clement Courbet [Tue, 3 Mar 2020 12:17:21 +0000 (13:17 +0100)]
[ExpandMemCmp] Properly constant-fold all compares.

Summary:
This gets rid of duplicated code and diverging behaviour w.r.t.
constants.
Fixes PR45086.

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb/test] Remove skip arm/aarch64 decorator from instruction counting tests
Muhammad Omair Javaid [Mon, 9 Mar 2020 07:52:08 +0000 (12:52 +0500)]
[lldb/test] Remove skip arm/aarch64 decorator from instruction counting tests

This patch removes skipIf decorator from instruction counting tests.
We now use inline intruction in testing inferior to make sure that
number of instructions stays fixed. This was tested on aarch64 linux.

4 years ago[clang-tidy] [NFC] Remove unnecessary matchers
Nathan James [Mon, 9 Mar 2020 00:48:51 +0000 (00:48 +0000)]
[clang-tidy] [NFC] Remove unnecessary matchers

Reviewers: aaron.ballman, alexfh, gribozavr2

Reviewed By: aaron.ballman

Subscribers: wuzish, nemanjai, xazax.hun, kbarton, cfe-commits

Tags: #clang, #clang-tools-extra

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

4 years agoadd extern "C" to __errno_location's definition if in __cplusplus file
Alex Brachet [Mon, 9 Mar 2020 07:10:59 +0000 (03:10 -0400)]
add extern "C" to __errno_location's definition if in __cplusplus file

4 years ago[Attributor] Deduction based on path exploration
Hideto Ueno [Mon, 9 Mar 2020 05:19:32 +0000 (14:19 +0900)]
[Attributor] Deduction based on path exploration

This patch introduces the propagation of known information based on path exploration.
For example,
```
int u(int c, int *p){
  if(c) {
     return *p;
  } else {
     return *p + 1;
  }
}
```
An argument `p` is dereferenced whatever c's value is.

For an instruction `CtxI`, we accumulate branch instructions in the must-be-executed-context of `CtxI` and then, we take the conjunction of the successors' known state.

Reviewed By: jdoerfert

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

4 years ago[MLIR] NFC: modernize affine loop fusion test cases
Uday Bondhugula [Mon, 9 Mar 2020 04:27:26 +0000 (04:27 +0000)]
[MLIR] NFC: modernize affine loop fusion test cases

- update test case for readability, avoid unnecessary matches

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D75823

4 years ago[MLIR][Affine] NFC: add convenience method for affine data copy for a loop body
Uday Bondhugula [Mon, 9 Mar 2020 04:21:40 +0000 (04:21 +0000)]
[MLIR][Affine] NFC: add convenience method for affine data copy for a loop body

add convenience method for affine data copy generation for a loop body

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D75822

4 years ago[X86] Remove isel patterns that matched vXi16 X86VBroadcast with i8->i16 aextload...
Craig Topper [Sun, 8 Mar 2020 22:54:05 +0000 (15:54 -0700)]
[X86] Remove isel patterns that matched vXi16 X86VBroadcast with i8->i16 aextload input.

This was selecting VBROADCASTW which turned the 8-bit load into
a 16-bit load if it happened to be 2 byte aligned.

I have a plan to fix the regression with a follow up patch
which I'll post shortly.

4 years ago[ASTMatchers] adds isComparisonOperator to BinaryOperator and CXXOperatorCallExpr
Nathan James [Sat, 7 Mar 2020 09:51:43 +0000 (09:51 +0000)]
[ASTMatchers] adds isComparisonOperator to BinaryOperator and CXXOperatorCallExpr

Reviewers: aaron.ballman, gribozavr2

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years agoFix GCC warnings. NFC.
Michael Liao [Sun, 8 Mar 2020 16:59:21 +0000 (12:59 -0400)]
Fix GCC warnings. NFC.

4 years ago[ARM] MVE VMULL tests. NFC
David Green [Sun, 8 Mar 2020 13:01:18 +0000 (13:01 +0000)]
[ARM] MVE VMULL tests. NFC

4 years ago[VectorCombine] fold extract-extract-op with different extraction indexes
Sanjay Patel [Sun, 8 Mar 2020 13:57:55 +0000 (09:57 -0400)]
[VectorCombine] fold extract-extract-op with different extraction indexes

opcode (extelt V0, Ext0), (ext V1, Ext1) --> extelt (opcode (splat V0, Ext0), V1), Ext1

The first part of this patch generalizes the cost calculation to accept
different extraction indexes. The second part creates a shuffle+extract
before feeding into the existing code to create a vector op+extract.

The patch conservatively uses "TargetTransformInfo::SK_PermuteSingleSrc"
rather than "TargetTransformInfo::SK_Broadcast" (splat specifically
from element 0) because we do not have a more general "SK_Splat"
currently. That does not affect any of the current regression tests,
but we might be able to find some cost model target specialization where
that comes into play.

I suspect that we can expose some missing x86 horizontal op codegen with
this transform, so I'm speculatively adding a debug flag to disable the
binop variant of this transform to allow easier testing.

The test changes show that we're sensitive to cost model diffs (as we
should be), so that means that patches like D74976
should have better coverage.

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

4 years ago[VectorCombine] add tests for wider vectors; NFC
Sanjay Patel [Sun, 8 Mar 2020 13:33:07 +0000 (09:33 -0400)]
[VectorCombine] add tests for wider vectors; NFC

4 years ago[NFC][PowerPC] Order the MTSTR/MFSPR InstAlias definetion by SPR
Kang Zhang [Sun, 8 Mar 2020 11:58:53 +0000 (11:58 +0000)]
[NFC][PowerPC] Order the MTSTR/MFSPR InstAlias definetion by SPR

Summary:
This NFC patch is only modify the position of MTSTR/MFSPR InstAlias
definition. So it will be easy to read.

4 years ago[gn build] Port 57c964aaa76
LLVM GN Syncbot [Sun, 8 Mar 2020 11:50:36 +0000 (11:50 +0000)]
[gn build] Port 57c964aaa76

4 years ago[AssumeBundles] Move to IR so it can be used by Analysis
Tyker [Sun, 8 Mar 2020 11:19:29 +0000 (12:19 +0100)]
[AssumeBundles] Move to IR so it can be used by Analysis

Summary:
Assume bundles need to be usable by Analysis and Transforms/Utils isn't.
so this commit moves utilities to deal with asusme bundles to IR.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AssumeBundles] Add API to query a bundles from a use
Tyker [Sat, 7 Mar 2020 17:00:05 +0000 (18:00 +0100)]
[AssumeBundles] Add API to query a bundles from a use

Summary: Finding what information is know about a value from a use is generally useful and can be done quickly.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add DAG combine to turn (vzext_movl (vbroadcast_load)) -> vzext_load.
Craig Topper [Sun, 8 Mar 2020 08:15:26 +0000 (00:15 -0800)]
[X86] Add DAG combine to turn (vzext_movl (vbroadcast_load)) -> vzext_load.

If we're zeroing the other elements then we don't need the broadcast.

4 years agoRevert "[NFC][PowerPC] Remove the repeated definition for some InstAlias of mtspr...
Kang Zhang [Sun, 8 Mar 2020 06:32:12 +0000 (06:32 +0000)]
Revert "[NFC][PowerPC] Remove the repeated definition for some InstAlias of mtspr/mfspr"

This reverts commit 46126a30f268a54dc68a40ca07556cf8aca5edbc.
Some test cases failed.

4 years ago[NFC][PowerPC] Remove the repeated definition for some InstAlias of mtspr/mfspr
Kang Zhang [Sun, 8 Mar 2020 06:02:55 +0000 (06:02 +0000)]
[NFC][PowerPC] Remove the repeated definition for some InstAlias of mtspr/mfspr

Summary:
Below InstAlias have been redeclaration, this patch is to remove them.
mtdec/mfdec   mtsdr1/mfsdr1     mtsrr0/mfsrr0    mtsrr1/mfsrr1

4 years agoFix lldb build failure due to clang mangler change
Yaxun (Sam) Liu [Sun, 8 Mar 2020 05:38:30 +0000 (00:38 -0500)]
Fix lldb build failure due to clang mangler change

4 years ago[NFC] Let mangler accept GlobalDecl
Yaxun (Sam) Liu [Thu, 5 Mar 2020 17:02:13 +0000 (12:02 -0500)]
[NFC] Let mangler accept GlobalDecl

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

4 years ago[libc] [NFC] Use matchers in tests
Alex Brachet [Sun, 8 Mar 2020 03:56:03 +0000 (22:56 -0500)]
[libc] [NFC] Use matchers in tests

Summary:
Use `EXPECT_THAT` where possible in tests NFC intended.

Added a `void *` template instantiation of `StreamWrapper::operator<<`

Reviewers: sivachandra, PaulkaToast

Reviewed By: sivachandra

Subscribers: MaskRay, tschuett, libc-commits

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

4 years ago[Sema] Add -Wpointer-to-enum-cast and -Wvoid-pointer-to-enum-cast
Nathan Chancellor [Sun, 8 Mar 2020 00:37:44 +0000 (16:37 -0800)]
[Sema] Add -Wpointer-to-enum-cast and -Wvoid-pointer-to-enum-cast

GCC does not warn on casts from pointers to enumerators, while clang
currently does: https://godbolt.org/z/3DFDVG

This causes a bunch of extra warnings in the Linux kernel, where
certain structs contain a void pointer to avoid using a gigantic
union for all of the various types of driver data, such as
versions.

Add a diagnostic that allows certain projects like the kernel to
disable the warning just for enums, which allows those projects to
keep full compatibility with GCC but keeps the intention of treating
casts to integers and enumerators the same by default so that other
projects have the opportunity to catch issues not noticed before (or
follow suite and disable the warning).

Link: https://github.com/ClangBuiltLinux/linux/issues/887
Reviewed By: rjmccall

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

4 years ago[X86] Add DAG combine to replace vXi64 vzext_movl+scalar_to_vector with vYi32 vzext_m...
Craig Topper [Sun, 8 Mar 2020 00:14:26 +0000 (16:14 -0800)]
[X86] Add DAG combine to replace vXi64 vzext_movl+scalar_to_vector with vYi32 vzext_movl+scalar_to_vector if the upper 32 bits of the scalar are zero.

We can just use a 32-bit copy and zero in the SSE domain when we
zero the upper bits.

Remove an isel pattern that becomes dead with this.

4 years ago[X86] Add DAG combines to enable removing of movddup/vbroadcast + simple_load isel...
Craig Topper [Sat, 7 Mar 2020 22:39:53 +0000 (14:39 -0800)]
[X86] Add DAG combines to enable removing of movddup/vbroadcast + simple_load isel patterns.

4 years ago[X86] Add a DAG combine to turn vbroadcast(vzload X) -> vbroadcast_load
Craig Topper [Sat, 7 Mar 2020 19:33:10 +0000 (11:33 -0800)]
[X86] Add a DAG combine to turn vbroadcast(vzload X) -> vbroadcast_load

Remove now unneeded isel patterns.

4 years ago[Index/USRGeneration] Make sure that ObjC properties in categories also get namescope...
Argyrios Kyrtzidis [Sat, 7 Mar 2020 23:04:23 +0000 (15:04 -0800)]
[Index/USRGeneration] Make sure that ObjC properties in categories also get namescoped properly for USR generation

If the property is in a category that has module names from external_declaration property, make sure they are included in the USR.

rdar://59897320

4 years ago[NFC][Test commit] Remove redundant point in docs
kpdev [Sat, 7 Mar 2020 07:30:42 +0000 (10:30 +0300)]
[NFC][Test commit] Remove redundant point in docs

4 years ago[Sema] Initialize IsSurrogate
Rafael Ávila de Espíndola [Sat, 7 Mar 2020 18:52:51 +0000 (10:52 -0800)]
[Sema] Initialize IsSurrogate

This fixes https://bugs.llvm.org/show_bug.cgi?id=45096

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

4 years ago[SYCL] Driver option to select SYCL version
Ruyman [Fri, 26 Jul 2019 15:21:01 +0000 (16:21 +0100)]
[SYCL] Driver option to select SYCL version

Summary:
User can select the version of SYCL the compiler will
use via the flag -sycl-std, similar to -cl-std.

The flag defines the LangOpts.SYCLVersion option to the
version of SYCL. The default value is undefined.
If driver is building SYCL code, flag is set to the default SYCL
version (1.2.1)

The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro,
which should be defined according to SYCL 1.2.1 standard.

Only valid value at this point for the flag is 1.2.1.

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Signed-off-by: Ruyman Reyes <ruyman@codeplay.com>
Subscribers: ebevhan, Anastasia, cfe-commits

Tags: #clang

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

4 years ago[X86] Use MVT instead of EVT in a couple shuffle lowering functions.
Craig Topper [Sat, 7 Mar 2020 06:29:34 +0000 (22:29 -0800)]
[X86] Use MVT instead of EVT in a couple shuffle lowering functions.

4 years agoFix MLIR clang-tidy: when tweaking it does not inherit from the parent
Mehdi Amini [Sat, 7 Mar 2020 17:43:10 +0000 (17:43 +0000)]
Fix MLIR clang-tidy: when tweaking it does not inherit from the parent

It is almost identical to the top-level .clang-tidy, except that
{Member,Parameter,Variable}Case use camelBack.

4 years ago[lldb] Un-XFAIL two tests on NetBSD
Michał Górny [Sat, 7 Mar 2020 17:35:22 +0000 (18:35 +0100)]
[lldb] Un-XFAIL two tests on NetBSD

4 years ago[InstCombine] Fix known bits handling in SimplifyDemandedUseBits
Nikita Popov [Sat, 7 Mar 2020 11:18:05 +0000 (12:18 +0100)]
[InstCombine] Fix known bits handling in SimplifyDemandedUseBits

Fixes a regression from D75801. SimplifyDemandedUseBits() is also
supposed to compute the known bits (of the demanded subset) of the
instruction. For unknown instructions it does so by directly calling
computeKnownBits(). For known instructions it will compute known
bits itself. However, for instructions where only some cases are
handled directly (e.g. a constant shift amount) the known bits
invocation for the unhandled case is sometimes missing. This patch
adds the missing calls and thus removes the main discrepancy with
ExpensiveCombines mode.

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

4 years agoAssume ieee behavior without denormal-fp-math attribute
Matt Arsenault [Wed, 6 Nov 2019 18:26:43 +0000 (10:26 -0800)]
Assume ieee behavior without denormal-fp-math attribute

4 years ago[InstCombine] Regenerate test checks; NFC
Nikita Popov [Sat, 7 Mar 2020 16:18:39 +0000 (17:18 +0100)]
[InstCombine] Regenerate test checks; NFC

4 years ago[InstSimplify] Add tests for "returned" attribute; NFC
Nikita Popov [Sat, 7 Mar 2020 15:25:33 +0000 (16:25 +0100)]
[InstSimplify] Add tests for "returned" attribute; NFC

4 years ago[InstCombine] Add additional known bits folding tests; NFC
Nikita Popov [Sat, 7 Mar 2020 11:59:16 +0000 (12:59 +0100)]
[InstCombine] Add additional known bits folding tests; NFC

4 years ago[InstCombine] Highlight tests using expensive combines; NFC
Nikita Popov [Sat, 7 Mar 2020 09:56:29 +0000 (10:56 +0100)]
[InstCombine] Highlight tests using expensive combines; NFC

4 years ago[InstCombine] regenerate complete test checks; NFC
Sanjay Patel [Sat, 7 Mar 2020 15:20:38 +0000 (10:20 -0500)]
[InstCombine] regenerate complete test checks; NFC

4 years ago[InstCombine] add test for gep (select),... (PR45084); NFC
Sanjay Patel [Sat, 7 Mar 2020 15:00:31 +0000 (10:00 -0500)]
[InstCombine] add test for gep (select),... (PR45084); NFC

4 years ago[DebugInfo]: Added DWARFv5 macro header flags and corresponding helper
Sourabh Singh Tomar [Sat, 7 Mar 2020 12:20:07 +0000 (17:50 +0530)]
[DebugInfo]: Added DWARFv5 macro header flags and corresponding helper
functions.

4 years ago[Attributor] Fold terminators before changing instructions to unreachable
Stefanos Baziotis [Sat, 7 Mar 2020 10:38:44 +0000 (12:38 +0200)]
[Attributor] Fold terminators before changing instructions to unreachable

It is possible that an instruction to be changed to unreachable is
in the same block with a terminator that can be constant-folded.
In this case, as of now, the instruction will be changed to
unreachable before the terminator is folded. But, then the
whole BB becomes invalidated and so when we go ahead to fold
the terminator, we trap.

Change the order of these two.

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

4 years ago[mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
River Riddle [Sat, 7 Mar 2020 07:01:49 +0000 (23:01 -0800)]
[mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
MSVC

MSVC has problems if the type of the bitfield is different, leading to
invalid code generation.

4 years ago[mlir][nfc] Fix building mlir_c_runner_utils for Windows
Mason Remy [Sat, 7 Mar 2020 06:42:38 +0000 (22:42 -0800)]
[mlir][nfc] Fix building mlir_c_runner_utils for Windows

Summary:
On Windows, building `mlir_c_runner_utils` doesn't properly export
symbols, thus resulting in an implib not being created, which causes
an error when consuming LLVM from external projects.

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

4 years ago[mlir][NFC] remove stray decl of toAffineExpr, rename for readability
Uday Bondhugula [Sat, 7 Mar 2020 06:36:28 +0000 (22:36 -0800)]
[mlir][NFC] remove stray decl of toAffineExpr, rename for readability

Summary:
- remove stray toAffineExpr decl in affine analysis (name duplicate of
  mlir::toAffineExpr)

- rename mlir::toAffineExpr for better readability

- related NFC changes

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D75694

4 years agoRevert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already...
Amara Emerson [Thu, 5 Mar 2020 19:57:45 +0000 (11:57 -0800)]
Revert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already-local uses.""

This reverts commit 5583c2f2fba5be1df60f00cbc34a5098b5a49909.

The lldb bot failure was a test that was fragile and sensitive to irrelevant
changes in instruction ordering. Re-committing this as the test should have
been skipped for AArch64 now.

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

4 years agoAdd the CodeReview Documentation to GettingInvolved TOC
Hal Finkel [Sat, 7 Mar 2020 04:55:46 +0000 (04:55 +0000)]
Add the CodeReview Documentation to GettingInvolved TOC

4 years agoHigh-Level Code-Review Documentation Update
Hal Finkel [Thu, 26 Dec 2019 21:56:26 +0000 (21:56 +0000)]
High-Level Code-Review Documentation Update

This is an update to the documentation of our community code-review process.
Based on the RFC: High-Level Code-Review Documentation Update
(http://lists.llvm.org/pipermail/llvm-dev/2019-November/136808.html).

In this patch, I've pulled out the documentation into a separate file, and
broken it into a number of subsections. This is, of course, just one further
step in better documenting our community processes. I expect we'll continue to
improve this over time. Thank you to everyone who provided feedback!

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

4 years ago[mlir] Explicitly qualify Effect to avoid MSVC build failure
River Riddle [Sat, 7 Mar 2020 03:18:13 +0000 (19:18 -0800)]
[mlir] Explicitly qualify Effect to avoid MSVC build failure

MSVC qualifies the Effect reference contextually depending on where the
template is instantiated, leading to compiler failures if there is a
different Effect class defined.

4 years ago[gn build] copy compiler-rt headers to clang include dir on all platforms
Nico Weber [Sat, 7 Mar 2020 02:55:45 +0000 (21:55 -0500)]
[gn build] copy compiler-rt headers to clang include dir on all platforms

4 years ago[lldb][NFC] Make TestStats.py not an inline test
Raphael Isemann [Sat, 7 Mar 2020 02:42:20 +0000 (18:42 -0800)]
[lldb][NFC] Make TestStats.py not an inline test

There is still the bug that empty lines seem to skip any following expressions
and it makes it harder to commend between all the comments. Let's make this
a normal test instead which is just slightly more verbose but can be properly
formatted.

4 years ago[lldb][NFC] Refactor our option generation out of EvaluateExpression
Raphael Isemann [Sat, 7 Mar 2020 02:27:46 +0000 (18:27 -0800)]
[lldb][NFC] Refactor our option generation out of EvaluateExpression

4 years agoFix a copy and paste error that would cause a crash.
Greg Clayton [Fri, 6 Mar 2020 22:59:41 +0000 (14:59 -0800)]
Fix a copy and paste error that would cause a crash.

Summary: The wrong variable was being checked for an error, which mean a llvm::Error went unchecked and crashes dsymutil. Discovered this when trying to feed an ELF file to "dsymutil --update" and running into the crash.

Reviewers: aprantl, JDevlieghere

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[clang-doc] Improving Markdown Output
Petr Hosek [Sat, 7 Mar 2020 01:33:56 +0000 (17:33 -0800)]
[clang-doc] Improving Markdown Output

This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

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

4 years ago[lldb] Never compile the debugserver with Clang module flags
Raphael Isemann [Sat, 7 Mar 2020 01:24:56 +0000 (17:24 -0800)]
[lldb] Never compile the debugserver with Clang module flags

Summary:
Compiling ObjC++ with Clang modules is usually not working well and compiling
the small debugserver with modules is not worth the trouble.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb][cmake] Move remove_module_flags macro to AddLLDB.cmake
Raphael Isemann [Sat, 7 Mar 2020 01:07:23 +0000 (17:07 -0800)]
[lldb][cmake] Move remove_module_flags macro to AddLLDB.cmake

Summary: This is currently hidden in the Host CMakeLists but we should also use this macro in other parts of LLDB where we have ObjC++ sources (see D74891)

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years agotab completion for process signal
Raphael Isemann [Fri, 6 Mar 2020 23:49:23 +0000 (15:49 -0800)]
tab completion for process signal

Summary: Provide a list of Unix signals for the tap completion for command "process signal".

Reviewers: teemperor

Subscribers: labath, jingham, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[CodeGen][ObjC] Extend lifetime of ObjC pointers passed to calls to
Akira Hatanaka [Tue, 11 Feb 2020 21:09:18 +0000 (13:09 -0800)]
[CodeGen][ObjC] Extend lifetime of ObjC pointers passed to calls to
__builtin_os_log_format

This is needed to keep all the objects, including temporaries returned
by function calls, written to the buffer alive until os_log_pack_send is
called.

rdar://problem/60105410

4 years ago[MLIR] Add document about creating a dialect.
Stephen Neuendorffer [Fri, 6 Mar 2020 19:26:56 +0000 (11:26 -0800)]
[MLIR] Add document about creating a dialect.

Goal is also to document best naming practices from here:
https://llvm.discourse.group/t/rfc-canonical-file-paths-to-dialects/621

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

4 years ago[lldb][NFC] Refactor TestSafeFuncCalls.py
Raphael Isemann [Fri, 6 Mar 2020 19:21:54 +0000 (11:21 -0800)]
[lldb][NFC] Refactor TestSafeFuncCalls.py

Summary:
This patch inlines all the single-line functions that we only use once in the test
and replaces the assertTrue with an assertEquals to improve the error message
when this test fails.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[MLIR] Add missing DEPENDS line for MLIRSPIRV
Stephen Neuendorffer [Fri, 6 Mar 2020 23:10:14 +0000 (15:10 -0800)]
[MLIR] Add missing DEPENDS line for MLIRSPIRV

This line was inadvertantly left off, which results in missing dependencies
and a potentially broken build

4 years agoExtend TimeTrace to LLVM's new pass manager
Andrew Monshizadeh [Fri, 6 Mar 2020 22:16:19 +0000 (14:16 -0800)]
Extend TimeTrace to LLVM's new pass manager

With the addition of the LLD time tracing it made sense to include coverage
for LLVM's various passes. Doing so ensures that ThinLTO is also covered
with a time trace.

Before:
{F11333974}

After:
{F11333928}

Reviewed By: rnk

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

4 years agoRefactor TimeProfiler write methods (NFC)
Andrew Monshizadeh [Fri, 6 Mar 2020 22:16:17 +0000 (14:16 -0800)]
Refactor TimeProfiler write methods (NFC)

Added a write method for TimeTrace that takes two strings representing
file names. The first is any file name that may have been provided by the
user via `time-trace-file` flag, and the second is a fallback that should
be configured by the caller. This method makes it cleaner to write the
trace output because there is no longer a need to check file names at the
caller and simplifies future TimeTrace usages.

Reviewed By: modocache

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

4 years ago[WebAssembly] Add SIMD integer min/max builtins
Thomas Lively [Fri, 6 Mar 2020 21:00:16 +0000 (13:00 -0800)]
[WebAssembly] Add SIMD integer min/max builtins

Summary:
Although SIMD integer min/max operations can be expressed using the ?:
operator in C++, that operator is disallowed for vectors in C. As a
workaround, this change introduces new WebAssembly-specific builtin
functions that lower to the desired vector icmp/select sequences.

Reviewers: aheejin, dschuff, kripken

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

4 years ago[mlir][SideEffects] Enable specifying side effects directly on the arguments/results...
River Riddle [Fri, 6 Mar 2020 21:55:36 +0000 (13:55 -0800)]
[mlir][SideEffects] Enable specifying side effects directly on the arguments/results of an operation.

Summary:
New classes are added to ODS to enable specifying additional information on the arguments and results of an operation. These classes, `Arg` and `Res` allow for adding a description and a set of 'decorators' along with the constraint. This enables specifying the side effects of an operation directly on the arguments and results themselves.

Example:
```
def LoadOp : Std_Op<"load"> {
  let arguments = (ins Arg<AnyMemRef, "the MemRef to load from",
                           [MemRead]>:$memref,
                       Variadic<Index>:$indices);
}
```

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