platform/upstream/llvm.git
3 years ago[InstCombine] add vector demanded elements tests with shuffles; NFC
Sanjay Patel [Tue, 25 Aug 2020 14:57:13 +0000 (10:57 -0400)]
[InstCombine] add vector demanded elements tests with shuffles; NFC

The 1st draft of D86460 (reverted) would show miscompiles with these tests
because the undef element tracking went wrong and became visible in the
shuffle masks.

3 years ago[ELF] .note.gnu.property: error for invalid pr_datasize
Fangrui Song [Tue, 25 Aug 2020 15:05:38 +0000 (08:05 -0700)]
[ELF] .note.gnu.property: error for invalid pr_datasize

A n_type==NT_GNU_PROPERTY_TYPE_0 note encodes a program property.
If pr_datasize is invalid, LLD may crash
(https://github.com/ClangBuiltLinux/linux/issues/1141)

This patch adds some error checking, supports big-endian, and add some tests
for invalid n_descsz.

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

3 years agoAMDGPU/GlobalISel: re-auto-generate some test checks
Jay Foad [Tue, 25 Aug 2020 14:52:11 +0000 (15:52 +0100)]
AMDGPU/GlobalISel: re-auto-generate some test checks

3 years ago[Verifier] Additional check for intrinsic get.active.lane.mask
Sjoerd Meijer [Tue, 25 Aug 2020 14:13:51 +0000 (15:13 +0100)]
[Verifier] Additional check for intrinsic get.active.lane.mask

This adapts the verifier checks for intrinsic get.active.lane.mask to the new
semantics of it as described in D86147. I.e., the second argument %n, which
corresponds to the loop tripcount, must be greater than 0 if it is a constant,
so check that.

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

3 years ago[scudo][standalone] Skip irrelevant regions during release
Kostya Kortchinsky [Mon, 24 Aug 2020 21:13:12 +0000 (14:13 -0700)]
[scudo][standalone] Skip irrelevant regions during release

With the 'new' way of releasing on 32-bit, we iterate through all the
regions in between `First` and `Last`, which covers regions that do not
belong to the class size we are working with. This is effectively wasted
cycles.

With this change, we add a `SkipRegion` lambda to `releaseFreeMemoryToOS`
that will allow the release function to know when to skip a region.
For the 64-bit primary, since we are only working with 1 region, we never
skip.

Reviewed By: hctim

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

3 years ago[DWARFYAML] Make the 'Attributes' field optional.
Xing GUO [Tue, 25 Aug 2020 14:37:40 +0000 (22:37 +0800)]
[DWARFYAML] Make the 'Attributes' field optional.

This patch makes the 'Attributes' field optional. We don't need to
explicitly specify the 'Attributes' field in the future.

Reviewed By: jhenderson, grimar

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

3 years ago[SelectionDAG] Legalize intrinsic get.active.lane.mask
Sjoerd Meijer [Tue, 25 Aug 2020 13:41:53 +0000 (14:41 +0100)]
[SelectionDAG] Legalize intrinsic get.active.lane.mask

This adapts legalization of intrinsic get.active.lane.mask to the new semantics
as described in D86147. Because the second argument is now the loop tripcount,
we legalize this intrinsic to an 'icmp ULT' instead of an ULE when it was the
backedge-taken count.

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

3 years ago[LiveDebugValues] Add switches for using instr-ref variable locations
Jeremy Morse [Tue, 25 Aug 2020 13:23:14 +0000 (14:23 +0100)]
[LiveDebugValues] Add switches for using instr-ref variable locations

This patch adds the -Xclang option
"-fexperimental-debug-variable-locations" and same LLVM CodeGen option,
to pick which variable location tracking solution to use.

Right now all the switch does is pick which LiveDebugValues
implementation to use, the normal VarLoc one or the instruction
referencing one in rGae6f78824031. Over time, the aim is to add fragments
of support in aid of the value-tracking RFC:

  http://lists.llvm.org/pipermail/llvm-dev/2020-February/139440.html

also controlled by this command line switch. That will slowly move
variable locations to be defined by an instruction calculating a value,
and a DBG_INSTR_REF instruction referring to that value. Thus, this is
going to grow into a "use the new kind of variable locations" switch,
rather than just "use the new LiveDebugValues implementation".

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

3 years agoAMDGPU/GlobalISel: Use more accurate legality rules for merge/unmerge
Matt Arsenault [Sat, 22 Aug 2020 22:00:08 +0000 (18:00 -0400)]
AMDGPU/GlobalISel: Use more accurate legality rules for merge/unmerge

Most notably, we were incorrectly reporting <3 x s16> as a legal type
for these. Make sure these aren't legal to help make progress on
fixing the artifact combiner and vector legalizer
rules. Unfortunately, this means spreading the -global-isel-abort=0
hack, although this doesn't change the legalizer result in any
situation.

3 years agoAMDGPU/GlobalISel: Fix using unlegalizable values in tests
Matt Arsenault [Sat, 22 Aug 2020 21:24:47 +0000 (17:24 -0400)]
AMDGPU/GlobalISel: Fix using unlegalizable values in tests

Implicit uses of non-register value types places impossible to satisfy
constraints on the legalizer / artifact combiner. These prevent
writing sensible legalize rules for the artifacts without triggering
infinite loops in the legalizer.

The verifier really needs to enforce this, but I'm not sure what the
exact conditions would look like yet.

3 years ago[ARM][MVE] Tail-predication: remove the BTC + 1 overflow checks
Sjoerd Meijer [Tue, 25 Aug 2020 12:53:26 +0000 (13:53 +0100)]
[ARM][MVE] Tail-predication: remove the BTC + 1 overflow checks

This adapts tail-predication to the new semantics of get.active.lane.mask as
defined in D86147. This means that:
- we can remove the BTC + 1 overflow checks because now the loop tripcount is
  passed in to the intrinsic,
- we can immediately use that value to setup a counter for the number of
  elements processed by the loop and don't need to materialize BTC + 1.

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

3 years agoAMDGPU/GlobalISel: Apply bitcast load/store hack to pointer vectors
Matt Arsenault [Sun, 16 Aug 2020 16:51:31 +0000 (12:51 -0400)]
AMDGPU/GlobalISel: Apply bitcast load/store hack to pointer vectors

The selection patterns will currently fail on these.

3 years ago[Utils] Add highlighting definition for byref IR attribute
Anatoly Trosinenko [Tue, 25 Aug 2020 12:52:26 +0000 (15:52 +0300)]
[Utils] Add highlighting definition for byref IR attribute

This patch assumes `byref` can be handled identically to `byval`.

Reviewed By: MaskRay

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

3 years ago[compiler-rt][builtins] Add more test cases for __div[sdt]f3 LibCalls
Anatoly Trosinenko [Tue, 25 Aug 2020 11:01:19 +0000 (14:01 +0300)]
[compiler-rt][builtins] Add more test cases for __div[sdt]f3 LibCalls

* Make the three tests look more uniformly
* Explicitly specify types of integer and floating point literals
* Add more test cases (mostly inspired by divtf3_test.c)
  - tests are added for obviously special cases such as +/-Inf, +/-0.0 and some
    more implementation-specific cases such as divisor being almost 1.0
* Make NaN in the second test case of `divtf3` to be `sNaN` instead of
  testing for `qNaN` again

Reviewed By: sepavloff

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

3 years ago[libFuzzer] Un-XFAIL msan.test on SystemZ
Ilya Leoshkevich [Tue, 25 Aug 2020 12:37:15 +0000 (14:37 +0200)]
[libFuzzer] Un-XFAIL msan.test on SystemZ

After https://reviews.llvm.org/D86382 it works.

Reviewed By: morehouse

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

3 years ago[LV] get.active.lane.mask consuming tripcount instead of backedge-taken count
Sjoerd Meijer [Tue, 25 Aug 2020 12:39:55 +0000 (13:39 +0100)]
[LV] get.active.lane.mask consuming tripcount instead of backedge-taken count

This adapts LV to the new semantics of get.active.lane.mask as discussed in
D86147, which means that the LV now emits intrinsic get.active.lane.mask with
the loop tripcount instead of the backedge-taken count as its second argument.
The motivation for this is described in D86147.

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

3 years ago[clangd] When inserting "using", add "::" in front if that's the style.
Adam Czachorowski [Mon, 24 Aug 2020 17:16:20 +0000 (19:16 +0200)]
[clangd] When inserting "using", add "::" in front if that's the style.

We guess the style based on the existing using declarations. If there
are any and they all start with ::, we add it to the newly added one
too.

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

3 years agoFix update_llc_test_checks function regex for RV64
Alex Richardson [Mon, 24 Aug 2020 17:56:02 +0000 (18:56 +0100)]
Fix update_llc_test_checks function regex for RV64

Some functions also include a `.Lfunc$local:` label due to
-fno-semantic-interposition

Reviewed By: MaskRay

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

3 years agoFix crypt.cpp sanitizer test on FreeBSD
Alex Richardson [Mon, 24 Aug 2020 17:55:29 +0000 (18:55 +0100)]
Fix crypt.cpp sanitizer test on FreeBSD

FreeBSD doesn't provide a crypt.h header but instead defines the functions
in unistd.h. Use __has_include() to handle that case.

Reviewed By: #sanitizers, vitalybuka

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

3 years ago[asan] Also allow for SIGBUS in high-address-dereference.c
Alex Richardson [Mon, 24 Aug 2020 17:55:22 +0000 (18:55 +0100)]
[asan] Also allow for SIGBUS in high-address-dereference.c

FreeBSD delivers a SIGBUS signal for bad addresses rather than SIGSEGV.

Reviewed By: #sanitizers, vitalybuka, yln

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

3 years ago[NFC][SimplifyCFG] More tests for Arm
Sam Parker [Tue, 25 Aug 2020 11:13:30 +0000 (12:13 +0100)]
[NFC][SimplifyCFG] More tests for Arm

3 years ago[ARM][CGP] Fix scalar condition selects for MVE
David Green [Tue, 25 Aug 2020 11:09:06 +0000 (12:09 +0100)]
[ARM][CGP] Fix scalar condition selects for MVE

The arm backend does not handle select/select_cc on vectors with scalar
conditions, preferring to expand them in codegenprepare instead. This
usually works except when optimizing for size, where the optsize check
would end up overruling the backend isSelectSupported check.

We could handle the selects in ISel too, but this seems like smaller
code than trying to splat the condition to all lanes.

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

3 years ago[libunwind] Fix warning when building without frameheader cache
Mikael Holmen [Tue, 25 Aug 2020 10:26:48 +0000 (12:26 +0200)]
[libunwind] Fix warning when building without frameheader cache

Without the fix the compiler warns with

/data/repo/master/libunwind/src/AddressSpace.hpp:436:44: warning: unused parameter 'pinfo_size' [-Wunused-parameter]
                                    size_t pinfo_size, void *data) {
                                           ^
1 warning generated.

3 years ago[PowerPC] Fix gcc warning [NFC]
Mikael Holmen [Tue, 25 Aug 2020 10:23:56 +0000 (12:23 +0200)]
[PowerPC] Fix gcc warning [NFC]

Without the fix gcc 7.4 warns with

../lib/Target/PowerPC/PPCAsmPrinter.cpp: In member function 'void {anonymous}::PPCAsmPrinter::EmitTlsCall(const llvm::MachineInstr*, llvm::MCSymbolRefExpr::VariantKind)':
../lib/Target/PowerPC/PPCAsmPrinter.cpp:525:53: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
                  MCInstBuilder(Subtarget->isPPC64() ? Opcode : PPC::BL_TLS)
                                ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

3 years ago[NFC][SimplifyCFG] Add some more tests for Arm.
Sam Parker [Tue, 25 Aug 2020 10:43:54 +0000 (11:43 +0100)]
[NFC][SimplifyCFG] Add some more tests for Arm.

3 years ago[Attributor][NFC] Clang format
Shinji Okumura [Tue, 25 Aug 2020 10:31:56 +0000 (19:31 +0900)]
[Attributor][NFC] Clang format

3 years ago[SVE] Lower scalable vector ISD::FNEG operations.
Paul Walker [Fri, 21 Aug 2020 18:00:36 +0000 (19:00 +0100)]
[SVE] Lower scalable vector ISD::FNEG operations.

Also updates isConstOrConstSplatFP to allow the mul(A,-1) -> neg(A)
transformation when -1 is expressed as an ISD::SPLAT_VECTOR.

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

3 years ago[NFC][ARM] arith code size cost tests
Sam Parker [Tue, 25 Aug 2020 10:16:01 +0000 (11:16 +0100)]
[NFC][ARM] arith code size cost tests

Add a run to measure the code size cost of arithmetic instructions
and add a function for i1 types.

3 years ago[UpdatesTestChecks] Fix typo in common.py
Sam Parker [Tue, 25 Aug 2020 10:12:26 +0000 (11:12 +0100)]
[UpdatesTestChecks] Fix typo in common.py

global_vars_see_dict -> global_vars_seen_dict

3 years ago[llvm-readobj] - Print "Unknown" when a program header is unknown.
Georgii Rymar [Wed, 19 Aug 2020 13:23:51 +0000 (16:23 +0300)]
[llvm-readobj] - Print "Unknown" when a program header is unknown.

Currently, when a program header type is unknown, we dont print anything:

```
ProgramHeader {
  Type:  (0x60000000)
```

With this patch the output will be:

```
ProgramHeader {
  Type: Unknown (0x60000000)
```

It was discussed in D85526 and consistent with what we print for
'--sections' already, e.g.:

```
Section {
  Name: .sec
  Type: Unknown (0x7FFFFFFF)
}
```

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

3 years ago[NFC][InstCombine] Tests for PHI-of-extractvalues
Roman Lebedev [Tue, 25 Aug 2020 10:00:37 +0000 (13:00 +0300)]
[NFC][InstCombine] Tests for PHI-of-extractvalues

Much like with it's sibling fold HI-of-insertvalues,
it appears to be much more worthwhile than it would seem.

3 years agoRevert "[InstCombine] improve demanded element analysis for vector insert-of-extract"
Benjamin Kramer [Tue, 25 Aug 2020 09:31:31 +0000 (11:31 +0200)]
Revert "[InstCombine] improve demanded element analysis for vector insert-of-extract"

This reverts commit 557b890ff4f4dd5fa979c232df5b31cf3fef04c1. Causing
miscompiles, test case is on llvm-commits.

3 years agoRevert "[CMake] Fix ncurses/zlib in LLVM_SYSTEM_LIBS for Windows GNU"
Hans Wennborg [Tue, 25 Aug 2020 09:16:50 +0000 (11:16 +0200)]
Revert "[CMake] Fix ncurses/zlib in LLVM_SYSTEM_LIBS for Windows GNU"

It broke Chromium's llvm build:

 CMake Error at lib/Support/CMakeLists.txt:13 (string):
   string sub-command REGEX, mode REPLACE: regex "^()" matched an empty
   string.
 Call Stack (most recent call first):
   lib/Support/CMakeLists.txt:223 (get_system_libname)

This reverts commit 2b3807d822c50d361ae67184b6de5a41bd7b1bba /  https://reviews.llvm.org/D86434

3 years ago[llvm-readelf/obj] - Change the return type of the `createDRI(...)` to `Expected<>`
Georgii Rymar [Mon, 24 Aug 2020 12:44:39 +0000 (15:44 +0300)]
[llvm-readelf/obj] - Change the return type of the `createDRI(...)` to `Expected<>`

This allows to get rid of "Invalid data was encountered while parsing the file"
error reported in cases when sh_size/sh_offset of sections are broken.

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

3 years ago[FileCheck][docs] Fix word errors
Yang Zhihui [Tue, 25 Aug 2020 08:41:19 +0000 (09:41 +0100)]
[FileCheck][docs] Fix word errors

ouput -> output

Reviewed By: thopre

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

3 years ago[llvm-dwarfdump] Fix misleading scope byte coverage statistics
OCHyams [Tue, 25 Aug 2020 05:19:00 +0000 (06:19 +0100)]
[llvm-dwarfdump] Fix misleading scope byte coverage statistics

Fixes PR46575.

Bump statistics version to 6.

Without this patch, for a variable described with a location list the stat
'sum_all_variables(#bytes in parent scope covered by DW_AT_location)' is
calculated by summing all bytes covered by the location ranges in the list and
capping the result to the number of bytes in the parent scope. With the patch,
only bytes which overlap with the parent DIE scope address ranges contribute to
the stat. A new stat 'sum_all_variables(#bytes in any scope covered by
DW_AT_location)' has been added which displays the total bytes covered when
ignoring scopes.

3 years ago[SVE] Fix TypeSize related warnings with IR truncates of scalable vectors
David Sherwood [Wed, 19 Aug 2020 08:13:12 +0000 (09:13 +0100)]
[SVE] Fix TypeSize related warnings with IR truncates of scalable vectors

In getCastInstrCost when the instruction is a truncate we were relying
upon the implicit TypeSize -> uint64_t cast when asking if a given type
has the same size as a legal integer. I've changed the code to only
ask the question if the type is fixed length.

I have also changed InstCombinerImpl::SimplifyDemandedUseBits to bail
out for now if the type is a scalable vector.

I've added the following new tests:

  Analysis/CostModel/AArch64/sve-trunc.ll
  Transforms/InstCombine/AArch64/sve-trunc.ll

for both of these fixes.

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

3 years ago[DSE,MemorySSA] Cache accesses with/without reachable read-clobbers.
Florian Hahn [Tue, 25 Aug 2020 07:43:32 +0000 (08:43 +0100)]
[DSE,MemorySSA] Cache accesses with/without reachable read-clobbers.

Currently we repeatedly check the same uses for read clobbers in some
cases. We can avoid unnecessary checks by keeping track of the memory
accesses we already found read clobbers for. To do so, we just add
memory access causing read-clobbers to a set. Note that marking all
visited accesses as read-clobbers would be to pessimistic, as that might
include accesses not on any path to  the actual read clobber.

If we do not find any read-clobbers, we can add all visited instructions
to another set and use that to skip the same accesses in the next call.

Reviewed By: asbirlea

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

3 years ago[InstCombine] PHI-of-insertvalues -> insertvalue-of-PHI's
Roman Lebedev [Tue, 25 Aug 2020 07:25:34 +0000 (10:25 +0300)]
[InstCombine] PHI-of-insertvalues -> insertvalue-of-PHI's

As per statistic, this happens pretty exceedingly rare,
but i have seen it in exactly the situations the
Phi-aware aggregate reconstruction would have handled,
eventually, and allowed invoke -> call fold later on.

So while this might be something that other fold
will have to learn about, i believe we should be
doing this transform in general.

Here, we are okay with adding two PHI's to get both the base aggregate,
and the inserted value. I'm not sure it makes much sense to restrict
it to a single phi (to just the inserted value?), because originally
we'd be receiving the final aggregate already..

llvm test-suite + RawSpeed:
```
| statistic name                             | baseline  | proposed  |    Î” |      % | \|%\| |
|--------------------------------------------|-----------|-----------|-----:|-------:|------:|
| instcombine.NumPHIsOfInsertValues          | 0         | 12        |  12  |  0.00% | 0.00% |
| asm-printer.EmittedInsts                   | 8926643   | 8926595   | -48  |  0.00% | 0.00% |
| instcombine.NumCombined                    | 3846614   | 3846640   |  26  |  0.00% | 0.00% |
| instcombine.NumConstProp                   | 24302     | 24293     |  -9  | -0.04% | 0.04% |
| instcombine.NumDeadInst                    | 1620140   | 1620112   | -28  |  0.00% | 0.00% |
| instcount.NumBrInst                        | 898466    | 898464    |  -2  |  0.00% | 0.00% |
| instcount.NumCallInst                      | 1760819   | 1760875   |  56  |  0.00% | 0.00% |
| instcount.NumExtractValueInst              | 45659     | 45649     | -10  | -0.02% | 0.02% |
| instcount.NumInsertValueInst               | 4991      | 4981      | -10  | -0.20% | 0.20% |
| instcount.NumIntToPtrInst                  | 27084     | 27087     |   3  |  0.01% | 0.01% |
| instcount.NumPHIInst                       | 371435    | 371429    |  -6  |  0.00% | 0.00% |
| instcount.NumStoreInst                     | 906011    | 906019    |   8  |  0.00% | 0.00% |
| instcount.TotalBlocks                      | 1105520   | 1105518   |  -2  |  0.00% | 0.00% |
| instcount.TotalInsts                       | 9795737   | 9795776   |  39  |  0.00% | 0.00% |
| simplifycfg.NumInvokes                     | 2784      | 2786      |   2  |  0.07% | 0.07% |
| simplifycfg.NumSimpl                       | 1001840   | 1001850   |  10  |  0.00% | 0.00% |
| simplifycfg.NumSinkCommonInstrs            | 15174     | 15170     |  -4  | -0.03% | 0.03% |
```

Reviewed By: spatel

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

3 years ago[NFC][RDA] Add explicit def check
Sam Parker [Tue, 25 Aug 2020 07:35:07 +0000 (08:35 +0100)]
[NFC][RDA] Add explicit def check

Explicitly check that there is a local def prior to the given
instruction in getReachingLocalMIDef instead of just relying on
a nullptr return from getInstFromId.

3 years ago[compiler-rt][asan][test] Set LD_LIBRARY_PATH_{32,64} on Solaris
Rainer Orth [Tue, 25 Aug 2020 07:36:51 +0000 (09:36 +0200)]
[compiler-rt][asan][test] Set LD_LIBRARY_PATH_{32,64} on Solaris

The dynamically linked ASan tests rely on `LD_LIBRARY_PATH` to find
`libclang_rt.asan-*.so` at runtime.

However, the Solaris runtime linker `ld.so.1` also supports more specific
variables: `LD_LIBRARY_PATH_32` and `LD_LIBRARY_PATH_64` respectively.  If
those happen to be set, `LD_LIBRARY_PATH` is ignored.  In such a case, all
dynamically linked ASan tests `FAIL`.  For i386 alone, this affects about
200 tests.

The following patch fixes that by also setting `LD_LIBRARY_PATH_{32,64}` on
Solaris.

Tested on `amd64-pc-solaris2.11` both with only `LD_LIBRARY_PATH` set and
with `LD_LIBRARY_PATH_{32,64}` set too.

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

3 years ago[Compiler-RT] Fix profiler building with MinGW GCC
Mateusz Mikuła [Tue, 25 Aug 2020 07:16:40 +0000 (10:16 +0300)]
[Compiler-RT] Fix profiler building with MinGW GCC

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

3 years ago[SyntaxTree] Update `Modifiable` tests to dump `NodeRole` and `unmodifiable` tag
Eduardo Caldas [Mon, 24 Aug 2020 15:54:22 +0000 (15:54 +0000)]
[SyntaxTree] Update `Modifiable` tests to dump `NodeRole` and `unmodifiable` tag

3 years ago[SyntaxTree] Update `Declaration` tests to dump `NodeRole`
Eduardo Caldas [Fri, 21 Aug 2020 16:51:50 +0000 (16:51 +0000)]
[SyntaxTree] Update `Declaration` tests to dump `NodeRole`

3 years ago[SyntaxTree] Update `Expression` tests to dump `NodeRole`
Eduardo Caldas [Fri, 21 Aug 2020 12:57:16 +0000 (12:57 +0000)]
[SyntaxTree] Update `Expression` tests to dump `NodeRole`

3 years ago[SyntaxTree] Update `Statement` tests to dump `NodeRole`
Eduardo Caldas [Fri, 21 Aug 2020 09:57:15 +0000 (09:57 +0000)]
[SyntaxTree] Update `Statement` tests to dump `NodeRole`

3 years ago[SyntaxTree] Extend the syntax tree dump to also cover `NodeRole`
Eduardo Caldas [Wed, 5 Aug 2020 13:55:17 +0000 (13:55 +0000)]
[SyntaxTree] Extend the syntax tree dump to also cover `NodeRole`

We should see `NodeRole` information in the dump because that exposes how the
accessors will behave.

Functional changes in the dump:
* Surround Leaf tokens with `'`
* Append `Node` dumps with `NodeRole` information, except for unknown roles
* Append marks to `Node` dumps, instead of prepending

Non-functional changes:
* `::dumpTokens(llvm::raw_ostream, ArrayRef<syntax::Token>, const
SourceManager &SM)` always received as parameter a `syntax::Token *`
pointing to `Leaf::token()`. Changed the function to
`dumpLeaf(llvm::raw_ostream, syntax::Leaf *, const SourceManager&)`
* `dumpTree` acted on a Node, rename to `dumpNode`

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

3 years ago[lldb] Don't depend on psutil in TestCompletion.py
Raphael Isemann [Tue, 25 Aug 2020 06:25:58 +0000 (08:25 +0200)]
[lldb] Don't depend on psutil in TestCompletion.py

psutil isn't reall a dependency of the test suite so this shouldn't be
unconditionally be imported here. Instead just check for the process name
by looking for the "a.out" string to get the bots green again.

3 years agoPR37556: Don't diagnose conflicts between instantiated unqualified
Richard Smith [Tue, 25 Aug 2020 05:49:41 +0000 (22:49 -0700)]
PR37556: Don't diagnose conflicts between instantiated unqualified
friend declarations and declarations found in inline namespaces within
the target context.

3 years ago[X86] Support -march=sapphirerapids
Freddy Ye [Tue, 25 Aug 2020 04:27:02 +0000 (12:27 +0800)]
[X86] Support -march=sapphirerapids

Support -march=sapphirerapids for x86.
Compare with Icelake Server, it includes 14 more new features. They are
amxtile, amxint8, amxbf16, avx512bf16, avx512vp2intersect, cldemote,
enqcmd, movdir64b, movdiri, ptwrite, serialize, shstk, tsxldtrk, waitpkg.

Reviewed By: craig.topper

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

3 years ago[SyntaxTree] Use annotations on ClassTemplate_MemberClassDefinition test
Eduardo Caldas [Mon, 24 Aug 2020 16:38:38 +0000 (16:38 +0000)]
[SyntaxTree] Use annotations on ClassTemplate_MemberClassDefinition test

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

3 years ago[SyntaxTree] Split ConstVolatileQualifiers tests
Eduardo Caldas [Mon, 24 Aug 2020 16:33:09 +0000 (16:33 +0000)]
[SyntaxTree] Split ConstVolatileQualifiers tests

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

3 years ago[SyntaxTree] Split `MemberPointer` tests with annotations
Eduardo Caldas [Mon, 24 Aug 2020 16:13:34 +0000 (16:13 +0000)]
[SyntaxTree] Split `MemberPointer` tests with annotations

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

3 years ago[CMake] Fix ncurses/zlib in LLVM_SYSTEM_LIBS for Windows GNU
Petr Hosek [Tue, 25 Aug 2020 06:00:54 +0000 (23:00 -0700)]
[CMake] Fix ncurses/zlib in LLVM_SYSTEM_LIBS for Windows GNU

For the Windows GNU platform, CMAKE_FIND_LIBRARY_PREFIXES is a list
containing an empty string, which ended up in a regex capturing group,
which is invalid in CMake's regex engine. With this change, we get the
following:

  set(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
  set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a" ".a" ".lib")
  get_system_libname(path/to/libz.dll.a zlib)
  message("${zlib}")

outputs z, as expected.

Patch By: haampie

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

3 years agoTemporarily Revert "[DebugInfo] Move constructor homing case in shouldOmitDefinition."
Eric Christopher [Tue, 25 Aug 2020 04:51:31 +0000 (21:51 -0700)]
Temporarily Revert "[DebugInfo] Move constructor homing case in shouldOmitDefinition."
as it's causing test failures.

This reverts commit 589ce5f7050dd83fd3f7dbc182ea0fb051ece994.

3 years ago[DebugInfo] Move constructor homing case in shouldOmitDefinition.
Amy Huang [Tue, 25 Aug 2020 03:17:59 +0000 (20:17 -0700)]
[DebugInfo] Move constructor homing case in shouldOmitDefinition.

For some reason the ctor homing case was before the template
specialization case, and could have returned false too early.
I moved the code out into a separate function to avoid this.

Also added a run line to the template specialization test. I guess
all the -debug-info-kind=limited tests should still pass with =constructor,
but it's probably unnecessary to test for all of those.

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

3 years agoDisable 'not' test on Windows because 'env' from GnuWin32 cannot be used without...
Alexandre Ganea [Tue, 25 Aug 2020 01:55:34 +0000 (21:55 -0400)]
Disable 'not' test on Windows because 'env' from GnuWin32 cannot be used without arguments.

3 years ago[flang] Don't attempt to compute element size if no DynamicType
Tim Keith [Tue, 25 Aug 2020 01:20:22 +0000 (18:20 -0700)]
[flang] Don't attempt to compute element size if no DynamicType

If an error has occurred a symbol may have a DeclTypeSpec but no
valid DynamicType. There is no need to compute the size of erroneous
symbols.

Also, we only need to process object entities and procedure entities.
All other kinds of symbols can be skipped.

This fixes another problem revealed by https://bugs.llvm.org/show_bug.cgi?id=47265

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

3 years agoAdd NDEBUG checks around debug only loop to avoid unused variable
Eric Christopher [Tue, 25 Aug 2020 00:58:17 +0000 (17:58 -0700)]
Add NDEBUG checks around debug only loop to avoid unused variable
warnings.

3 years agoProperly pass modules flags to frontend when using -std=c++20 instead of -std=c++2a.
Richard Smith [Mon, 24 Aug 2020 23:28:41 +0000 (16:28 -0700)]
Properly pass modules flags to frontend when using -std=c++20 instead of -std=c++2a.

In passing, also teach the driver to map /std:c++latest to -std=c++20
not -std=c++2a.

3 years ago[MLInliner] Support training that doesn't require partial rewards
Mircea Trofin [Mon, 24 Aug 2020 18:36:22 +0000 (11:36 -0700)]
[MLInliner] Support training that doesn't require partial rewards

If we use training algorithms that don't need partial rewards, we don't
need to worry about an ir2native model. In that case, training logs
won't contain a 'delta_size' feature either (since that's the partial
reward).

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

3 years ago[not][test] Fix disable-symbolization.test when 'printenv' is not available
Fangrui Song [Tue, 25 Aug 2020 00:27:34 +0000 (17:27 -0700)]
[not][test] Fix disable-symbolization.test when 'printenv' is not available

On Windows, 'env' or 'printenv' may not exist.

Also switch back to 'env' which is specified by POSIX.1-2017. 'printenv' is not
standard (I picked it because 'printenv' exists on GnuWin32 but 'env' does not).

Reviewed By: zequanwu

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

3 years ago[LLDB] Fix SVE offset calculation in NativeRegisterContextLinux_arm64
Muhammad Omair Javaid [Mon, 24 Aug 2020 19:41:01 +0000 (00:41 +0500)]
[LLDB] Fix SVE offset calculation in NativeRegisterContextLinux_arm64

There was typo left from changes in CalculateSVEOffset where we moved
FPSR/FPCR offset calculation into WriteRegister and ReadRegister.

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

3 years agoFix test for D77924.
Elliott Hughes [Thu, 20 Aug 2020 22:59:18 +0000 (15:59 -0700)]
Fix test for D77924.

The trailing 'L' was missing in the expectation.

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

3 years ago[LLDB] Fix how ValueObjectVariable handles DW_AT_const_value when the DWARFExpression...
shafik [Mon, 24 Aug 2020 21:38:55 +0000 (14:38 -0700)]
[LLDB] Fix how ValueObjectVariable handles DW_AT_const_value when the DWARFExpression holds the data that represents a constant value

In some cases when we have a DW_AT_const_value and the data can be found in the
DWARFExpression then ValueObjectVariable does not handle it properly and we end
up with an extracting data from value failed error.

The test is a very stripped down assembly file since reproducing this relies on the results of compiling with -O1 which may not be stable over time.

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

3 years ago[DAGCombine]: Fold X/Sqrt(X) to Sqrt(X)
Venkataramanan Kumar [Mon, 24 Aug 2020 22:12:32 +0000 (18:12 -0400)]
[DAGCombine]: Fold X/Sqrt(X) to Sqrt(X)

With FMF ( "nsz" and " reassoc") fold X/Sqrt(X) to Sqrt(X).

This is done after targets have the chance to produce a
reciprocal sqrt estimate sequence because that expansion
is probably more efficient than an expansion of a
non-reciprocal sqrt. That is also why we deferred doing
this transform in IR (D85709).

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

3 years ago[x86][AArch64] adjust fast-math-flags in tests; NFC
Sanjay Patel [Mon, 24 Aug 2020 22:05:05 +0000 (18:05 -0400)]
[x86][AArch64] adjust fast-math-flags in tests; NFC

This goes with the proposal in D86403.

3 years ago[lldb] Add a SymbolFileProvider to record and replay calls to dsymForUUID
Jonas Devlieghere [Mon, 24 Aug 2020 22:07:02 +0000 (15:07 -0700)]
[lldb] Add a SymbolFileProvider to record and replay calls to dsymForUUID

When replaying a reproducer captured from a core file, we always use
dsymForUUID for the kernel binary. When enabled, we also use it to find
kexts. Since these files are already contained in the reproducer,
there's no reason to call out to an external tool. If the tool returns a
different result, e.g. because the dSYM got garbage collected, it will
break reproducer replay. The SymbolFileProvider solves the issue by
mapping UUIDs to module and symbol paths in the reproducer.

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

3 years agoAMDGPU/GlobalISel: Handle AGPRs used for SGPR operands.
Matt Arsenault [Wed, 12 Aug 2020 15:17:40 +0000 (11:17 -0400)]
AMDGPU/GlobalISel: Handle AGPRs used for SGPR operands.

We would still need to waterfall if the value were somehow an AGPR,
and also need to explicitly copy to a VGPR.

3 years ago[PowerPC] Do not use FISel for calls and TOC-based accesses with PC-Rel
Nemanja Ivanovic [Mon, 24 Aug 2020 21:51:19 +0000 (16:51 -0500)]
[PowerPC] Do not use FISel for calls and TOC-based accesses with PC-Rel

PC-Relative addressing introduces a fair bit of complexity for correctly
eliminating TOC accesses. FastISel does not include any of that handling so we
miscompile code with -mcpu=pwr10 -O0 if it includes an external call that
FastISel does not handle followed by any of the following:

    Floating point constant materialization
    Materialization of a GlobalValue
    Call that FastISel does handle

This patch switches to SDISel for any of the above.

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

3 years ago[X86] Copy the tuning features and scheduler model from pentium4/x86-64 to generic
Craig Topper [Mon, 24 Aug 2020 17:51:56 +0000 (10:51 -0700)]
[X86] Copy the tuning features and scheduler model from pentium4/x86-64 to generic

This is preparation for making clang default to -mtune=generic when no -march is specified. This will allow the default tuning to be "generic" even though our default march is "pentium4" or "x86-64".

To avoid llc lit test regressions, if no mcpu is specified, I've defaulted tune to use i586 to match the old tuning settings of no CPU. Some tests explicitly used -mcpu=generic which I've removed so they instead get this default of architecture features from generic and tune from i586.

I updated one llvm-mca test to check a different CPU since generic has a scheduler model now

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

3 years agoAMDGPU: Have a few selection failure tests check both paths
Matt Arsenault [Thu, 30 Jul 2020 02:01:32 +0000 (22:01 -0400)]
AMDGPU: Have a few selection failure tests check both paths

SelectionDAG and GlobalISel take different failure paths for these and
end up producing different failure errors. Check both so the test
passes when the default is switched.

3 years ago[TSan][libdispatch] Add interceptors for dispatch_barrier_async_and_wait(), pt. 2
Julian Lettner [Mon, 24 Aug 2020 21:36:18 +0000 (14:36 -0700)]
[TSan][libdispatch] Add interceptors for dispatch_barrier_async_and_wait(), pt. 2

Also intercept these target functions on Linux.

3 years ago[PowerPC] Handle SUBFIC in reg+reg -> reg+imm transformation
Nemanja Ivanovic [Mon, 24 Aug 2020 21:22:44 +0000 (16:22 -0500)]
[PowerPC] Handle SUBFIC in reg+reg -> reg+imm transformation

We initially missed the subtract-immediate in this transformation.
This patch just adds that.

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

3 years ago[libunwind] Remove static_assert / __has_feature macros
Ryan Prichard [Mon, 24 Aug 2020 21:07:20 +0000 (14:07 -0700)]
[libunwind] Remove static_assert / __has_feature macros

The static_assert macro broke on GCC when a scope had two asserts and a
condition that depended on a template parameter. Remove the macro and
rely on the compiler's C++11 static_assert feature.

The __has_feature macro was only used here to determine whether to
define the static_assert macro.

Reviewed By: mstorsjo, #libunwind

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

3 years ago[TSan][libdispatch] Add interceptors for dispatch_barrier_async_and_wait()
Julian Lettner [Mon, 24 Aug 2020 20:56:22 +0000 (13:56 -0700)]
[TSan][libdispatch] Add interceptors for dispatch_barrier_async_and_wait()

Add interceptors for the barrier variants of the "async and wait"
dispatch API family.

3 years ago[InstCombine] improve demanded element analysis for vector insert-of-extract
Sanjay Patel [Mon, 24 Aug 2020 19:31:31 +0000 (15:31 -0400)]
[InstCombine] improve demanded element analysis for vector insert-of-extract

InstCombine currently has odd rules for folding insert-extract chains to shuffles,
so we miss collapsing seemingly simple cases as shown in the tests here.

But poison makes this not quite as easy as we might have guessed. Alive2 tests to
show the subtle difference (similar to the regression tests):
https://alive2.llvm.org/ce/z/hp4hv3 (this is ok)
https://alive2.llvm.org/ce/z/ehEWaN (poison leakage)

SLP tends to create these patterns (as shown in the SLP tests), and this could
help with solving PR16739.

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

3 years ago[SLP] avoid 'tmp' names in regression tests; NFC
Sanjay Patel [Mon, 24 Aug 2020 14:10:00 +0000 (10:10 -0400)]
[SLP] avoid 'tmp' names in regression tests; NFC

That can cause problems for update_test_checks.py (it warns when updating this file).

3 years ago[InstCombine] add tests for insert+extract demanded elements; NFC
Sanjay Patel [Mon, 24 Aug 2020 13:27:30 +0000 (09:27 -0400)]
[InstCombine] add tests for insert+extract demanded elements; NFC

3 years ago[runtimes] Use llvm-libtool-darwin for runtimes build
Shoaib Meenai [Fri, 21 Aug 2020 20:03:13 +0000 (13:03 -0700)]
[runtimes] Use llvm-libtool-darwin for runtimes build

It's full featured now and we can use it for the runtimes build instead
of relying on an external libtool, which means the CMAKE_HOST_APPLE
restriction serves no purpose either now. Restrict llvm-lipo to Darwin
targets while I'm here, since it's only needed there.

Reviewed By: phosek

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

3 years ago[runtimes] Remove TOOLCHAIN_TOOLS specialization
Shoaib Meenai [Fri, 21 Aug 2020 19:57:16 +0000 (12:57 -0700)]
[runtimes] Remove TOOLCHAIN_TOOLS specialization

{builtin,runtime}_register_target passes a TOOLCHAIN_TOOLS list, whereas
{builtin,runtime}_default_target does notl. The explicit TOOLCHAIN_TOOLS
list matches what LLVMExternalProjectUtils would have set anyway,
barring some target-specific adjustments, and those target-specific
adjustments seem valuable, so let's drop the explicit TOOLCHAIN_TOOLS
list and let LLVMExternalProjectUtils take care of it.

Reviewed By: phosek

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

3 years ago[compiler-rt] Disable ranlib when using libtool
Shoaib Meenai [Fri, 21 Aug 2020 19:54:31 +0000 (12:54 -0700)]
[compiler-rt] Disable ranlib when using libtool

libtool already produces a table of contents, and ranlib just gives
spurious errors because it doesn't understand universal binaries.

Reviewed By: phosek

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

3 years ago[llvm-libtool-darwin] Add support for -V option
Shoaib Meenai [Fri, 21 Aug 2020 17:49:59 +0000 (10:49 -0700)]
[llvm-libtool-darwin] Add support for -V option

The -V option in cctools' libtool prints out the version number and
performs any specified operation. Add this option to LLVM's version.
cctools is more forgiving of invalid command lines when -V is specified,
but I think it's better to give errors instead of silently producing no
output.

Unfortunately, when -V is present, options that would otherwise be
required aren't anymore, so we need to perform some manual argument
validation.

Reviewed By: alexshap

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

3 years agoAdd <stdarg.h> include to kmp_os.h, to get the va_list type, required
Dimitry Andric [Mon, 24 Aug 2020 20:45:02 +0000 (22:45 +0200)]
Add <stdarg.h> include to kmp_os.h, to get the va_list type, required
after cde8f4c164a2. Sort system includes, while here.

3 years agoMove special va_list handling to kmp_os.h
Dimitry Andric [Sat, 22 Aug 2020 13:25:18 +0000 (15:25 +0200)]
Move special va_list handling to kmp_os.h

Instead of copying and pasting the same `#ifdef` expressions in multiple
places, define a type and a pair of macros in `kmp_os.h`, to handle
whether `va_list` is pointer-like or not:

* `kmp_va_list` is the type to use for `__kmp_fork_call()`
* `kmp_va_deref()` dereferences a `va_list`, if necessary
* `kmp_va_addr_of()` takes the address of a `va_list`, if necessary

Also add FreeBSD to the list of OSes that has a non pointer-like
va_list. This can now be easily extended to other OSes too.

Reviewed By: AndreyChurbanov

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

3 years ago[Scalarizer] Avoid updating the name of globals
Bjorn Pettersson [Mon, 24 Aug 2020 17:15:34 +0000 (19:15 +0200)]
[Scalarizer] Avoid updating the name of globals

The "takeName" logic at the end of ScalarizerVisitor::finish
could end up renaming global variables when having simplified
and extractelement instruction to simply pick a single vector
element. If the input vector to the extractelement instruction
held pointers to global variables we ended up renaming the global
variable.
The patch make sure we only take the name of the replaced Op when
we have added new instructions that might need a useful name.

Reviewed By: lebedev.ri

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

3 years ago[flang] Fix bug accessing implicit variable in specification expression
Tim Keith [Mon, 24 Aug 2020 19:53:44 +0000 (12:53 -0700)]
[flang] Fix bug accessing implicit variable in specification expression

A specification expression can reference an implicitly declared variable
in the host procedure. Because we have to process specification parts
before execution parts, this may be the first time we encounter the
variable. We were assuming the variable was implicitly declared in the
scope where it was encountered, leading to an error because local
variables may not be referenced in specification expressions.

The fix is to tentatively create the implicit variable in the host
procedure because that is the only way the specification expression can
be valid. We mark it with the flag `ImplicitOrError` to indicate that
either it must be implicitly defined in the host (by being mentioned in
the execution part) or else its use turned out to be an error.
We need to apply the implicit type rules of the host, which requires
some changes to implicit typing.

Variables in common blocks are allowed to appear in specification expressions
(because they are not locals) but the common block definition may not appear
until after their use. To handle this we create common block symbols and object
entities for each common block object during the `PreSpecificationConstruct`
pass. This allows us to remove the corresponding code in the main visitor and
`commonBlockInfo_.curr`. The change in order of processing causes some
different error messages to be emitted.

Some cleanup is included with this change:
- In `ExpressionAnalyzer`, if an unresolved name is encountered but
  no error has been reported, emit an internal error.
- Change `ImplicitRulesVisitor` to hide the `ImplicitRules` object
  that implements it. Change the interface to pass in names rather
  than having to get the first character of the name.
- Change `DeclareObjectEntity` to have the `attrs` argument default
  to an empty set; that is the typical case.
- In `Pre(parser::SpecificationPart)` use "structured bindings" to
  give names to the pieces that make up a specification-part.
- Enhance `parser::Unwrap` to unwrap `Statement` and `UnlabeledStatement`
  and make use of that in PreSpecificationConstruct.

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

3 years ago[NFC][InstCombine] Multi-level aggregate test for phi-of-insertvalue pattern
Roman Lebedev [Mon, 24 Aug 2020 19:39:03 +0000 (22:39 +0300)]
[NFC][InstCombine] Multi-level aggregate test for phi-of-insertvalue pattern

See https://reviews.llvm.org/D86306

3 years ago[NFC][InstCombine] Adjust naming for some methods to match coding standards
Roman Lebedev [Mon, 24 Aug 2020 19:33:58 +0000 (22:33 +0300)]
[NFC][InstCombine] Adjust naming for some methods to match coding standards

Requested as preparatory cleanup in https://reviews.llvm.org/D86306#inline-799065

3 years ago[PowerPC] Extend custom lower of vector truncate to handle wider input
Roland Froese [Mon, 24 Aug 2020 19:30:04 +0000 (15:30 -0400)]
[PowerPC] Extend custom lower of vector truncate to handle wider input

Current custom lowering of truncate vector handles a source of up to 128 bits, but that only uses one of the two shuffle vector operands. Extend it to use both operands to handle 256 bit sources.

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

3 years ago[mlir] Add Index Type, Floating Point Type and None Type subclasses to python bindings.
zhanghb97 [Mon, 24 Aug 2020 18:54:38 +0000 (18:54 +0000)]
[mlir] Add Index Type, Floating Point Type and None Type subclasses to python bindings.

Based on the PyType and PyConcreteType classes, this patch implements the bindings of Index Type, Floating Point Type and None Type subclasses.
These three subclasses share the same binding strategy:
- The function pointer `isaFunction` points to `mlirTypeIsA***`.
- The `mlir***TypeGet` C API is bound with the `***Type` constructor in the python side.

Reviewed By: stellaraccident

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

3 years agoAdd hashing of the .text section to ProcessMinidump.
Greg Clayton [Mon, 10 Aug 2020 22:07:47 +0000 (15:07 -0700)]
Add hashing of the .text section to ProcessMinidump.

Breakpad will always have a UUID for binaries when it creates minidump files. If an ELF files has a GNU build ID, it will use that. If it doesn't, it will create one by hashing up to the first 4096 bytes of the .text section. LLDB was not able to load these binaries even when we had the right binary because the UUID didn't match. LLDB will use the GNU build ID first as the main UUID for a binary and fallback onto a 8 byte CRC if a binary doesn't have one. With this fix, we will check for the Breakpad hash or the Facebook hash (a modified version of the breakpad hash that collides a bit less) and accept binaries when these hashes match.

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

3 years agoRevert D85812 "[coroutine] should disable inline before calling coro split"
Fangrui Song [Mon, 24 Aug 2020 18:37:18 +0000 (11:37 -0700)]
Revert D85812 "[coroutine] should disable inline before calling coro split"

This reverts commit 2e43acfed89b1903de473f682c65878bdebc395a.

LLVMCoroutines (the library which contains Coroutines.h) depends on LLVMipo (the
library which contains SampleProfile.cpp). It is inappropriate for
SampleProfile.cpp to depent on Coroutines.h (circular dependency).

The test inverted dependencies as well:
llvm/test/Transforms/Coroutines/coro-inline.ll uses -sample-profile.

3 years agoAMDGPU: Add flag to disable promotion of uniform i16 ops
Matt Arsenault [Fri, 31 Jul 2020 18:50:39 +0000 (14:50 -0400)]
AMDGPU: Add flag to disable promotion of uniform i16 ops

This interferes with GlobalISel's much better handling of the
situation.

This should really be disable for GlobalISel. However, the fallback
only re-runs the selection passes, and doesn't go back and rerun any
codegen IR passes. I haven't come up with a good solution to this
problem.

3 years ago[TSan][Darwin] Handle NULL argument in interceptor
Julian Lettner [Mon, 24 Aug 2020 18:30:58 +0000 (11:30 -0700)]
[TSan][Darwin] Handle NULL argument in interceptor

Handle NULL address argument in the `mach_vm_[de]allocate()`
interceptors and fix test: `Assignment 2` is not valid if we weren't
able to re-allocate memory.

rdar://67680613

3 years ago[AMDGPU, docs] Fix typos
vnalamot [Mon, 24 Aug 2020 18:25:34 +0000 (23:55 +0530)]
[AMDGPU, docs] Fix typos

Reviewed By: t-tye, Flakebi

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

3 years ago[flang][openacc] Fix reduction operator parsing/unparsing
Valentin Clement [Mon, 24 Aug 2020 18:22:34 +0000 (14:22 -0400)]
[flang][openacc] Fix reduction operator parsing/unparsing

Update the way reduction operator are defined for the OpenACC parser.

Reviewed By: klausler

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

3 years ago[lldb] type category name common completion
Gongyu Deng [Mon, 24 Aug 2020 16:58:17 +0000 (18:58 +0200)]
[lldb] type category name common completion

1. Added a new common completion TypeCategoryNames to provide a list of category names for completion;
2. Applied the completion to these commands: type category delete/enable/disable/list/define;
3. Added a related test case;
4. Bound the completion to the arguments of the type 'eArgTypeName'.

Reviewed By: teemperor, JDevlieghere

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

3 years agoTableGen/GlobalISel: Allow inst matcher to check multiple opcodes
Matt Arsenault [Sun, 2 Aug 2020 18:52:20 +0000 (14:52 -0400)]
TableGen/GlobalISel: Allow inst matcher to check multiple opcodes

This is to initially handleg immAllOnesV, which should match
G_BUILD_VECTOR or G_BUILD_VECTOR_TRUNC. In the future, it could be
used for other patterns cases that map to multiple G_* instructions,
such as G_ADD and G_PTR_ADD.

3 years ago[LegalizeTypes][X86] Add ROTL/ROTR to WidenVectorResult.
Craig Topper [Mon, 24 Aug 2020 17:06:07 +0000 (10:06 -0700)]
[LegalizeTypes][X86] Add ROTL/ROTR to WidenVectorResult.

We can widen these just like any other binary operation.

Added test cases for v2i32 for X86 for coverage.

Fixes failures seen after D77152.