platform/upstream/llvm.git
3 years ago[Test] Run test with expensive SE inference. NFC
Max Kazantsev [Fri, 6 Nov 2020 07:23:44 +0000 (14:23 +0700)]
[Test] Run test with expensive SE inference. NFC

The planned changes require expensive inference to kick in

3 years ago[BranchProbabilityInfo] Remove block handles in eraseBlock()
Yevgeny Rouban [Fri, 6 Nov 2020 06:11:08 +0000 (13:11 +0700)]
[BranchProbabilityInfo] Remove block handles in eraseBlock()

BranchProbabilityInfo::eraseBlock() is a public method and
can be called without deleting the block itself.
This method is made remove the correspondent tracking handle
from BranchProbabilityInfo::Handles along with
the probabilities of the block. Handles.erase() call is moved
to eraseBlock().
In setEdgeProbability() we need to add the block handle only once.

Reviewed By: kazu

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

3 years ago[mlir][CAPI] Add missing 'static' to inline C function.
Stella Laurenzo [Fri, 6 Nov 2020 05:47:55 +0000 (21:47 -0800)]
[mlir][CAPI] Add missing 'static' to inline C function.

* Asked to submit separately from https://reviews.llvm.org/D90824

3 years ago[BranchProbabilityInfo] Get rid of MaxSuccIdx. NFC
Yevgeny Rouban [Fri, 6 Nov 2020 05:16:19 +0000 (12:16 +0700)]
[BranchProbabilityInfo] Get rid of MaxSuccIdx. NFC

This refactoring allows to eliminate the MaxSuccIdx map
proposed in the commit a7b662d0.
The idea is to remove probabilities for a block BB for
all its successors one by one from first, second, ...
till N-th until they are defined in Probs. This works
because probabilities for the block are set at once for
all its successors from number 0 to N-1 and the rest
are removed if there were stale probs.
The protected method setEdgeProbability(), which set
probabilities for individual successor, is removed.
This makes it clear that the probabilities are set in
bulk by the public method with the same name.

Reviewed By: kazu, MaskRay

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

3 years agoCheck for nullptr before dereferencing in translateModuleToLLVMIR()
Mehdi Amini [Fri, 6 Nov 2020 04:07:35 +0000 (04:07 +0000)]
Check for nullptr before dereferencing in translateModuleToLLVMIR()

This is defensive with respect to invocations of this API with an IR
that isn't ready to be converted to LLVM IR.

3 years ago[test] Properly test -Werror-implicit-function-declaration and -Wvec-elem-size
Fangrui Song [Fri, 6 Nov 2020 04:08:23 +0000 (20:08 -0800)]
[test] Properly test -Werror-implicit-function-declaration and -Wvec-elem-size

Reviewed By: dblaikie

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

3 years ago[flang][openacc] Add parsing tests and semantic check for set directive
Valentin Clement [Fri, 6 Nov 2020 03:19:21 +0000 (22:19 -0500)]
[flang][openacc] Add parsing tests and semantic check for set directive

This patch add some parsing and clause validity tests for the set directive.
It makes use of the possibility introduces in patch D90770 to check the restriction
were one of the default_async, device_num and device_type clauses is required but also
not more than once on the set directive.

Reviewed By: sameeranjoshi

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

3 years ago[trace][intel-pt] Implement the basic decoding functionality
Walter Erquinigo [Wed, 14 Oct 2020 17:26:10 +0000 (10:26 -0700)]
[trace][intel-pt] Implement the basic decoding functionality

Depends on D89408.

This diff finally implements trace decoding!

The current interface is

  $ trace load /path/to/trace/session/file.json
  $ thread trace dump instructions

  thread #1: tid = 3842849, total instructions = 22
    [ 0] 0x40052d
    [ 1] 0x40052d
    ...
    [19] 0x400521

  $ # simply enter, which is a repeat command
    [20] 0x40052d
    [21] 0x400529
    ...

This doesn't do any disassembly, which will be done in the next diff.

Changes:
- Added an IntelPTDecoder class, that is a wrapper for libipt, which is the actual library that performs the decoding.
- Added TraceThreadDecoder class that decodes traces and memoizes the result to avoid repeating the decoding step.
- Added a DecodedThread class, which represents the output from decoding and that for the time being only stores the list of reconstructed instructions. Later it'll contain the function call hierarchy, which will enable reconstructing backtraces.
- Added basic APIs for accessing the trace in Trace.h:
  - GetInstructionCount, which counts the number of instructions traced for a given thread
  - IsTraceFailed, which returns an Error if decoding a thread failed
  - ForEachInstruction, which iterates on the instructions traced for a given thread, concealing the internal storage of threads, as plug-ins can decide to generate the instructions on the fly or to store them all in a vector, like I do.
- DumpTraceInstructions was updated to print the instructions or show an error message if decoding was impossible.
- Tests included

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

3 years ago[VE][NFC] Update rem.ll regression test
Kazushi (Jam) Marukawa [Fri, 6 Nov 2020 01:20:26 +0000 (10:20 +0900)]
[VE][NFC] Update rem.ll regression test

`Replace ISD::SREM handling with KnownBits::srem to reduce code
duplication` (bf04e34383b06f1b71819de7f34a1a1de2cdb6a4) changed
the result of rem.ll regression test.  So, updating it.

3 years ago[X86] check the k pair register in ipra-reg-usage.ll.
Luo, Yuanke [Fri, 6 Nov 2020 01:29:18 +0000 (09:29 +0800)]
[X86] check the k pair register in ipra-reg-usage.ll.

Reviewed By: pengfei

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

3 years agoRevert "Allow searching for prebuilt implicit modules."
Stella Stamenova [Fri, 6 Nov 2020 01:16:14 +0000 (17:16 -0800)]
Revert "Allow searching for prebuilt implicit modules."

This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.

This change caused a build failure on Windows:
http://lab.llvm.org:8011/#/builders/83/builds/570

3 years ago[lldb] Remove Crashlog/interactive.test
Jonas Devlieghere [Fri, 6 Nov 2020 01:09:54 +0000 (17:09 -0800)]
[lldb] Remove Crashlog/interactive.test

This test requires running under the Python we built against (which is
easy) and setting up the PYTHONPATH (which is not worth it for this
simple test).

3 years ago[CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers
Giorgis Georgakoudis [Tue, 3 Nov 2020 08:32:37 +0000 (00:32 -0800)]
[CodeExtractor] Replace uses of extracted bitcasts in out-of-region lifetime markers

CodeExtractor handles bitcasts in the extracted region that have
lifetime markers users in the outer region as outputs. That
creates unnecessary alloca/reload instructions and extra lifetime
markers. The patch identifies those cases, and replaces uses in
out-of-region lifetime markers with new bitcasts in the outer region.

**Example**
```
define void @foo() {
entry:
  %0 = alloca i32
  br label %extract

extract:
  %1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 4, i8* %1)
  call void @use(i32* %0)
  br label %exit

exit:
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %1)
  ret void
}
```

**Current extraction**
```
define void @foo() {
entry:
  %.loc = alloca i8*, align 8
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast = bitcast i8** %.loc to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast)
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0, i8** %.loc)
  %.reload = load i8*, i8** %.loc, align 8
  call void @llvm.lifetime.end.p0i8(i64 -1, i8* %lt.cast)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %.reload)
  ret void
}

define internal void @foo.extract(i32* %0, i8** %.out) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  store i8* %1, i8** %.out, align 8
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

**Extraction with patch**
```
define void @foo() {
entry:
  %0 = alloca i32, align 4
  br label %codeRepl

codeRepl:                                         ; preds = %entry
  %lt.cast1 = bitcast i32* %0 to i8*
  call void @llvm.lifetime.start.p0i8(i64 -1, i8* %lt.cast1)
  call void @foo.extract(i32* %0)
  br label %exit

exit:                                             ; preds = %codeRepl
  call void @use(i32* %0)
  %lt.cast = bitcast i32* %0 to i8*
  call void @llvm.lifetime.end.p0i8(i64 4, i8* %lt.cast)
  ret void
}

define internal void @foo.extract(i32* %0) {
newFuncRoot:
  br label %extract

exit.exitStub:                                    ; preds = %extract
  ret void

extract:                                          ; preds = %newFuncRoot
  %1 = bitcast i32* %0 to i8*
  call void @use(i32* %0)
  br label %exit.exitStub
}
```

Reviewed By: vsk

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

3 years ago[TargetList] Delete the destructor
Vedant Kumar [Fri, 6 Nov 2020 00:41:31 +0000 (16:41 -0800)]
[TargetList] Delete the destructor

AFAICT, ~TargetList simply implements the default destructor, plus some
locking.

The history is murky, so I'm not sure why we do this locking. Perhaps,
at some point, it was possible to delete the same TargetList instance
from two different threads, setting up a race. If that were true, then
the locking would protect against the race.

Since TargetList is uniquely owned by Debugger (m_target_list), no such
race is possible today.

Testing: check-lldb

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

3 years ago[AMDGPU] Simplify amdgpu-macros.cl test. NFC.
Stanislav Mekhanoshin [Thu, 5 Nov 2020 22:17:46 +0000 (14:17 -0800)]
[AMDGPU] Simplify amdgpu-macros.cl test. NFC.

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

3 years ago[libc] Add implementations of ilogb[f|l].
Siva Chandra Reddy [Wed, 4 Nov 2020 00:30:16 +0000 (16:30 -0800)]
[libc] Add implementations of ilogb[f|l].

Depends on D90805.

Reviewed By: lntue

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

3 years ago[STLExtras] Add append_range helper.
Sean Silva [Fri, 6 Nov 2020 00:00:38 +0000 (16:00 -0800)]
[STLExtras] Add append_range helper.

This is convenient in a lot of cases, such as when the thing you want
to append is `someReallyLongFunctionName()` that you'd rather not
write twice or assign to a variable for the paired begin/end calls.

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

3 years ago[RISCV] Only enable GPR<->FPR32 bitconvert isel patterns on RV32. NFCI
Craig Topper [Thu, 5 Nov 2020 23:44:49 +0000 (15:44 -0800)]
[RISCV] Only enable GPR<->FPR32 bitconvert isel patterns on RV32. NFCI

Bitconvert requires the bitwidth to match on both sides. On RV64
the GPR size is i64 so bitconvert between f32 isn't possible. The
node should never be generated so the pattern won't ever match, but
moving the patterns under IsRV32 makes it more obviously impossible.
It also moves it to a similar location to the patterns for the
custom nodes we use for RV64.

3 years ago[libc][NFC] Make test macros callable from helper methods of test classes.
Siva Chandra Reddy [Wed, 4 Nov 2020 21:09:26 +0000 (13:09 -0800)]
[libc][NFC] Make test macros callable from helper methods of test classes.

This is acheived by making the RunContext a state variable of the test
classes.

Reviewed By: lntue

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

3 years ago[AMDGPU] Corrected declaration of VOPC instructions with SDWA addressing mode.
Konstantin Pyzhov [Thu, 5 Nov 2020 16:15:50 +0000 (11:15 -0500)]
[AMDGPU] Corrected declaration of VOPC instructions with SDWA addressing mode.

Removed "implicit def VCC" from declarations of AMDGPU VOPC instructions since they do not implicitly write to VCC in SDWA mode.

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

3 years ago[libc++] Also allow customizing the build directory when running CI
Louis Dionne [Fri, 6 Nov 2020 00:09:03 +0000 (19:09 -0500)]
[libc++] Also allow customizing the build directory when running CI

3 years ago[amdgpu] Add `llvm.amdgcn.endpgm` support.
Michael Liao [Wed, 4 Nov 2020 21:07:57 +0000 (16:07 -0500)]
[amdgpu] Add `llvm.amdgcn.endpgm` support.

- `llvm.amdgcn.endpgm` is added to enable "abort" support.

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

3 years ago[TargetList] Simplify dummy target creation
Vedant Kumar [Thu, 5 Nov 2020 19:38:50 +0000 (11:38 -0800)]
[TargetList] Simplify dummy target creation

Factor out dummy target creation from CreateTargetInternal.

This makes it impossible for dummy target creation to accidentally fail
due to too-strict checking in one of the CreateTargetInternal overloads.

Testing: check-lldb

rdar://70630655

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

3 years ago[libc++] Allow customizing a few paths when running build bots
Louis Dionne [Fri, 6 Nov 2020 00:02:32 +0000 (19:02 -0500)]
[libc++] Allow customizing a few paths when running build bots

This allows reusing run-buildbot for downstream testing as well.

3 years ago[libc++] Add a Buildkite job that tests back-deployment on Apple
Louis Dionne [Thu, 5 Nov 2020 15:47:06 +0000 (10:47 -0500)]
[libc++] Add a Buildkite job that tests back-deployment on Apple

The current way we test this is pretty cheap, i.e. we download previously
released macOS dylibs and run against that. Ideally, we would require a
full host running the appropriate version of macOS, and we'd execute the
tests using SSH on that host. But since we don't have such hosts available
easily for now, this is better than nothing.

At the same time, also fix some tests that were failing when back
deploying.

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

3 years agoDo not construct std::string from nullptr
Yuriy Chernyshov [Thu, 5 Nov 2020 20:10:38 +0000 (12:10 -0800)]
Do not construct std::string from nullptr

While I am trying to forbid such usages systematically in https://reviews.llvm.org/D79427 / P2166R0 to C++ standard, this PR fixes this (definitelly incorrect) usage in llvm.

This code is unreachable, so it could not cause any harm

Reviewed By: nikic, dblaikie

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

3 years ago[RISCV] Add isel patterns for fnmadd/fnmsub with an fneg on the second operand instea...
Craig Topper [Thu, 5 Nov 2020 21:56:52 +0000 (13:56 -0800)]
[RISCV] Add isel patterns for fnmadd/fnmsub with an fneg on the second operand instead of the first.

The multiply part of FMA is commutable, but TargetSelectionDAG.td
doesn't have it marked as commutable so tablegen won't automatically
create the additional patterns.

So manually add commuted patterns.

3 years ago[RISCV] Add test cases to show missed opportunities to use fnmadd/fnmsub if the secon...
Craig Topper [Thu, 5 Nov 2020 21:32:33 +0000 (13:32 -0800)]
[RISCV] Add test cases to show missed opportunities to use fnmadd/fnmsub if the second operand to the fma is negated rather than the first. NFC

We need to add more isel patterns to handle this.

3 years ago[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'
Pedro Tammela [Thu, 5 Nov 2020 20:53:16 +0000 (20:53 +0000)]
[LLDB-lua] modify Lua's 'print' to respect 'io.stdout'

This patch changes the implementation of Lua's `print()` function to
respect `io.stdout`.

The original implementation uses `lua_writestring()` internally, which is
hardcoded to `stdout`.

Reviewed By: JDevlieghere

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

3 years agoAPINotes: repair the Windows builders
Saleem Abdulrasool [Thu, 5 Nov 2020 21:17:15 +0000 (21:17 +0000)]
APINotes: repair the Windows builders

Disable the test on Windows, which should've been obvious as being
needed.  The differences in diff implementations and line-endings make
this test difficult to execute on Windows.

3 years ago[openacc][openmp] Allow duplicate between required and allowed once/exclusive
Valentin Clement [Thu, 5 Nov 2020 21:21:15 +0000 (16:21 -0500)]
[openacc][openmp] Allow duplicate between required and allowed once/exclusive

Validity check introduce in D90241 are a bit too restrict and this patch propose to losen
them a bit. The duplicate clauses is now check only between the three allowed lists and between the
requiredClauses and allowedClauses lists. This allows to enable some check where a clause can be
required but also appear only once on the directive. We found these kind of restriction useful
on the set directive in OpenACC for example.

Reviewed By: kiranchandramohan

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

3 years ago[TableGen] Clean up documentation toctrees; clarify two paragraphs.
Paul C. Anagnostopoulos [Wed, 4 Nov 2020 23:48:53 +0000 (18:48 -0500)]
[TableGen] Clean up documentation toctrees; clarify two paragraphs.

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

3 years agoFix MLIR Python bindings build (NFC)
Mehdi Amini [Thu, 5 Nov 2020 21:16:27 +0000 (21:16 +0000)]
Fix MLIR Python bindings build (NFC)

The CMake macro refactoring had a hardcoded value left instead of using
the function argument.
Didn't catch it locally before because it required a clean build to
trigger.

3 years agoAllow searching for prebuilt implicit modules.
Alexandre Rames [Thu, 5 Nov 2020 20:07:28 +0000 (12:07 -0800)]
Allow searching for prebuilt implicit modules.

The behavior is controlled by the `-fprebuilt-implicit-modules` option, and
allows searching for implicit modules in the prebuilt module cache paths.

The current command-line options for prebuilt modules do not allow to easily
maintain and use multiple versions of modules. Both the producer and users of
prebuilt modules are required to know the relationships between compilation
options and module file paths. Using a particular version of a prebuilt module
requires passing a particular option on the command line (e.g.
`-fmodule-file=[<name>=]<file>` or `-fprebuilt-module-path=<directory>`).

However the compiler already knows how to distinguish and automatically locate
implicit modules. Hence this proposal to introduce the
`-fprebuilt-implicit-modules` option. When set, it enables searching for
implicit modules in the prebuilt module paths (specified via
`-fprebuilt-module-path`). To not modify existing behavior, this search takes
place after the standard search for prebuilt modules. If not

Here is a workflow illustrating how both the producer and consumer of prebuilt
modules would need to know what versions of prebuilt modules are available and
where they are located.

  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v1 <config 1 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v2 <config 2 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules_v3 <config 3 options>

  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules_v1 <config 1 options>
  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap <non-prebuilt config options>

With prebuilt implicit modules, the producer can generate prebuilt modules as
usual, all in the same output directory. The same mechanisms as for implicit
modules take care of incorporating hashes in the path to distinguish between
module versions.

Note that we do not specify the output module filename, so `-o` implicit modules are generated in the cache path `prebuilt_modules`.

  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 1 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 2 options>
  clang -cc1 -x c modulemap -fmodules -emit-module -fmodule-name=foo -fmodules-cache-path=prebuilt_modules <config 3 options>

The user can now simply enable prebuilt implicit modules and point to the
prebuilt modules cache. No need to "parse" command-line options to decide
what prebuilt modules (paths) to use.

  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <config 1 options>
  clang -cc1 -x c use.c -fmodules fmodule-map-file=modulemap -fprebuilt-module-path=prebuilt_modules -fprebuilt-implicit-modules <non-prebuilt config options>

This is for example particularly useful in a use-case where compilation is
expensive, and the configurations expected to be used are predictable, but not
controlled by the producer of prebuilt modules. Modules for the set of
predictable configurations can be prebuilt, and using them does not require
"parsing" the configuration (command-line options).

Reviewed By: Bigcheese

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

3 years ago[VE] Add isReMaterializable and isAsCheapAsAMove flags
Kazushi (Jam) Marukawa [Tue, 3 Nov 2020 13:42:10 +0000 (22:42 +0900)]
[VE] Add isReMaterializable and isAsCheapAsAMove flags

Add isReMaterializable and isCheapAsAMove flags to integer instructions
which cost cheap.

Reviewed By: simoll

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

3 years agoFix bugs in EOL marking in command line tokenizers
Reid Kleckner [Thu, 5 Nov 2020 17:58:02 +0000 (09:58 -0800)]
Fix bugs in EOL marking in command line tokenizers

Add unit tests for this behavior, since the integration test for
clang-cl did not catch these bugs.

Fixes PR47604

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

3 years ago[CodeGen] Fix Bug 47499: __unaligned extension inconsistent behaviour with C and C++
Jan Ole Hüser [Thu, 5 Nov 2020 19:01:51 +0000 (11:01 -0800)]
[CodeGen] Fix Bug 47499: __unaligned extension inconsistent behaviour with C and C++

For the language C++ the keyword __unaligned (a Microsoft extension) had no effect on pointers.

The reason, why there was a difference between C and C++ for the keyword __unaligned:
For C, the Method getAsCXXREcordDecl() returns nullptr. That guarantees that hasUnaligned() is called.
If the language is C++, it is not guaranteed, that hasUnaligend() is called and evaluated.

Here are some links:

The Bug: https://bugs.llvm.org/show_bug.cgi?id=47499
Thread on the cfe-dev mailing list: http://lists.llvm.org/pipermail/cfe-dev/2020-September/066783.html
Diff, that introduced the check hasUnaligned() in getNaturalTypeAlignment(): https://reviews.llvm.org/D30166

Reviewed By: rnk

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

3 years ago[PowerPC] Correct cpsgn's behaviour on PowerPC to match that of the ABI
Albion Fung [Thu, 5 Nov 2020 19:55:33 +0000 (14:55 -0500)]
[PowerPC] Correct cpsgn's behaviour on PowerPC to match that of the ABI

This patch fixes the reversed behaviour exhibited by cpsgn on PPC. It now matches the ABI.

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

3 years ago[libc++] Add a CI job to build the documentation
Louis Dionne [Thu, 5 Nov 2020 19:34:29 +0000 (14:34 -0500)]
[libc++] Add a CI job to build the documentation

At the same time, fix an issue that broke the documentation since 2eadbc86142b.

3 years ago[libc++] Update the CI Dockerfile
Louis Dionne [Thu, 5 Nov 2020 20:13:27 +0000 (15:13 -0500)]
[libc++] Update the CI Dockerfile

Remove Phabricator, which isn't needed anymore since we don't report
the job results ourselves. Also, install python3-sphinx instead of
sphinx-doc, since the latter doesn't provide the sphinx-build binary.

3 years agoAdd a custom MLIRBindingsPythonExtension cmake target to group all Python bindings...
Mehdi Amini [Thu, 5 Nov 2020 20:01:32 +0000 (20:01 +0000)]
Add a custom MLIRBindingsPythonExtension cmake target to group all Python bindings (NFC)

This target will depend on each individual extension and represent "all"
Python bindings in the repo. User projects can get a finer grain control by
depending directly on some individual targets as needed.

3 years agoFix MLIR Python bindings build (remove inexistant source from CMake list, NFC)
Mehdi Amini [Thu, 5 Nov 2020 20:04:52 +0000 (20:04 +0000)]
Fix MLIR Python bindings build (remove inexistant source from CMake list, NFC)

3 years agoRefactor MLIR python extension CMake boilerplate in a reusable function (NFC)
Mehdi Amini [Thu, 5 Nov 2020 04:55:55 +0000 (04:55 +0000)]
Refactor MLIR python extension CMake boilerplate in a reusable function (NFC)

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

3 years agoAlways link the MLIR python bindings native extension to libMLIR.so
Mehdi Amini [Thu, 5 Nov 2020 02:29:40 +0000 (02:29 +0000)]
Always link the MLIR python bindings native extension to libMLIR.so

The Python bindings now require -DLLVM_BUILD_LLVM_DYLIB=ON to build.
This change is needed to be able to build multiple Python native
extension without having each of them embedding a copy of MLIR, which
would make them incompatible with each other. Instead they should all
link to the same copy of MLIR.

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

3 years ago[ARM] remove cost-kind predicate for cmp/sel costs
Sanjay Patel [Thu, 5 Nov 2020 19:51:14 +0000 (14:51 -0500)]
[ARM] remove cost-kind predicate for cmp/sel costs

This is the cmp/sel sibling to D90692.
Again, the reasoning is: the throughput cost is number of instructions/uops,
so size/blended costs are identical except in special cases (for example,
fdiv or other known-expensive machine instructions or things like MVE that
may require cracking into >1 uops).

We need to check for a valid (non-null) condition type parameter because
SimplifyCFG may pass nullptr for that (and so we will crash multiple
regression tests without that check). I'm not sure if passing nullptr makes
sense, but other code in the cost model does appear to check if that param
is set or not.

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

3 years ago[clang-tidy] Extend IdentifierNamingCheck per file config
Nathan James [Thu, 5 Nov 2020 19:51:04 +0000 (19:51 +0000)]
[clang-tidy] Extend IdentifierNamingCheck per file config

Add IgnoreMainLikeFunctions to the per file config. This can be extended for new options added to the check easily.

Reviewed By: aaron.ballman

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

3 years ago[lldb] [Process/FreeBSDRemote] Remove thread name caching
Michał Górny [Thu, 5 Nov 2020 17:59:28 +0000 (18:59 +0100)]
[lldb] [Process/FreeBSDRemote] Remove thread name caching

Remove the thread name caching code.  It does not handle the possibility
of thread name changing between requests, therefore breaking
TestGdbRemoteThreadName.  While technically we could cache the results
and reset the cache on resuming process, the gain from doing that
does not seem worth the effort.

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

3 years ago[lldb] [test] Fix TestGdbRemoteThreadName code on FreeBSD
Michał Górny [Thu, 5 Nov 2020 17:56:10 +0000 (18:56 +0100)]
[lldb] [test] Fix TestGdbRemoteThreadName code on FreeBSD

Fix TestGdbRemoteThreadName to call ::pthread_setname_np instead
of ::pthread_set_name_np on FreeBSD.  While technically both names
are correct, the former is preferable because of compatibility
with Linux.  Furthermore, the latter requires `#include <pthread_np.h>`
that was missing causing the test to fail to compile.

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

3 years ago[lld][COFF] Add command line options for LTO with new pass manager
rojamd [Thu, 5 Nov 2020 19:41:35 +0000 (14:41 -0500)]
[lld][COFF] Add command line options for LTO with new pass manager

This is more or less a port of rL329598 (D45275) to the COFF linker.
Since there were already LTO-related settings under -opt:, I added
them there instead of new flags.

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

3 years ago [MachineOutliner] Do not outline debug instructions
Momchil Velikov [Thu, 5 Nov 2020 19:11:43 +0000 (19:11 +0000)]
 [MachineOutliner] Do not outline debug instructions

The debug location is removed from any outlined instruction. This
causes the MachineVerifier to crash on outlined DBG_VALUE
instructions.

Then, debug instructions are "invisible" to the outliner, that is, two
ranges of instructions from different functions are considered
identical if the only difference is debug instructions. Since a debug
instruction from one function is unlikely to provide sensible debug
information about all functions, sharing an outlined sequence, this
patch just removes debug instructions from the outlined functions.

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

3 years ago[mlir] Remove AppendToArgumentsList functionality from BufferizeTypeConverter.
Sean Silva [Wed, 4 Nov 2020 18:57:29 +0000 (10:57 -0800)]
[mlir] Remove AppendToArgumentsList functionality from BufferizeTypeConverter.

This functionality is superceded by BufferResultsToOutParams pass (see
https://reviews.llvm.org/D90071) for users the require buffers to be
out-params. That pass should be run immediately after all tensors are gone from
the program (before buffer optimizations and deallocation insertion), such as
immediately after a "finalizing" bufferize pass.

The -test-finalizing-bufferize pass now defaults to what used to be the
`allowMemrefFunctionResults=true` flag. and the
finalizing-bufferize-allowed-memref-results.mlir file is moved
to test/Transforms/finalizing-bufferize.mlir.

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

3 years ago[AArch64][GlobalISel] Add AArch64::G_DUPLANE[X] opcodes for lane duplicates.
Amara Emerson [Thu, 5 Nov 2020 05:21:39 +0000 (21:21 -0800)]
[AArch64][GlobalISel] Add AArch64::G_DUPLANE[X] opcodes for lane duplicates.

These were previously handled by pattern matching shuffles in the selector, but
adding a new opcode and making it equivalent to the AArch64duplane SDAG node
allows us to select more patterns, like lane indexed FMLAs (patch adding a test
for that will be committed later).

The pattern matching code has been simply moved to postlegalize lowering.

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

3 years ago[libc] Fix WrapperGen seeing no arguments as a void argument.
Michael Jones [Wed, 4 Nov 2020 22:58:25 +0000 (22:58 +0000)]
[libc] Fix WrapperGen seeing no arguments as a void argument.

This corrects WrapperGen generating incorrect wrappers for functions
that take no arguments. Previously it would generate a wrapper with a
single argument of type `void`.

Reviewed By: sivachandra

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

3 years ago[gn build] (manually) port 82f86ae01 more
Nico Weber [Thu, 5 Nov 2020 19:12:33 +0000 (14:12 -0500)]
[gn build] (manually) port 82f86ae01 more

3 years ago[gn build] (manually) port 82f86ae01
Nico Weber [Thu, 5 Nov 2020 19:11:26 +0000 (14:11 -0500)]
[gn build] (manually) port 82f86ae01

3 years ago[LegalizeTypes] Remove unnecessary if around switch in ScalarizeVectorOperand and...
Craig Topper [Thu, 5 Nov 2020 18:58:42 +0000 (10:58 -0800)]
[LegalizeTypes] Remove unnecessary if around switch in ScalarizeVectorOperand and SplitVectorOperand. NFC

The if was checking !Res.getNode() but that's always true since
Res was initialized to SDValue() and not touched before the if.

This appears to be a leftover from a previous implementation of
Custom legalization where Res was updated instead of returning
immediately.

3 years agoAPINotes: add APINotesYAMLCompiler
Saleem Abdulrasool [Mon, 28 Sep 2020 20:26:02 +0000 (20:26 +0000)]
APINotes: add APINotesYAMLCompiler

This adds the skeleton of the YAML Compiler for APINotes.  This change
only adds the YAML IO model for the API Notes along with a new testing
tool `apinotes-test` which can be used to verify that can round trip the
YAML content properly.  It provides the basis for the future work which
will add a binary serialization and deserialization format to the data
model.

This is based on the code contributed by Apple at
https://github.com/llvm/llvm-project-staging/tree/staging/swift/apinotes.

Differential Revision: https://reviews.llvm.org/D88859
Reviewed By: Gabor Marton

3 years agoAdd default value for MachineInstr::modifiesRegister. NFC.
Momchil Velikov [Thu, 5 Nov 2020 18:48:47 +0000 (18:48 +0000)]
Add default value for MachineInstr::modifiesRegister. NFC.

Looks accidentally omitted, it's present on `readsRegister`,
`definesRegister` and few others.

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

3 years ago[RISCV] Use the 'si' lib call for (double (fp_to_sint/uint i32 X)) when F extension...
Craig Topper [Thu, 5 Nov 2020 18:07:03 +0000 (10:07 -0800)]
[RISCV] Use the 'si' lib call for (double (fp_to_sint/uint i32 X)) when F extension is enabled.

D80526 added custom lowering to pick the si lib call on RV64, but this custom handling is only enabled when the F and D extension are both disabled. This prevents the si library call from being used for double when F is enabled but D is not.

This patch changes the behavior so we always enable the Custom hook on RV64 and decide in ReplaceNodeResults if we should emit a libcall based on whether the FP type should be softened or not.

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

3 years ago[AMDGPU] Add default 1 glc operand to rtn atomics
Stanislav Mekhanoshin [Wed, 4 Nov 2020 00:21:36 +0000 (16:21 -0800)]
[AMDGPU] Add default 1 glc operand to rtn atomics

This change adds a real glc operand to the return atomic
instead of just string " glc" in the middle of the asm
string.

Improves asm parser diagnostics.

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

3 years ago[NFC] Add InitializePlatformCommonFlags for Fuchsia
Leonard Chan [Thu, 5 Nov 2020 18:37:08 +0000 (10:37 -0800)]
[NFC] Add InitializePlatformCommonFlags for Fuchsia

https://reviews.llvm.org/D90811 is breaking our CI builders because
InitializePlatformCommonFlags is not defined. This just adds an empty definition.

This would've been caught on our upstream buildbot, but it's red at the moment
and most likely won't be sending out alert emails for recent failures.

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

3 years ago[flang][f18] Remove unimplemented options (NFC)
Andrzej Warzynski [Thu, 5 Nov 2020 18:33:27 +0000 (18:33 +0000)]
[flang][f18] Remove unimplemented options (NFC)

These options are in practice passes to the external tool (defined with
F18_FC), i.e. fall into "unrecognised" category. No need to keep them
among other options that are actually parsed.

3 years ago[Sema] Special case -Werror-implicit-function-declaration and reject other -Werror-
Fangrui Song [Thu, 5 Nov 2020 18:25:30 +0000 (10:25 -0800)]
[Sema] Special case -Werror-implicit-function-declaration and reject other -Werror-

This is the only -Werror- form warning option GCC supports (gcc/c-family/c.opt).
Fortunately no other form is used anywhere.

3 years ago[clangd] Trivial: Log missing completion signals.
Utkarsh Saxena [Thu, 5 Nov 2020 07:47:21 +0000 (08:47 +0100)]
[clangd] Trivial: Log missing completion signals.

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

3 years ago[RISCV] Remove shadow register list passed to AllocateReg when allocating FP register...
Craig Topper [Thu, 5 Nov 2020 17:48:07 +0000 (09:48 -0800)]
[RISCV] Remove shadow register list passed to AllocateReg when allocating FP registers for calling convention

The _F and _D registers are already sub/super registers. When one gets allocated all its aliases are already marked as allocated. We don't need to explicitly shadow it too.

I believe shadow is for calling conventions like 64-bit Windows on X86 where have rules like this

CCIfType<[i32], CCAssignToRegWithShadow<[ECX , EDX , R8D , R9D ],
                                         [XMM0, XMM1, XMM2, XMM3]>>

For that calling convention the argument number determines which register is used regardless of how many scalars or vectors came before it.

Removing this removes a question I had in D90738.

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

3 years ago[RISCV] Add isel patterns for fshl with immediate to select FSRI/FSRIW
Craig Topper [Thu, 5 Nov 2020 17:37:43 +0000 (09:37 -0800)]
[RISCV] Add isel patterns for fshl with immediate to select FSRI/FSRIW

There is no FSLI instruction, but we can emulate it using FSRI by swapping operands and subtracting the immediate from the bitwidth.

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

3 years ago[libc++] Rework the whole availability markup implementation
Louis Dionne [Wed, 4 Nov 2020 20:01:25 +0000 (15:01 -0500)]
[libc++] Rework the whole availability markup implementation

Currently, vendor-specific availability markup is enabled by default.
This means that even when building against trunk libc++, the headers
will by default prevent you from using some features that were not
released in the dylib on your target platform. This is a source of
frustration since people building libc++ from sources are usually not
trying to use some vendor's released dylib.

For that reason, I've been thinking for a long time that availability
annotations should be off by default, which is the primary change that
this commit enables.

In addition, it reworks the implementation to make it easier for new
vendors to add availability annotations for their platform, and it
refreshes the documentation to reflect the current state of the codebase.

Finally, a CMake configuration option is added to control whether
availability annotations should be turned on for the flavor of libc++
being created. The intent is for vendors like Apple to turn it on, and
for the upstream libc++ to leave it off (the default).

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

3 years agoRevert "[CaptureTracking] Avoid overly restrictive dominates check"
Anna Thomas [Thu, 5 Nov 2020 17:26:36 +0000 (12:26 -0500)]
Revert "[CaptureTracking] Avoid overly restrictive dominates check"

This reverts commit 15694fd6ad955c6a16b446a6324364111a49ae8b.
Need to investigate and fix a failing clang test: synchronized.m.
Might need a test update.

3 years agoscudo: Don't memset previously released cached pages in the secondary allocator.
Peter Collingbourne [Wed, 4 Nov 2020 02:00:40 +0000 (18:00 -0800)]
scudo: Don't memset previously released cached pages in the secondary allocator.

There is no need to memset released pages because they are already
zero. On db845c, before:

BM_stdlib_malloc_free_default/131072      34562 ns        34547 ns        20258 bytes_per_second=3.53345G/s

after:

BM_stdlib_malloc_free_default/131072      29618 ns        29589 ns        23485 bytes_per_second=4.12548G/s

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

3 years ago[OpenMP] Add ident_t flags for compiler OpenMP version
Peyton, Jonathan L [Mon, 2 Nov 2020 18:28:13 +0000 (12:28 -0600)]
[OpenMP] Add ident_t flags for compiler OpenMP version

This patch adds the mask and ident_t function to get the
openmp version. It also adds logic to force monotonic:dynamic
behavior when OpenMP version less than 5.0.

The OpenMP version is stored in the format:
major*10+minor e.g., OpenMP 5.0 = 50

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

3 years ago[DAG] computeKnownBits - Replace ISD::SREM handling with KnownBits::srem to reduce...
Simon Pilgrim [Thu, 5 Nov 2020 15:44:38 +0000 (15:44 +0000)]
[DAG] computeKnownBits - Replace ISD::SREM handling with KnownBits::srem to reduce code duplication

3 years ago[GlobalISel] Don't use Register type for getNumOperands(). NFCI.
Simon Pilgrim [Thu, 5 Nov 2020 15:34:55 +0000 (15:34 +0000)]
[GlobalISel] Don't use Register type for getNumOperands(). NFCI.

Copy+Paste typo - we were storing getNumOperands() opcounts in a Register type instead of just an unsigned.

3 years ago[mlir] Fix missing namespaces in OpBuildGen.cpp
Alexander Belyaev [Thu, 5 Nov 2020 16:55:00 +0000 (17:55 +0100)]
[mlir]  Fix missing namespaces in OpBuildGen.cpp

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

3 years ago[IndVarSimplify][SimplifyIndVar] Move WidenIV to Utils/SimplifyIndVar. NFCI.
Sjoerd Meijer [Thu, 5 Nov 2020 15:56:19 +0000 (15:56 +0000)]
[IndVarSimplify][SimplifyIndVar] Move WidenIV to Utils/SimplifyIndVar. NFCI.

This moves WidenIV from IndVarSimplify to Utils/SimplifyIndVar so that we have
createWideIV available as a generic helper utility. I.e., this is not only
useful in IndVarSimplify, but could be useful for loop transformations. For
example, motivation for this refactoring is the loop flatten transformation: if
induction variables in a loop nest can be widened, we can avoid having to
perform certain overflow checks, enabling this transformation.

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

3 years ago[lldb] Enable FreeBSDRemote plugin by default and update test status
Michał Górny [Wed, 4 Nov 2020 09:16:30 +0000 (10:16 +0100)]
[lldb] Enable FreeBSDRemote plugin by default and update test status

The new FreeBSDRemote plugin has reached feature parity on i386
and amd64 targets.  Use it by default on these architectures, while
allowing the use of the legacy plugin via FREEBSD_LEGACY_PLUGIN envvar.

Revisit the method of switching plugins.  Apparently, the return value
of PlatformFreeBSD::CanDebugProcess() is what really decides whether
the legacy or the new plugin is used.

Update the test status.  Reenable the tests that were previously
disabled on FreeBSD and do not cause hangs or are irrelevant to FreeBSD.
Mark all tests that fail reliably as expectedFailure.  For now, tests
that are flaky (i.e. produce unstable results) are left enabled
and cause unpredictable test failures.

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

3 years ago[lldb] [test/Shell] Simplify -pthread condition
Michał Górny [Wed, 4 Nov 2020 23:10:06 +0000 (00:10 +0100)]
[lldb] [test/Shell] Simplify -pthread condition

Pass -pthread on all systems except for Darwin and Windows.
Suggested by Pavel Labath.

3 years ago[CaptureTracking] Avoid overly restrictive dominates check
Anna Thomas [Tue, 3 Nov 2020 16:06:41 +0000 (11:06 -0500)]
[CaptureTracking] Avoid overly restrictive dominates check

CapturesBefore tracker has an overly restrictive dominates check when
the `BeforeHere` and the capture point are in different basic blocks.
All we need to check is that there is no path from the capture point
to `BeforeHere` (which is less stricter than the dominates check).
See added testcase in one of the users of CapturesBefore.

Reviewed-By: jdoerfert
Differential Revision: https://reviews.llvm.org/D90688

3 years ago[lldb][NFC] Fix compiler warnings after removal of eValueTypeVector
Raphael Isemann [Thu, 5 Nov 2020 16:11:38 +0000 (17:11 +0100)]
[lldb][NFC] Fix compiler warnings after removal of eValueTypeVector

5d64574301836c4c17127794121d49a62d24f803 removes this enum value and now
all the switch statements that previously relied on handling this in the
'default' branch are causes compiler warnings due to redundant default cases.

This just removes the now unreachable code in there.

3 years ago[lldb] Set the default architecture also in buildDefault
Raphael Isemann [Thu, 5 Nov 2020 15:13:20 +0000 (16:13 +0100)]
[lldb] Set the default architecture also in buildDefault

In D89056 the default value for architecture was moved to `build` so that
all called functions see the same architecture value. It seems there are a
few functions that call buildDefault directly (and not via build), so
on some test configurations that set a custom arch value the architecture
value is no longer available.

This just adds the architecture code from build to buildDefault to get
the bots green again while I'm looking for a better solution.

3 years agoImplement Lambda Conversion Operators for All CCs for MSVC.
Erich Keane [Mon, 2 Nov 2020 15:43:45 +0000 (07:43 -0800)]
Implement Lambda Conversion Operators for All CCs for MSVC.

As described here:
https://devblogs.microsoft.com/oldnewthing/20150220-00/?p=44623

In order to allow Lambdas to be used with traditional Win32 APIs, they
emit a conversion function for (what Raymond Chen claims is all) a
number of the calling conventions.  Through experimentation, we
discovered that the list isn't quite 'all'.

This patch implements this by taking the list of conversions that MSVC
emits (across 'all' architectures, I don't see any CCs on ARM), then
emits them if they are supported by the current target.

However, we also add 3 other options (which may be duplicates):
free-function, member-function, and operator() calling conventions.  We
do this because we have an extension where we generate both free and
member for these cases so th at people specifying a calling convention
on the lambda will have the expected behavior when specifying one of
those two.

MSVC doesn't seem to permit specifying calling-convention on lambdas,
but we do, so we need to make sure those are emitted as well. We do this
so that clang-only conventions are supported if the user specifies them.

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

3 years ago[gn build] Port 659f4bd87ef
LLVM GN Syncbot [Thu, 5 Nov 2020 15:11:13 +0000 (15:11 +0000)]
[gn build] Port 659f4bd87ef

3 years ago[clang] Add an option for hiding line numbers in diagnostics
Raphael Isemann [Thu, 5 Nov 2020 14:41:09 +0000 (15:41 +0100)]
[clang] Add an option for hiding line numbers in diagnostics

Clang offers a `-f[no]-show-column` flag for hiding the column numbers when
printing diagnostics but there is no option for doing the same with line
numbers.

In LLDB having this option would be useful, as LLDB sometimes only knows the
file name for a SourceLocation and just assigns it the dummy line/column `1:1`.
These fake line/column numbers are confusing to the user and LLDB should be able
to tell clang to hide *both* the column and the line number when rendering text
diagnostics.

This patch adds a flag for also hiding the line numbers. It's not exposed via
the command line flags as it's most likely not very useful for any user and can
lead to ambiguous output when the user decides to only hide either the line or
the column number (where `file:1: ...` could now refer to both line 1 or column
1 depending on the compiler flags). LLDB can just access the DiagnosticOptions
directly when constructing its internal Clang instance.

The effect doesn't apply to Vi/MSVC style diagnostics because it's not defined
how these diagnostic styles would show an omitted line number (MSVC doesn't have
such an option and Vi's line mode is theory only supporting line numbers if I
understand it correctly).

Reviewed By: thakis, MaskRay

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

3 years ago[FileCheck] Use %ProtectFileCheckOutput in allow-unused-prefixes.txt
Mircea Trofin [Mon, 2 Nov 2020 18:26:28 +0000 (10:26 -0800)]
[FileCheck] Use %ProtectFileCheckOutput in allow-unused-prefixes.txt

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

3 years ago[KnownBits] Move ValueTracking SREM KnownBits handling to KnownBits::srem. NFCI.
Simon Pilgrim [Thu, 5 Nov 2020 14:55:42 +0000 (14:55 +0000)]
[KnownBits] Move ValueTracking SREM KnownBits handling to KnownBits::srem. NFCI.

Move the ValueTracking implementation to KnownBits, the SelectionDAG version is more limited so I'm intending to replace that as a separate commit.

3 years ago[lldb] Add Apple simulator platforms to lldbplatform.py
Raphael Isemann [Thu, 5 Nov 2020 14:32:03 +0000 (15:32 +0100)]
[lldb] Add Apple simulator platforms to lldbplatform.py

This just adds the simulator platforms to the lldbplatform enumerations
and the respective test decorator.

The platform names for the simulator are just the SDK names since D85537, so
that's why we are not using LLDB's usual platform names here (e.g., SDK =
"iphonesimulator" vs LLDB platform ="ios-simulator").

Also removes the duplicate platform enumaration in lldbplatformutil.py.

Reviewed By: JDevlieghere

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

3 years ago[KnownBits] Move ValueTracking/SelectionDAG UREM KnownBits handling to KnownBits...
Simon Pilgrim [Thu, 5 Nov 2020 14:29:13 +0000 (14:29 +0000)]
[KnownBits] Move ValueTracking/SelectionDAG UREM KnownBits handling to KnownBits::urem. NFCI.

Both these have the same implementation - so move them to a single KnownBits copy.

GlobalISel will be able to use this as well with minimal effort.

3 years ago[mlir] Move TestDialect and its passes to mlir::test namespace.
Alexander Belyaev [Wed, 4 Nov 2020 21:18:26 +0000 (22:18 +0100)]
[mlir] Move TestDialect and its passes to mlir::test namespace.

TestDialect has many operations and they all live in ::mlir namespace.
Sometimes it is not clear whether the ops used in the code for the test passes
belong to Standard or to Test dialects.

Also, with this change it is easier to understand what test passes registered
in mlir-opt are actually passes in mlir/test.

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

3 years ago[sanitizers] Remove the test case involving `new int[0]`
Vy Nguyen [Thu, 5 Nov 2020 05:27:38 +0000 (00:27 -0500)]
[sanitizers] Remove the test case involving `new int[0]`

Bionic doesn't acutally allocate any memory in this case, so there won't be a leak on Android.

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

3 years agoReland [lldb] Explicitly use the configuration architecture when building test execut...
Raphael Isemann [Thu, 22 Oct 2020 13:10:22 +0000 (15:10 +0200)]
Reland [lldb] Explicitly use the configuration architecture when building test executables

This originally broke the TestQuoting which explicitly called buildDefault
instead of calling build() and marking the test as no_debug_info_test.
TestQuoting has been rewritten by now and is using `build`, so this should now
pass on all platforms.

Original summary:

The Darwin builder currently assumes in `getArchCFlags` that the passed `arch`
value is an actual string it can string.join with vendor/os/version/env strings:

```
   triple = '-'.join([arch, vendor, os, version, env])
```

However this is not true for most tests as we just pass down the `arch=None`
default value from `TestBase.build`. This causes that if we actually end up in
this function we just error out when concatenating `None` with the other actual
strings of vendor/os/version/env. What we should do instead is check that if
there is no test-specific architecture that we fall back to the configuration's
architecture value.

It seems we already worked around this in `builder.getArchSpec` by explicitly
falling back to the architecture specified in the configuration.

This patch just moves this fallback logic to the top `build` function so that it
affects all functions called from `TestBase.build`.

Reviewed By: JDevlieghere

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

3 years ago[lldb] Skip TestChangeProcessGroup on watchOS/tvOS
Raphael Isemann [Thu, 5 Nov 2020 14:09:38 +0000 (15:09 +0100)]
[lldb] Skip TestChangeProcessGroup on watchOS/tvOS

`fork` is marked as `__WATCHOS_PROHIBITED __TVOS_PROHIBITED` so the test source
which is calling fork will never compile on watchOS/tvOS. This just adds the
skip decorator for these platforms.

Reviewed By: mib

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

3 years ago[TableGen] Add true and false literals to represent booleans
Paul C. Anagnostopoulos [Mon, 2 Nov 2020 17:37:25 +0000 (12:37 -0500)]
[TableGen] Add true and false literals to represent booleans

Update the Programmer's Reference document.

Add a test. Update a couple of tests with an improved error message.

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

3 years ago[libc++] Correct XFAILs for the C++20 Synchronization Library
Louis Dionne [Thu, 5 Nov 2020 13:44:38 +0000 (08:44 -0500)]
[libc++] Correct XFAILs for the C++20 Synchronization Library

Technically, these tests don't only fail against macosx10.9 to 10.15,
but really against any released macOS yet.

3 years ago[KnownBits] Move ValueTracking/SelectionDAG UDIV KnownBits handling to KnownBits...
Simon Pilgrim [Thu, 5 Nov 2020 13:42:27 +0000 (13:42 +0000)]
[KnownBits] Move ValueTracking/SelectionDAG UDIV KnownBits handling to KnownBits::udiv. NFCI.

Both these have the same implementation - so move them to a single KnownBits copy.

GlobalISel will be able to use this as well with minimal effort.

3 years ago[lldb] Also Catch invalid calls to TestPExpectTest's expect()
Raphael Isemann [Thu, 5 Nov 2020 12:41:26 +0000 (13:41 +0100)]
[lldb] Also Catch invalid calls to TestPExpectTest's expect()

This is a follow up to D88792 which found an issue in a call to PExpectTest's
expect function that allows passing a string to the `substrs` parameter. However
this issue was found by just grepping and TestPExpect's expect function is still
accepting a single string as a value to `substrs`.

This patch adds the same sanity check that D88792 added to the PExpectTest's
implementation of `expect` and also adds a small test for it.

Reviewed By: kastiglione, JDevlieghere

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

3 years ago[Flang][f18] Remove unimplemented options from `flang -help` (NFC)
Andrzej Warzynski [Thu, 5 Nov 2020 12:34:42 +0000 (12:34 +0000)]
[Flang][f18] Remove unimplemented options from `flang -help` (NFC)

3 years ago[GVN] Fix MemorySSA update when replacing assume(false) with stores.
Florian Hahn [Thu, 5 Nov 2020 11:51:06 +0000 (11:51 +0000)]
[GVN] Fix MemorySSA update when replacing assume(false) with stores.

When replacing an assume(false) with a store, we have to be more careful
with the order we insert the new access. This patch updates the code to
look at the accesses in the block to find a suitable insertion point.

Alterantively we could check the defining access of the assume, but IIRC
there has been some discussion about making assume() readnone, so
looking at the access list might be more future proof.

Fixes PR48072.

Reviewed By: asbirlea

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

3 years ago[OpenCL] Support vec_step in C++ for OpenCL mode
Sven van Haastregt [Thu, 5 Nov 2020 12:02:59 +0000 (12:02 +0000)]
[OpenCL] Support vec_step in C++ for OpenCL mode

Enable the vec_step builtin in C++ for OpenCL mode for compatibility
with OpenCL C.

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

3 years ago[GlobalISel] ComputeKnownBits - use common KnownBits shift handling (PR44526)
Simon Pilgrim [Thu, 5 Nov 2020 11:52:07 +0000 (11:52 +0000)]
[GlobalISel] ComputeKnownBits - use common KnownBits shift handling (PR44526)

Convert GISelKnownBits.computeKnownBitsImpl shift handling to use the common KnownBits implementations, which makes use of the known leading/trailing bits for shifted values in cases where we don't know the shift amount value, as detailed in https://blog.regehr.org/archives/1709

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

3 years ago[lsan] Disable some LSAN tests for arm-linux-gnueabi{hf}
Adhemerval Zanella [Mon, 2 Nov 2020 17:42:24 +0000 (14:42 -0300)]
[lsan] Disable some LSAN tests for arm-linux-gnueabi{hf}

The tests do not report the expected leak when issued with use_stack
or use_tls option equal to 0 on arm-linux-gnueabihf (ubuntu 18.04,
glibc 2.27).

This issue is being tracked by https://bugs.llvm.org/show_bug.cgi?id=48052

3 years ago[sanitizer] Assume getrandom might not be supported by the kernel
Adhemerval Zanella [Mon, 2 Nov 2020 17:38:12 +0000 (14:38 -0300)]
[sanitizer] Assume getrandom might not be supported by the kernel

It was added on kernel 3.17.