platform/upstream/llvm.git
4 years agoFix "control reaches end of non-void function" warning. NFCI.
Simon Pilgrim [Wed, 1 Apr 2020 13:08:25 +0000 (14:08 +0100)]
Fix "control reaches end of non-void function" warning. NFCI.

4 years ago[ARM] Extra vmull loop tests. NFC
David Green [Wed, 1 Apr 2020 12:12:56 +0000 (13:12 +0100)]
[ARM] Extra vmull loop tests. NFC

4 years agoRevert "[LSR] re-add testcase for wrongly phi node elimination - NFC"
shchenz [Wed, 1 Apr 2020 12:58:06 +0000 (12:58 +0000)]
Revert "[LSR] re-add testcase for wrongly phi node elimination - NFC"

This reverts commit f25a1b4f58d66805257a05f13e8581551574ce22.
ARM and hexagon fail at the new added case.

4 years ago[Alignment][NFC] Convert MIR Yaml to MaybeAlign
Guillaume Chatelet [Wed, 1 Apr 2020 09:25:48 +0000 (09:25 +0000)]
[Alignment][NFC] Convert MIR Yaml to MaybeAlign

Summary:
Although it may look like non NFC it is. especially the MIRParser may set `0` to the MachineFrameInfo and MachineFunction, but they all deal with `Align` internally and assume that `0` means `1`.
https://github.com/llvm/llvm-project/blob/93fc0ba145c2f9619d3174c95cacda5d4a0a2815/llvm/include/llvm/CodeGen/MachineFrameInfo.h#L483

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clangd-vscode] NFC; Improve wording in documentation and update VSCode tasks
Kirill Bobyrev [Wed, 1 Apr 2020 12:16:21 +0000 (14:16 +0200)]
[clangd-vscode] NFC; Improve wording in documentation and update VSCode tasks

Summary:
VSCode tasks are updated to the latest supported versions: deprecated
values are removed and replaced by their new counterparts.

Reviewers: hokein

Reviewed By: hokein

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

Tags: #clang

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

4 years ago[Target][ARM] Improvements to the VPT Block Insertion Pass
Pierre-vh [Mon, 9 Mar 2020 16:40:33 +0000 (16:40 +0000)]
[Target][ARM] Improvements to the VPT Block Insertion Pass

This allows the MVE VPT Block insertion pass to remove VPNOTs in
order to create more complex VPT blocks such as TE, TEET, TETE, etc.

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

4 years ago[Target][ARM] Change VPTMaskValues to the correct encoding
Pierre-vh [Fri, 13 Mar 2020 15:45:32 +0000 (15:45 +0000)]
[Target][ARM] Change VPTMaskValues to the correct encoding

VPTMaskValue was using the "instruction" encoding to represent the masks
(= the same encoding as the one used by the instructions in an object file),
but it is only used to build MCOperands, so it should use the MCOperand
encoding of the masks, which is slightly different.

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

4 years agoSilent failing TestWatchpointCount.py aarch64/linux
Muhammad Omair Javaid [Wed, 1 Apr 2020 11:01:36 +0000 (16:01 +0500)]
Silent failing TestWatchpointCount.py aarch64/linux

Skip TestWatchpointCount.py for aarch64-linux to fix lldb aarch64 linux buildbot.

http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/

4 years ago[lldb][NFC] Modernize TestExprChar
Raphael Isemann [Wed, 1 Apr 2020 10:55:57 +0000 (12:55 +0200)]
[lldb][NFC] Modernize TestExprChar

4 years ago[GVNSink] Simplify code. NFC.
Benjamin Kramer [Wed, 1 Apr 2020 11:12:46 +0000 (13:12 +0200)]
[GVNSink] Simplify code. NFC.

4 years ago[LSR] re-add testcase for wrongly phi node elimination - NFC
shchenz [Wed, 1 Apr 2020 09:51:07 +0000 (09:51 +0000)]
[LSR] re-add testcase for wrongly phi node elimination - NFC

Retest the case on X86/SystemZ/AArch64/PowerPC

4 years ago[clangd] Run semaCodeComplete only with a preamble
Kadir Cetinkaya [Wed, 1 Apr 2020 09:31:53 +0000 (11:31 +0200)]
[clangd] Run semaCodeComplete only with a preamble

Summary:
It is used by code completion and signature help. Code completion
already uses a special no-compile mode for missing preambles, so this change is
a no-op for that.

As for signature help, it already blocks for a preamble and missing it implies
clang has failed to parse the preamble and retrying it in signature help likely
will fail again. And even if it doesn't, request latency will be too high to be
useful as parsing preambles is expensive.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[Transforms][SROA] Promote allocas with mem2reg for scalable types
Cullen Rhodes [Tue, 24 Mar 2020 17:03:59 +0000 (17:03 +0000)]
[Transforms][SROA] Promote allocas with mem2reg for scalable types

Summary:
Aggregate types containing scalable vectors aren't supported and as far
as I can tell this pass is mostly concerned with optimisations on
aggregate types, so the majority of this pass isn't very useful for
scalable vectors.

This patch modifies SROA such that mem2reg is run on allocas with
scalable types that are promotable, but nothing else such as slicing is
done.

The use of TypeSize in this pass has also been updated to be explicitly
fixed size. When invoking the following methods in DataLayout:

    * getTypeSizeInBits
    * getTypeStoreSize
    * getTypeStoreSizeInBits
    * getTypeAllocSize

we now called getFixedSize on the resultant TypeSize. This is quite an
extensive change with around 50 calls to these functions, and also the
first change of this kind (being explicit about fixed vs scalable
size) as far as I'm aware, so feedback welcome.

A test is included containing IR with scalable vectors that this pass is
able to optimise.

Reviewed By: efriedma

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

4 years ago[X86][SSE] Handle basic inversion of PTEST/TESTP operands (PR38522)
Simon Pilgrim [Wed, 1 Apr 2020 09:56:36 +0000 (10:56 +0100)]
[X86][SSE] Handle basic inversion of PTEST/TESTP operands (PR38522)

PTEST/TESTP sets EFLAGS as:
TESTZ: ZF = (Op0 & Op1) == 0
TESTC: CF = (~Op0 & Op1) == 0
TESTNZC: ZF == 0 && CF == 0

If we are inverting the 0'th operand of a PTEST/TESTP instruction we can adjust the comparisons to correct handle the inversion implicitly.

Additionally, for "TESTZ" (ZF) cases, the allones case, PTEST(X,-1) can be simplified to PTEST(X,X).

We can expand this for the TESTZ(X,~Y) pattern and also handle KTEST/KORTEST in the future.

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

4 years agoRevert "[LSR] add testcase for wrongly phi node elimination - NFC"
shchenz [Wed, 1 Apr 2020 10:28:43 +0000 (10:28 +0000)]
Revert "[LSR] add testcase for wrongly phi node elimination - NFC"

This reverts commit dbf5e4f6c7f76d8086b01efed5c37dced3eed4b6.
The testcase has different behaviour on PowerPC and X86.

4 years ago[LSR] add testcase for wrongly phi node elimination - NFC
shchenz [Wed, 1 Apr 2020 09:51:07 +0000 (09:51 +0000)]
[LSR] add testcase for wrongly phi node elimination - NFC

4 years ago[NFC] [PowerPC] Add test for frsp elimination
Qiu Chaofan [Wed, 1 Apr 2020 09:53:20 +0000 (17:53 +0800)]
[NFC] [PowerPC] Add test for frsp elimination

4 years ago[X86] Do not assume types are legal in getFauxShuffleMask
Bjorn Pettersson [Tue, 31 Mar 2020 09:31:53 +0000 (11:31 +0200)]
[X86] Do not assume types are legal in getFauxShuffleMask

Summary:
Make sure we do not assert on value types not being
simple in getFauxShuffleMask when analysing operations
such as "v8i16 = truncate v8i24".

Reviewers: RKSimon

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb] [PECOFF] Only use PECallFrameInfo on the one supported architecture
Martin Storsjö [Sat, 28 Mar 2020 23:33:55 +0000 (01:33 +0200)]
[lldb] [PECOFF] Only use PECallFrameInfo on the one supported architecture

The RuntimeFunction struct, which PECallFrameInfo interprets, has a
different layout and differnet semantics on all architectures.

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

4 years ago[Alignment][NFC] Use Align in SelectionDAG::getMemIntrinsicNode
Guillaume Chatelet [Tue, 31 Mar 2020 15:49:40 +0000 (15:49 +0000)]
[Alignment][NFC] Use Align in SelectionDAG::getMemIntrinsicNode

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, nemanjai, hiraditya, kbarton, llvm-commits

Tags: #llvm

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

4 years ago[yaml2obj] - Add NBucket and NChain fields for the SHT_HASH section.
Georgii Rymar [Thu, 26 Mar 2020 10:13:39 +0000 (13:13 +0300)]
[yaml2obj] - Add NBucket and NChain fields for the SHT_HASH section.

These fields allows to override nchain and nbucket fields of a SHT_HASH section.

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

4 years ago[lldb] Inherit host environment when running shell commands
Pavel Labath [Tue, 31 Mar 2020 08:47:20 +0000 (10:47 +0200)]
[lldb] Inherit host environment when running shell commands

Summary:
On most hosts we were running shell commands with an empty environment.
The only exception was windows, which was inheriting the host enviroment
mostly by accident.

Running the commands in an empty environment does not sound like a
sensible default, so this patch changes Host::RunShellCommand to inherit
the host environment.  This impacts both commands run via
SBPlatform::Run (in case of host platforms), as well as the "platform
shell" CLI command.

Reviewers: jingham, friss

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[mlir][Pass] Add support for generating pass documention from the tablegen definition
River Riddle [Wed, 1 Apr 2020 08:51:50 +0000 (01:51 -0700)]
[mlir][Pass] Add support for generating pass documention from the tablegen definition

Summary:
This revision adds support for auto-generating pass documentation, replacing the need to manually keep Passes.md up-to-date. This matches the behavior already in place for dialect and interface documentation.

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

4 years ago[mlir][Pass] Add support for generating pass utilities via tablegen
River Riddle [Wed, 1 Apr 2020 08:50:29 +0000 (01:50 -0700)]
[mlir][Pass] Add support for generating pass utilities via tablegen

This revision adds support for generating utilities for passes such as options/statistics/etc. that can be inferred from the tablegen definition. This removes additional boilerplate from the pass, and also makes it easier to remove the reliance on the pass registry to provide certain things(e.g. the pass argument).

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

4 years ago[mlir][Pass] Move the registration of conversion passes to tablegen
River Riddle [Wed, 1 Apr 2020 08:49:43 +0000 (01:49 -0700)]
[mlir][Pass] Move the registration of conversion passes to tablegen

This removes the need to statically register conversion passes, and also puts all of the conversions within one centralized file.

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

4 years ago[mlir][Pass] Move the registration of dialect passes to tablegen
River Riddle [Wed, 1 Apr 2020 08:49:01 +0000 (01:49 -0700)]
[mlir][Pass] Move the registration of dialect passes to tablegen

This generates a Passes.td for all of the dialects that have transformation passes. This removes the need for global registration for all of the dialect passes.

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

4 years ago[mlir][Pass] Add a tablegen backend for defining Pass information
River Riddle [Wed, 1 Apr 2020 08:48:34 +0000 (01:48 -0700)]
[mlir][Pass] Add a tablegen backend for defining Pass information

This will greatly simplify a number of things related to passes:
* Enables generation of pass registration
* Enables generation of boiler plate pass utilities
* Enables generation of pass documentation

This revision focuses on adding the basic structure and adds support for generating the registration for passes in the Transforms/ directory. Future revisions will add more support and move more passes over.

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

4 years ago[clangd] Force delayed-template-parsing off in code completion.
Sam McCall [Tue, 31 Mar 2020 21:33:56 +0000 (23:33 +0200)]
[clangd] Force delayed-template-parsing off in code completion.

Summary:
It prevents code completion entirely in affected method bodies.
The main reason it's turned on is for compatibility with headers, so we turn it
off for the main file only. This is allowed because it's a compatible langopt.

Fixes https://github.com/clangd/clangd/issues/302

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[ConstantRange] Use APInt::or/APInt::and for single elements.
Florian Hahn [Wed, 1 Apr 2020 08:34:33 +0000 (09:34 +0100)]
[ConstantRange] Use APInt::or/APInt::and for single elements.

Currently ConstantRange::binaryAnd/binaryOr results are too pessimistic
for single element constant ranges.

If both operands are single element ranges, we can use APInt's AND and
OR implementations directly.

Note that some other binary operations on constant ranges can cover the
single element cases naturally, but for OR and AND this unfortunately is
not the case.

Reviewers: nikic, spatel, lebedev.ri

Reviewed By: spatel

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

4 years ago[clang] Minor cleanup in CloneDetectionTest
Raphael Isemann [Wed, 1 Apr 2020 08:48:48 +0000 (10:48 +0200)]
[clang] Minor cleanup in CloneDetectionTest

Follow up to e8f13f4f62f.

4 years agoAdd a method to build affine maps with zero or more results.
Ulysse Beaugnon [Wed, 1 Apr 2020 08:47:06 +0000 (10:47 +0200)]
Add a method to build affine maps with zero or more results.

Summary:
The commit provides a single method to build affine maps with zero or more
results. Users of mlir::AffineMap previously had to dispatch between two methods
depending on the number of results.

At the same time, this commit fixes the method for building affine map with zero
results that was previously ignoring its `symbolCount` argument.

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

4 years agotsan: fix Go build on Windows
Dmitry Vyukov [Wed, 1 Apr 2020 08:36:29 +0000 (10:36 +0200)]
tsan: fix Go build on Windows

Fix similar to https://reviews.llvm.org/D77111 but fow Windows.

gotsan.cpp:14071:16: error: missing terminating ' character [-Werror]
case 0b10'010:  // c.lwsp (rd != x0)
         ^

Reported-by: Keith Randall
4 years ago[Matrix] Add new test case with getelementptr constant exprs.
Florian Hahn [Wed, 1 Apr 2020 08:26:53 +0000 (09:26 +0100)]
[Matrix] Add new test case with getelementptr constant exprs.

The new test mostly ensures we keep doing the right thing for constant
expressions while lowering matrix instructions.

4 years ago[DAGCombiner] Require ninf for sqrt recip estimation
Qiu Chaofan [Wed, 1 Apr 2020 08:17:36 +0000 (16:17 +0800)]
[DAGCombiner] Require ninf for sqrt recip estimation

Currently, DAG combiner uses (fmul (rsqrt x) x) to estimate square
root of x. However, this method would return NaN if x is +Inf, which
is incorrect.

Reviewed By: spatel

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

4 years ago[Verifier] Verify matrix dimensions operands match vector size.
Florian Hahn [Wed, 1 Apr 2020 08:10:24 +0000 (09:10 +0100)]
[Verifier] Verify matrix dimensions operands match vector size.

This patch adds checks to the verifier to ensure the dimension arguments
passed to the matrix intrinsics match the vector types for their
arugments/return values.

Reviewers: anemet, Gerolf, andrew.w.kaylor, LuoYuanke

Reviewed By: anemet

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

4 years ago[lldb][NFC] Modernize TestXValuePrinting
Raphael Isemann [Wed, 1 Apr 2020 08:16:55 +0000 (10:16 +0200)]
[lldb][NFC] Modernize TestXValuePrinting

4 years ago[lldb][NFC] Modernize call-function tests
Raphael Isemann [Wed, 1 Apr 2020 08:06:28 +0000 (10:06 +0200)]
[lldb][NFC] Modernize call-function tests

4 years ago[MLIR] Rename collapsePLoops -> collapseParallelLoops
Tres Popp [Mon, 30 Mar 2020 11:26:46 +0000 (13:26 +0200)]
[MLIR] Rename collapsePLoops -> collapseParallelLoops

Summary:
Additionally, NFC code cleanups were done.

This is to address additional comments on
https://reviews.llvm.org/D76363

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

4 years ago[AVR] Fix function pointer address space
Vlastimil Labsky [Wed, 1 Apr 2020 08:05:45 +0000 (21:05 +1300)]
[AVR] Fix function pointer address space

Summary:
Function pointers should be created with program address space.
This fixes function pointers on AVR.

Reviewers: dylanmckay

Reviewed By: dylanmckay

Subscribers: Jim, cfe-commits

Tags: #clang

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

4 years ago[lldb][NFC] Modernize TestCallUserAnonTypedef
Raphael Isemann [Wed, 1 Apr 2020 07:45:20 +0000 (09:45 +0200)]
[lldb][NFC] Modernize TestCallUserAnonTypedef

4 years ago[MLIR] Replace OpBuilder(Block) with atBlockBegin and atBlockEnd
Tres Popp [Mon, 30 Mar 2020 14:52:59 +0000 (16:52 +0200)]
[MLIR] Replace OpBuilder(Block) with atBlockBegin and atBlockEnd

Summary:
OpBuilder(Block) is specifically replaced with
OpBuilder::atBlockEnd(Block);

This is to make insertion behavior clear due to there being no one
correct answer for which location in a block the default insertion
point should be.

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

4 years ago[TTI] Remove getCallCost
Sam Parker [Mon, 30 Mar 2020 10:44:20 +0000 (11:44 +0100)]
[TTI] Remove getCallCost

getCallCost is only used within the different layers of TTI, with no
backend implementing it so fold the base implementation into
getUserCost. I think this is an NFC.

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

4 years ago[VectorUtils][X86] De-templatize scaleShuffleMask and 2 X86 shuffle mask helpers...
Craig Topper [Wed, 1 Apr 2020 06:15:10 +0000 (23:15 -0700)]
[VectorUtils][X86] De-templatize scaleShuffleMask and 2 X86 shuffle mask helpers and move their implementation to cpp files

Summary: These were templated due to SelectionDAG using int masks for shuffles and IR using unsigned masks for shuffles. But now that D72467 has landed we have an int mask version of IRBuilder::CreateShuffleVector. So just use int instead of a template

Reviewers: spatel, efriedma, RKSimon

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

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

4 years ago[lldb] Allow expect_expr without a running target
Raphael Isemann [Wed, 1 Apr 2020 07:39:14 +0000 (09:39 +0200)]
[lldb] Allow expect_expr without a running target

Summary:
If we don't have a current frame then we can still run many expressions
as long as we have an active target. With this patch `expect_expr` directly
calls the target's EvaluateExpression function when there is no current frame.

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere

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

4 years ago[X86][AVX] Add additional 256/512-bit test cases for PACKSS/PACKUS shuffle patterns
Simon Pilgrim [Tue, 31 Mar 2020 21:40:33 +0000 (22:40 +0100)]
[X86][AVX] Add additional 256/512-bit test cases for PACKSS/PACKUS shuffle patterns

Also add lowerShuffleWithPACK call to lowerV32I16Shuffle - shuffle combining was catching it but we avoid a lot of temporary shuffle creations if we catch it at lowering first.

4 years ago[X86] Run XOP vector rotation tests with/without AVX2
Simon Pilgrim [Tue, 31 Mar 2020 18:58:29 +0000 (19:58 +0100)]
[X86] Run XOP vector rotation tests with/without AVX2

I noticed this while reviewing D77152 - by only testing bdver4 we weren't checking an XOP target that only had AVX1

4 years ago[clangd] Add a flag to turn on recovery-expr.
Haojian Wu [Tue, 31 Mar 2020 14:09:49 +0000 (16:09 +0200)]
[clangd] Add a flag to turn on recovery-expr.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[Frontend] Replace CC1 option -masm-verbose with -fno-verbose-asm
Fangrui Song [Wed, 1 Apr 2020 05:22:27 +0000 (22:22 -0700)]
[Frontend] Replace CC1 option -masm-verbose with -fno-verbose-asm

Most OS✕target enable -fverbose-asm, so it makes sense to flip the CC1
option to reduce common command lines.

4 years ago[Driver] Flip the CC1 default of -fdiagnostics-show-option
Fangrui Song [Wed, 1 Apr 2020 04:30:14 +0000 (21:30 -0700)]
[Driver] Flip the CC1 default of -fdiagnostics-show-option

The driver enables -fdiagnostics-show-option by default, so flip the CC1
default to reduce the lengths of common CC1 command lines.

This change also makes ParseDiagnosticArgs() consistently enable
-fdiagnostics-show-option by default.

4 years ago[lld][WebAssembly] Early error if output file cannot be created.
Sam Clegg [Sat, 28 Mar 2020 00:03:32 +0000 (17:03 -0700)]
[lld][WebAssembly] Early error if output file cannot be created.

This matches the behaviour of the ELF driver.

Also move the `createFiles` to be `checkConfig` and report `no input
files` there.   Again this is mostly to match the structure of the ELF
linker better.

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

4 years ago[mlir][Linalg] Extend fusion to support WAW atm on buffers.
Hanhan Wang [Wed, 1 Apr 2020 04:33:23 +0000 (21:33 -0700)]
[mlir][Linalg] Extend fusion to support WAW atm on buffers.

Summary:
The RAW fusion happens only if the produecer block dominates the consumer block.
The WAW pattern also works with the precondition. I.e., if a producer can
dominate the consumer, they can fairly fuse together.

Since they are all tilable, we can think the pattern like this way:

Input:
```
linalg_op1 view

tile_loop
  subview_2
  linalg_op2 subview_2
```

Tile the first Linalg op as same as the second Linalg.
```
tile_loop
  subview_1
  linalg_op1 subview_1

tile_loop
  subview_2
  liangl_op2 subview_2
```

Since the first Linalg op is tilable in the same way and the computation are
independently, it's fair to fuse it with the second Linalg op.
```
tile_loop
  subview_1
  linalg_op1 subview_1
  linalg_op2 subview_2
```

In short, this patch includes:
- Handling both RAW and WAW pattern.
- Adding a interface method to get input and output buffers.
- Exposing a method to get a StringRef of a dependency type.
- Fixing existing WAW tests and add one more use case: initialize the buffer
  before conv op.

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

4 years ago[mlir][Linalg] Introduce linalg.pooling_min/max/sum op.
Hanhan Wang [Wed, 1 Apr 2020 04:21:33 +0000 (21:21 -0700)]
[mlir][Linalg] Introduce linalg.pooling_min/max/sum op.

Summary:
Performs an N-D pooling operation similarly to the description in the TF
documentation:
https://www.tensorflow.org/api_docs/python/tf/nn/pool

Different from the description, this operation doesn't perform on batch and
channel. It only takes tensors of rank `N`.

```
  output[x[0], ..., x[N-1]] =
    REDUCE_{z[0], ..., z[N-1]}
      input[
            x[0] * strides[0] - pad_before[0] + dilation_rate[0]*z[0],
            ...
            x[N-1]*strides[N-1] - pad_before[N-1] + dilation_rate[N-1]*z[N-1]
            ],
```

The required optional arguments are:
  - strides: an i64 array specifying the stride (i.e. step) for window
    loops.
  - dilations: an i64 array specifying the filter upsampling/input
    downsampling rate
  - padding: an i64 array of pairs (low, high) specifying the number of
    elements to pad along a dimension.

If strides or dilations attributes are missing then the default value is
one for each of the input dimensions. Similarly, padding values are zero
for both low and high in each of the dimensions, if not specified.

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

4 years ago[clang][xray] Add xray attributes to functions without decls too
Ian Levesque [Wed, 1 Apr 2020 02:07:27 +0000 (22:07 -0400)]
[clang][xray] Add xray attributes to functions without decls too

Summary: This allows instrumenting things like global initializers

Reviewers: dberris, MaskRay, smeenai

Subscribers: cfe-commits, johnislarry

Tags: #clang

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

4 years ago[RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp
Shiva Chen [Tue, 31 Mar 2020 06:28:24 +0000 (14:28 +0800)]
[RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp

For the downstream RISCV maintenance, it would be easier to inherent
RISCVISelDAGToDAG by including header and only override the method that needs
to be customized for the provider non-standard ISA extension without touching
RISCVISelDAGToDAG.cpp which may cause conflict when upgrading the downstream
LLVM version.

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

4 years ago[PowerPC] Don't generate ST_VSR_SCAL_INT if power8-vector is disabled
Kai Luo [Wed, 1 Apr 2020 02:15:25 +0000 (02:15 +0000)]
[PowerPC] Don't generate ST_VSR_SCAL_INT if power8-vector is disabled

Summary:
In https://bugs.llvm.org/show_bug.cgi?id=45297, it fails selecting
instructions for `PPCISD::ST_VSR_SCAL_INT`. The reason it generate the
`PPCISD::ST_VSR_SCAL_INT` with `-power8-vector` in IR is PPC's
combiner checks `hasP8Altivec` rather than `hasP8Vector`. This patch
should resolve PR45297.

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

4 years ago[X86][MC] Disable Prefix padding after hardcode/prefix
Shengchen Kan [Tue, 31 Mar 2020 07:50:38 +0000 (15:50 +0800)]
[X86][MC] Disable Prefix padding after hardcode/prefix

Reviewers: reames, MaskRay, craig.topper, LuoYuanke, jyknight, eli.friedman

Reviewed By: craig.topper

Subscribers: hiraditya, llvm-commits, annita.zhang

Tags: #llvm

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

4 years agoFix simultaneous .gcda creation
KAWASHIMA Takahiro [Fri, 13 Mar 2020 12:54:06 +0000 (21:54 +0900)]
Fix simultaneous .gcda creation

The intent of the `llvm_gcda_start_file` function is that only
one process create the .gcda file and initialize it to be updated
by other processes later.

Before this change, if multiple processes are started simultaneously,
some of them may initialize the file because both the first and
second `open` calls may succeed in a race condition and `new_file`
becomes 1 in those processes. This leads incorrect coverage counter
values. This often happens in MPI (Message Passing Interface) programs.
The test program added in this change is a simple reproducer.

This change ensures only one process creates/initializes the file by
using the `O_EXCL` flag.

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

4 years ago[Driver] Don't pass -fobjc-rumtime= for non-ObjC input
Fangrui Song [Wed, 1 Apr 2020 00:37:46 +0000 (17:37 -0700)]
[Driver] Don't pass -fobjc-rumtime= for non-ObjC input

4 years agoFix diagnostics where _Atomic can't be applied
Weverything [Wed, 1 Apr 2020 00:16:38 +0000 (17:16 -0700)]
Fix diagnostics where _Atomic can't be applied

adb290d97482aa9311ee4b4b5917a0f2ece55b30 added a new case to
err_atomic_specifier_bad_type.  The diagnostic has two %select's
controlled by the same argument, but only the first was updated to have
the new case.  Add the extra case for the second %select and add a
test case that exercises the last case.

4 years ago[Driver] Don't pass -fmessage-length=0 to CC1
Fangrui Song [Tue, 31 Mar 2020 23:46:51 +0000 (16:46 -0700)]
[Driver] Don't pass -fmessage-length=0 to CC1

-fmessage-length=0 is common (unless the environment variable COLUMNS
is set and exported. This simplifies a common CC1 command line.

4 years ago[VectorOps] Implement a simple folder for identity vector.transpose operations.
Alex Grosul [Tue, 31 Mar 2020 20:43:32 +0000 (13:43 -0700)]
[VectorOps] Implement a simple folder for identity vector.transpose operations.

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

4 years agoAMDGPU/GlobalISel: Fix insert point when lowering G_FMAD
Matt Arsenault [Tue, 31 Mar 2020 23:24:50 +0000 (19:24 -0400)]
AMDGPU/GlobalISel: Fix insert point when lowering G_FMAD

4 years ago[Support] Delete ioctl TIOCGWINSZ
Fangrui Song [Tue, 31 Mar 2020 23:36:31 +0000 (16:36 -0700)]
[Support] Delete ioctl TIOCGWINSZ

D61326 essentially disabled `ioctl(FileID, TIOCGWINSZ, &ws)`.  Nobody
has complained for one year. So let's just delete the code.

4 years ago[analyzer] Use IgnoreImpCasts() instead of reimplementing it.
Nico Weber [Tue, 31 Mar 2020 23:32:26 +0000 (19:32 -0400)]
[analyzer] Use IgnoreImpCasts() instead of reimplementing it.

No intended behavior change.

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

4 years agoFix leak in GVNSink introduced in D72467.
Eli Friedman [Tue, 31 Mar 2020 23:17:26 +0000 (16:17 -0700)]
Fix leak in GVNSink introduced in D72467.

4 years agoForward WrapperFrontendAction::shouldEraseOutputFiles()
Ben Langmuir [Tue, 31 Mar 2020 22:23:01 +0000 (15:23 -0700)]
Forward WrapperFrontendAction::shouldEraseOutputFiles()

Per the documentation, this class is supposed to forward every virtual
method, but we had missed on (shouldEraseOutputFiles). This fixes using
a wrapped frontend action over the PCH generator when using
-fallow-pch-with-compiler-errors. I do not think any upstream wrapper
actions can test this.

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

rdar://61110294

4 years ago[OPENMP][DOCS]Mark array shaping as done, NFC.
Alexey Bataev [Tue, 31 Mar 2020 23:12:52 +0000 (19:12 -0400)]
[OPENMP][DOCS]Mark array shaping as done, NFC.

4 years ago[OPENMP50]Codegen for array shaping expression in map clauses.
Alexey Bataev [Mon, 30 Mar 2020 20:06:01 +0000 (16:06 -0400)]
[OPENMP50]Codegen for array shaping expression in map clauses.

Added codegen support for array shaping operations in map/to/from
clauses.

4 years ago[lit] Refine adoption of argparse --version action
Julian Lettner [Wed, 30 Oct 2019 06:06:00 +0000 (23:06 -0700)]
[lit] Refine adoption of argparse --version action

The real work for this was already done by serge-sans-paille [1].
Thanks for this!

[1] 1d4849379f71a0f5d73202a291c0b709f7cafbc5

4 years ago[debugserver/ARM64] Make sure watchpoints hit are attributed correctly.
Davide Italiano [Tue, 31 Mar 2020 20:55:36 +0000 (13:55 -0700)]
[debugserver/ARM64] Make sure watchpoints hit are attributed correctly.

This didn't happen for arm64 if you have watches for variables
that are contigous in memory.

<rdar://problem/55135006>

4 years ago[OPENMP50]Fix size calculation for array shaping expression in the
Alexey Bataev [Tue, 31 Mar 2020 22:26:58 +0000 (18:26 -0400)]
[OPENMP50]Fix size calculation for array shaping expression in the
codegen.

Need to include the size of the pointee type when trying to calculate
the total size of the array shaping expression.

4 years ago[libomptarget][nfc] Move non-freestanding headers out of common
JonChesterfield [Tue, 31 Mar 2020 22:43:03 +0000 (23:43 +0100)]
[libomptarget][nfc] Move non-freestanding headers out of common

Summary:
[libomptarget][nfc] Move non-freestanding headers out of common

Lowers the bar for building deviceRTL.
Drops math.h entirely as it wasn't used and libm is a big dependency.

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: jvesely, openmp-commits

Tags: #openmp

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

4 years ago[mlir][spirv] Include SPIR-V op definitions in main SPIR-V doc
Lei Zhang [Tue, 31 Mar 2020 21:08:12 +0000 (17:08 -0400)]
[mlir][spirv] Include SPIR-V op definitions in main SPIR-V doc

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

4 years agoFix MSan false positive due to select folding.
Evgenii Stepanov [Tue, 17 Mar 2020 22:33:26 +0000 (15:33 -0700)]
Fix MSan false positive due to select folding.

Summary:
Select folding in JumpThreading can create a conditional branch on a
code patch that did not have one in the original program. This is not a
valid transformation in sanitize_memory functions.

Note that JumpThreading does select folding in 3 different places. Two
of them seem safe - they apply to a select instruction in a BB that ends
with an unconditional branch to another BB, which (in turn) ends with a
conditional branch or a switch with the same condition.

Fixes PR45220.

Reviewers: glider, dvyukov, efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[ELF][test] Add 'REQUIRES: x86' to threads.s
Fangrui Song [Tue, 31 Mar 2020 22:25:01 +0000 (15:25 -0700)]
[ELF][test] Add 'REQUIRES: x86' to threads.s

4 years agoAMDGPU: Make HIPToolChain a subclass of AMDGPUToolChain
Matt Arsenault [Thu, 26 Mar 2020 18:31:00 +0000 (14:31 -0400)]
AMDGPU: Make HIPToolChain a subclass of AMDGPUToolChain

This fixes some code duplication. This is also a step towards
consolidating builtin library handling.

4 years ago[PPCInstPrinter] Print conditional branches as `bt 2, $target` instead of `bt 2,...
Fangrui Song [Fri, 27 Mar 2020 06:40:23 +0000 (23:40 -0700)]
[PPCInstPrinter] Print conditional branches as `bt 2, $target` instead of `bt 2, .+$imm`

Follow-up of D76591.

Reviewed By: #powerpc, sfertile

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

4 years agoHIP: Ensure new denormal mode attributes are set
Matt Arsenault [Thu, 26 Mar 2020 15:17:53 +0000 (11:17 -0400)]
HIP: Ensure new denormal mode attributes are set

Apparently HIPToolChain does not subclass from AMDGPUToolChain, so
this was not applying the new denormal attributes. I'm not sure why
this doesn't subclass. Just copy the implementation for now.

4 years agoReplace uint32_t with typedef (NFC)
Adrian Prantl [Tue, 31 Mar 2020 21:58:25 +0000 (14:58 -0700)]
Replace uint32_t with typedef (NFC)

4 years agoAdd a Type::Payload typedef. (NFC)
Adrian Prantl [Tue, 31 Mar 2020 21:12:11 +0000 (14:12 -0700)]
Add a Type::Payload typedef. (NFC)

This addresses review feedback from Raphael that I missed before
landing the change that introduced the payload field.

4 years ago[FileCheck] Add missing %ProtectFileCheckOutput to FileCheck tests
Joel E. Denny [Tue, 31 Mar 2020 20:41:59 +0000 (16:41 -0400)]
[FileCheck] Add missing %ProtectFileCheckOutput to FileCheck tests

I'm committing this fixup without review because it's an obvious
continuation of D65121 (committed at f471eb8e99b5).

4 years ago[Object] Update ObjectFile::makeTriple for XCOFF
Hubert Tong [Tue, 31 Mar 2020 21:24:22 +0000 (17:24 -0400)]
[Object] Update ObjectFile::makeTriple for XCOFF

Summary:
When we encounter an XCOFF file, reflect that in the triple information.
In addition to knowing the object file format, we know that the
associated OS is AIX.

This means that we can expect that there is no output difference in the
processing of an XCOFF32 input file between cases where the triple is
left unspecified by the user and cases where the user specifies
`--triple powerpc-ibm-aix` explicitly.

Reviewers: jhenderson, sfertile, jasonliu, daltenty

Reviewed By: jasonliu

Subscribers: wuzish, nemanjai, hiraditya, MaskRay, rupprecht, steven.zhang, llvm-commits

Tags: #llvm

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

4 years ago[AArch64] Change AArch64 Windows EH UnwindHelp object to be a fixed object
Daniel Frampton [Tue, 31 Mar 2020 20:12:54 +0000 (13:12 -0700)]
[AArch64] Change AArch64 Windows EH UnwindHelp object to be a fixed object

The UnwindHelp object is used during exception handling by runtime
code. It must be findable from a fixed offset from FP.

This change allocates the UnwindHelp object as a fixed object (as is
done for x86_64) to ensure that both the generated code and runtime
agree on the location of the object.

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

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

4 years ago[AArch64] Fix mismatch in prologue and epilogue for funclets on Windows
Daniel Frampton [Tue, 31 Mar 2020 20:11:16 +0000 (13:11 -0700)]
[AArch64] Fix mismatch in prologue and epilogue for funclets on Windows

The generated code for a funclet can have an add to sp in the epilogue
for which there is no corresponding sub in the prologue.

This patch removes the early return from emitPrologue that was
preventing the sub to sp, and instead conditionalizes the appropriate
parts of the rest of the function.

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

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

4 years ago[OPENMP50]Allow use of array shaping expression in a list.
Alexey Bataev [Tue, 31 Mar 2020 20:53:00 +0000 (16:53 -0400)]
[OPENMP50]Allow use of array shaping expression in a list.

Need to allow arrayshaping expression in a list of expressions, so use
ParseAssignmentExpression() when try to parse the base of the shaping
operation.

4 years ago[libc++] Use 'export' instead of 'env' to run remote commands
Louis Dionne [Tue, 31 Mar 2020 21:10:29 +0000 (17:10 -0400)]
[libc++] Use 'export' instead of 'env' to run remote commands

This allows running commands that use shell builtins remotely too, when
'env' would complain that it can't find the program.

4 years ago[clangd] Don't build clangdserver for (most) completion tests. NFC
Sam McCall [Tue, 31 Mar 2020 21:09:28 +0000 (23:09 +0200)]
[clangd] Don't build clangdserver for (most) completion tests. NFC

4 years agoFixed windows failure after D74873
Stanislav Mekhanoshin [Tue, 31 Mar 2020 20:40:09 +0000 (13:40 -0700)]
Fixed windows failure after D74873

Print format LaneBitmask was set as "%016lX" but should be
"%016llX" for 64 bit support on Windows.

4 years ago[MLIR][NFC] modernize affine.for unroll test pass
Uday Bondhugula [Tue, 31 Mar 2020 19:47:02 +0000 (01:17 +0530)]
[MLIR][NFC] modernize affine.for unroll test pass

The walk code here was written before any of the support was
available in IR/. Replace/cleanup.

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

4 years ago[pch] Honour -fallow-pch-with-compiler-errors for overall compilation status
Ben Langmuir [Tue, 31 Mar 2020 16:26:59 +0000 (09:26 -0700)]
[pch] Honour -fallow-pch-with-compiler-errors for overall compilation status

Previously we would emit a PCH with errors, but fail the overall
compilation. If run using the driver, that would result in removing the
just-produced PCH. Instead, we should have the compilation result match
whether we were able to emit the PCH.

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

rdar://61110294

4 years agoSwitch this function to the LLVM variable naming convention, to match the rest of...
Richard Smith [Tue, 31 Mar 2020 03:14:02 +0000 (20:14 -0700)]
Switch this function to the LLVM variable naming convention, to match the rest of the file.

4 years ago[cmake] Link libc++ tests against static libc++/libc++abi in CrossWinToARMLinux.cmake
Sergej Jaskiewicz [Tue, 31 Mar 2020 20:36:18 +0000 (23:36 +0300)]
[cmake] Link libc++ tests against static libc++/libc++abi in CrossWinToARMLinux.cmake

Summary: Now that D72687 has landed, we can enable this setting in our cache file.

Reviewers: vvereschaka

Reviewed By: vvereschaka

Subscribers: mgorny, kristof.beyls, cfe-commits

Tags: #clang

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

4 years agoRevert "[InlineFunction] Handle return attributes on call within inlined body"
Anna Thomas [Tue, 31 Mar 2020 20:15:32 +0000 (16:15 -0400)]
Revert "[InlineFunction] Handle return attributes on call within inlined body"

This reverts commit 28518d9ae39ff5c6044e230d58b6ae28b0252cae.
There is a failure in MsgPackReader.cpp when built with clang. It
complains about "signext and zeroext" are incompatible. Investigating
offline if it is infact a UB in the MsgPackReader code.

4 years ago[InstCombine] Use replaceOperand() in some select transforms
Nikita Popov [Mon, 30 Mar 2020 19:48:33 +0000 (21:48 +0200)]
[InstCombine] Use replaceOperand() in some select transforms

To make sure the old operand is DCEd.

NFC apart from worklist order.

4 years agoRemove "mask" operand from shufflevector.
Eli Friedman [Tue, 31 Mar 2020 20:08:59 +0000 (13:08 -0700)]
Remove "mask" operand from shufflevector.

Instead, represent the mask as out-of-line data in the instruction. This
should be more efficient in the places that currently use
getShuffleVector(), and paves the way for further changes to add new
shuffles for scalable vectors.

This doesn't change the syntax in textual IR. And I don't currently plan
to change the bitcode encoding in this patch, although we'll probably
need to do something once we extend shufflevector for scalable types.

I expect that once this is finished, we can then replace the raw "mask"
with something more appropriate for scalable vectors.  Not sure exactly
what this looks like at the moment, but there are a few different ways
we could handle it.  Maybe we could try to describe specific shuffles.
Or maybe we could define it in terms of a function to convert a fixed-length
array into an appropriate scalable vector, using a "step", or something
like that.

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

4 years ago[InstCombine] Use replaceOperand() in descaling
Nikita Popov [Mon, 30 Mar 2020 19:31:00 +0000 (21:31 +0200)]
[InstCombine] Use replaceOperand() in descaling

To make sure the old operand gets DCEd.

NFC apart from worklist order.

4 years ago[InstCombine] Erase old alloca in cast of alloca transform
Nikita Popov [Mon, 30 Mar 2020 18:58:58 +0000 (20:58 +0200)]
[InstCombine] Erase old alloca in cast of alloca transform

As we don't return the replaceInstUsesWith() result, we are
responsible for erasing the instruction.

NFC apart from worklist order.

4 years ago[InstCombine] Use replaceOperand() in non zero phi transform
Nikita Popov [Sun, 29 Mar 2020 20:12:00 +0000 (22:12 +0200)]
[InstCombine] Use replaceOperand() in non zero phi transform

To make sure the old operand gets DCEd.

NFC apart from worklist order changes.

4 years ago[InstCombine] Report change in non zero phi transform
Nikita Popov [Sun, 29 Mar 2020 20:10:31 +0000 (22:10 +0200)]
[InstCombine] Report change in non zero phi transform

We need to inform InstCombine (and transitively the pass manager)
that we changed an instruction.

4 years ago[libc++] Allow running .sh.cpp tests with SSHExecutors
Louis Dionne [Tue, 31 Mar 2020 16:09:20 +0000 (12:09 -0400)]
[libc++] Allow running .sh.cpp tests with SSHExecutors

This commit adds a script that can be used as an %{exec} substitution
such that .sh.cpp tests can now run on remote hosts when using the
SSHExecutor.