1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
Commit Graph

195286 Commits

Author SHA1 Message Date
Philip Reames
87b3d6e9c3 [PoisonChecking] Further clarify file scope comment, and update to match naming now used in code 2020-04-15 14:48:53 -07:00
Philip Reames
5b548b20b7 [NFC] Adjust style and clarify comments in PoisonChecking 2020-04-15 14:48:53 -07:00
Philip Reames
f4b08a7199 [NFC] Use new canCreatePoison to make code intent more clear in PoisonChecking 2020-04-15 14:48:53 -07:00
Michael Spencer
010e5caccc [LLVM][SupportTests] Fix Windows build breakage
`MemoryBuffer::getOpenFile` take an OS file handle, not an int.
2020-04-15 14:47:27 -07:00
Josh Stone
b83a8a6b70 [NFC] correct "thier" to "their" 2020-04-15 14:38:52 -07:00
Lang Hames
f8c93b5891 [docs] Fix an RST error introduced in e823068306e.
This should fix the 'Explicit markup ends without a blank line' error seen on
http://lab.llvm.org:8011/builders/llvm-sphinx-docs.

Thanks to Daniel Sanders for spotting this.
2020-04-15 14:37:58 -07:00
David Blaikie
f7e0caf8c6 PR45561: Return a literal string rather than an error string to avoid returning reference to local
Changing the underlying YAML support to allow returning a literal
string, rather than a StringRef, would probably be a bigger refactor so
I didn't do that.
2020-04-15 14:27:29 -07:00
Nico Weber
9b22d9cf53 Revert "[lit] Keep original cfg file case around."
This reverts commit bc3f54de1827e58655c34477d09211cbc42589bd.

The patch breaks in the following two scenarios:

1. When manually passing an absolute path to llvm-lit with a lower-case
   drive letter: `python bin\llvm-lit.py -sv c:\llvm-project\clang\test\PCH`

2. When the PWD has a lower-case drive letter, like after running
   `cd c:\` with a lower-case "c:" (cmd's default is upper-case, but
   it takes case-ness from what's passed to `cd` apparently).
2020-04-15 17:19:39 -04:00
Michael Spencer
86423aa8b7 [Clang] Expose RequiresNullTerminator in FileManager.
This is needed to fix the reason
0a2be46cfdb698fe (Modules: Invalidate out-of-date PCMs as they're
discovered) and 5b44a4b07fc1d ([modules] Do not cache invalid state for
modules that we attempted to load.) were reverted.

These patches changed Clang to use `isVolatile` when loading modules.
This had the side effect of not using mmap when loading modules, and
thus greatly increased memory usage.

The reason it wasn't using mmap is because `MemoryBuffer` plays some
games with file size when you request null termination, and it has to
disable these when `isVolatile` is set as the size may change by the
time it's mmapped. Clang by default passes
`RequiresNullTerminator = true`, and `shouldUseMmap` ignored if
`RequiresNullTerminator` was even requested.

This patch adds `RequiresNullTerminator` to the `FileManager` interface
so Clang can use it when loading modules, and changes `shouldUseMmap` to
only take volatility into account if `RequiresNullTerminator` is true.
This is fine as both `mmap` and a `read` loop are vulnerable to
modifying the file while reading, but are immune to the rename Clang
does when replacing a module file.

Differential Revision: https://reviews.llvm.org/D77772
2020-04-15 14:17:51 -07:00
Tony
e5640d8442 [AMDGPU] Move DWARF proposal to separate file
- Move DWARF proposal for heterogeneous debugging to a separate file.
- Add references.

Differential Revision: https://reviews.llvm.org/D70523
2020-04-15 17:19:39 -04:00
Roman Lebedev
625e46c7d0 [Attributor] KindToAbstractAttributeMap: use SmallDenseMap
Summary:
While this is less efficient to allocate huge `SmallDenseMap` for each `IRPosition` in `AAMap`,
in the larger picture this is much better, since we'd eventually either fill each `IRPosition`,
with each possible attribute, or at least quert for it, which would allocate it anyway.
So we are better off pre-allocating.

Old:
```
   0.3460 ( 40.7%)   0.0183 ( 33.9%)   0.3643 ( 40.3%)   0.3644 ( 40.3%)  Deduce and propagate attributes (CGSCC pass)
   0.1135 ( 13.4%)   0.0080 ( 14.7%)   0.1215 ( 13.4%)   0.1215 ( 13.4%)  Deduce and propagate attributes
```
```
total runtime: 19.48s.
bytes allocated in total (ignoring deallocations): 575.02MB (29.51MB/s)
calls to allocation functions: 908876 (46644/s)
temporary memory allocations: 276654 (14198/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 944.78MB
total memory leaked: 8.85MB
```
New:
```
   0.3223 ( 38.1%)   0.0299 ( 53.6%)   0.3522 ( 39.1%)   0.3522 ( 39.1%)  Deduce and propagate attributes (CGSCC pass)
   0.1150 ( 13.6%)   0.0037 (  6.7%)   0.1188 ( 13.2%)   0.1188 ( 13.2%)  Deduce and propagate attributes
```
```
total runtime: 19.06s.
bytes allocated in total (ignoring deallocations): 363.21MB (19.06MB/s)
calls to allocation functions: 679660 (35658/s)
temporary memory allocations: 83472 (4379/s)
peak heap memory consumption: 27.00MB
peak RSS (including heaptrack overhead): 931.66MB
total memory leaked: 8.85MB
```

Diff:
```
total runtime: -0.42s.
bytes allocated in total (ignoring deallocations): -211.81MB (498.38MB/s)
calls to allocation functions: -229216 (539331/s)
temporary memory allocations: -193182 (454545/s)
peak heap memory consumption: 321.54KB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

Reviewers: jdoerfert, sstefan1, uenoku

Reviewed By: jdoerfert

Subscribers: uenoku, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78231
2020-04-16 00:12:45 +03:00
Roman Lebedev
5e32be7f94 [MustExecute] checkForAllContext(): use pre-increment
Summary:
You'd think there is no difference, but this halves (yikes!) compiler memory usage
on `test-suite/MultiSource/Applications/SPASS/top.c` test,
because `MustBeExecutedIterator operator++()` is, well, post-increment,
it must create a duplicate of existing `MustBeExecutedIterator`,
which involves duplicating `VisitedSetTy Visited` which is `DenseSet`..

Old
```
   0.3573 ( 42.9%)   0.0264 ( 33.7%)   0.3837 ( 42.1%)   0.3837 ( 42.1%)  Deduce and propagate attributes (CGSCC pass)
   0.1011 ( 12.1%)   0.0199 ( 25.4%)   0.1210 ( 13.3%)   0.1210 ( 13.3%)  Deduce and propagate attributes
```
```
total runtime: 20.04s.
bytes allocated in total (ignoring deallocations): 1.09GB (54.63MB/s)
calls to allocation functions: 1142410 (57020/s)
temporary memory allocations: 500538 (24983/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 944.85MB
total memory leaked: 8.85MB
```
New:
```
   0.3309 ( 39.8%)   0.0164 ( 33.3%)   0.3473 ( 39.5%)   0.3473 ( 39.5%)  Deduce and propagate attributes (CGSCC pass)
   0.1152 ( 13.9%)   0.0076 ( 15.5%)   0.1229 ( 14.0%)   0.1229 ( 14.0%)  Deduce and propagate attributes
```
```
total runtime: 19.49s.
bytes allocated in total (ignoring deallocations): 575.07MB (29.51MB/s)
calls to allocation functions: 909059 (46651/s)
temporary memory allocations: 276923 (14211/s)
peak heap memory consumption: 26.68MB
peak RSS (including heaptrack overhead): 942.90MB
total memory leaked: 8.85MB
```
Diff:
```
total runtime: -0.55s.
bytes allocated in total (ignoring deallocations): -519.41MB (946.11MB/s)
calls to allocation functions: -233351 (425047/s)
temporary memory allocations: -223615 (407313/s)
peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B
```

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78225
2020-04-16 00:12:17 +03:00
Francesco Petrogalli
d5d9487fd4 [llvm][CodeGen] Rename SVE gather prefetch intrinsics. [NFC]
Summary:
The renaming is necessary to make the naming scheme uniform with other
gather/scatter load/stores SVE intrinsics.

The naming of variables and functions have been adapted to make it
explicit whether we are dealing with a scalar offset (which is
unscaled) or an index (which is scaled according to the data type of
the lanes of the vector).

Reviewers: andwar, sdesmalen, rengolin

Reviewed By: andwar

Subscribers: tschuett, hiraditya, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77839
2020-04-15 21:49:16 +01:00
Nemanja Ivanovic
455c82c016 [PowerPC] Clear the set of symbols that need to be updated in MCTargetStreamer
We have added code to correct the .localentry values on assignments. However, we
never clear the set so presumably it will still contain the (now dangling)
MCSymbol pointers across a call to finish() and reset() in the streamer.

This is based on my speculation that it is the reason we are getting
segmentation faults mentioned in https://bugs.llvm.org/show_bug.cgi?id=45366

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

Differential revision: https://reviews.llvm.org/D78196
2020-04-15 15:42:02 -05:00
Craig Topper
fe3c653173 [CallSite removal][SimpleLoopUnswitch] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78227
2020-04-15 13:25:02 -07:00
Eli Friedman
0fb2620d82 [SelectionDAG] Fix usage of Align constructing MachineMemOperands.
The "Align" passed into getMachineMemOperand etc. is the alignment of
the MachinePointerInfo, not the alignment of the memory operation.
(getAlign() on a MachineMemOperand automatically reduces the alignment
to account for this.)

We were passing on wrong (overconservative) alignment in a bunch of
places. Fix a bunch of these, mostly in legalization.  And while I'm
here, switch to the new Align APIs.

The test changes are all scheduling changes: the biggest effect of
preserving large alignments is that it improves alias analysis, so the
scheduler has more freedom.

(I was originally just trying to do a minor cleanup in
SelectionDAGBuilder, but I accidentally went deeper down the rabbit
hole.)

Differential Revision: https://reviews.llvm.org/D77687
2020-04-15 13:01:41 -07:00
Craig Topper
12288c5284 [CallSite removal][SampleProfile] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78219
2020-04-15 12:47:17 -07:00
Sam Clegg
bf755d5160 Enable finding bitcode in wasm objects
This commit fixes using functions in `IRObjectFile` to load bitcode from
wasm objects by recognizing the file magic for wasm and also inheriting
the default implementation of classifying sections as bitcode.

Patch By: alexcrichton

Differential Revision: https://reviews.llvm.org/D78199
2020-04-15 12:33:33 -07:00
Davide Italiano
0695f0b2a5 [LICM] Try to merge debug locations when sinking.
The current strategy LICM uses when sinking for debuginfo is
that of picking the debug location of one of the uses.
This causes stepping to be wrong sometimes, see, e.g. PR45523.

This patch introduces a generalization of getMergedLocation(),
that operates on a vector of locations instead of two, and try
to merge all them together, and use the new API in LICM.

<rdar://problem/61750950>
2020-04-15 12:29:34 -07:00
Pavel Iliin
f23f5a2e8a [AArch64][NFC]Autogenerated checks. 2020-04-15 20:25:00 +01:00
Craig Topper
0986b8f2e8 [X86] Make v32i16/v64i8 legal types without avx512bw. Use custom splitting instead.
This moves v32i16/v64i8 to a model consistent with how we
treat integer types with avx1.

This does change the ABI for types vXi16/vXi8 vectors larger than
512 bits to pass in multiple zmms instead of multiple ymms. We'd
already hacked some code to make v64i8/v32i16 pass in zmm.

Cost model is still a bit of a mess. In some place I tried to
match existing behavior. But really we need to account for
splitting and concating costs. Cost model for shuffles is
especially pessimistic.

Differential Revision: https://reviews.llvm.org/D76212
2020-04-15 12:17:18 -07:00
Matt Arsenault
b24a22e96d AMDGPU/GlobalISel: Work around a selector crash
Ideally types without a corresponding register class wouldn't reach
here, but we're currently missing some (in particular a 192-bit class
is missing).
2020-04-15 14:38:50 -04:00
Simon Pilgrim
97fe4de600 [X86] Add generic cpu target for the slow division tests
Baseline for any change due to D75567
2020-04-15 19:38:29 +01:00
Dimitry Andric
1d411a135e Use maximum compression when packaging release tarballs.
Summary:
Since a full run of test-release.sh takes many hours (at least on my
poor systems), we might as well spend some extra time compressing the
tarball, in return for a quite a bit of gains for uploading and
downloading it.

As an example, the 10.0.0-rc4 .tar.xz tarball shrinks from 465MiB to
306MiB, about 52% smaller.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76192
2020-04-15 20:30:26 +02:00
Dimitry Andric
9e9c1c96ad Turn off core dumps before starting the main body of test-release.sh.
Summary:
Some of the regression tests, such as those for the various sanitizers,
use huge shadow memory maps (showing up in top as 20 TiB).  If any of
those ever crashes, your test system's disk will be filled up until
everything falls over.  Set the ulimit for core dumps to 0 to prevent
this problem.

Reviewers: hans, tstellar, rovka

Reviewed By: hans

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76191
2020-04-15 20:29:40 +02:00
Jon Roelofs
bf24499733 Add FileCheck colons missed in D76210
https://reviews.llvm.org/D76210#inline-715185
2020-04-15 12:26:53 -06:00
Nico Weber
f6f261dabb [lit] Keep original cfg file case around.
There's been some back and forth if the cfg paths in the
config_map should be normcase()d. The argument for is that
it allows using all-lower spelling in cmd on Windows, the
argument against that doing so is lossy.

Before the relative-paths-in-generated-lit.site.cfg.py work,
there was no downside to calling normcase(), but with it
we need a hack to recover the original case.

This time, normcase() the hashtable key, but store the original
cased key in addition to the value. This fixes both cons, at the
cost of a few bytes more memory.

Differential Revision: https://reviews.llvm.org/D78169
2020-04-15 14:18:11 -04:00
Nico Weber
c806a41312 Remove an apparently unneeded normcase() call.
I believe this call is unneeded after https://reviews.llvm.org/D34855.

Reviewed as part of https://reviews.llvm.org/D78169
2020-04-15 14:02:48 -04:00
Nikita Popov
520d387350 [MC] Use subclass data for MCExpr to reduce memory usage
MCExpr has a bunch of free space that is currently going to waste.
Repurpose it as 24 bits of subclass data, which is enough to reduce
the size of all subclasses by 8 bytes. This gives us some respectable
savings for debuginfo builds. Here are the max-rss reductions for the
fat LTO link step:

    kc.link               238MiB   231MiB   (-2.82%)
    sqlite3.link          258MiB   250MiB   (-3.27%)
    consumer-typeset.link 152MiB   148MiB   (-2.51%)
    bullet.link           197MiB   192MiB   (-2.30%)
    tramp3d-v4.link       578MiB   567MiB   (-1.92%)
    pairlocalalign.link    92MiB    90MiB   (-1.98%)
    clamscan.link         230MiB   223MiB   (-2.81%)
    lencod.link           242MiB   235MiB   (-2.67%)
    SPASS.link            235MiB   230MiB   (-2.23%)
    7zip-benchmark.link   450MiB   435MiB   (-3.25%)

Differential Revision: https://reviews.llvm.org/D77939
2020-04-15 20:02:11 +02:00
Craig Topper
1bcc22a4c6 [X86] Various improvements to our vector splitting helpers for lowering. NFC
-Consistently name the functions as split*
-Add a helper for doing the two extractSubvector calls and determining the size of the split
-Use getSplitDestVTs to get the result type for the split node.
-Move the binary and unary helper to one place in the file near the extractSubvector functions. Left the VSETCC one near LowerVSETCC since that's its only caller.
-Remove the 256/512 wrappers that just had asserts. I don't think they provided a lot of value and now with the routines called split* the call sites are more obvious what they do.
-Make the unary routine support different source and dest types to support D76212.
-Add some weaker asserts into the helpers to make up for losing the very specific asserts from the 256/512 wrappers.

Differential Revision: https://reviews.llvm.org/D78176
2020-04-15 10:57:53 -07:00
Sterling Augustine
86c9b5e0f4 Write ignored output to stdout, so this test runs on read-only filesystems. 2020-04-15 10:45:14 -07:00
Amara Emerson
205e8e2e70 [GlobalISel] Enable artifact combiner to combine starting from a G_MERGE_VALUES.
We generally only combine starting from users to defs in the artifact combiner,
but this doesn't catch cases where at the point of combining a G_UNMERGE we don't
yet have the opposite G_MERGE on input yet since we haven't legalized that far.

This change adds the users of a G_MERGE to the artifact combiner worklist if one
of the uses is a G_UNMERGE or G_TRUNC.

Differential Revision: https://reviews.llvm.org/D77931
2020-04-15 10:34:13 -07:00
Craig Topper
5d3d057cd8 [CallSite removal][PruneEH] Use CallBase instead of CallSite. NFC
Reviewers: mtrofin, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78182
2020-04-15 10:11:41 -07:00
Dominik Montada
42741976cd Revert "[GlobalISel] Fix invalid combine of unmerge(merge) with intermediate cast"
This reverts commit bddac41b9f1ae80b56dace7d55cd81a07147ff3d.
2020-04-15 18:47:39 +02:00
Nico Weber
98c788f6d2 Remove a function that has been dead since r313889. 2020-04-15 12:02:30 -04:00
Dominik Montada
e5cf86f394 [GlobalISel] Fix invalid combine of unmerge(merge) with intermediate cast
Summary:
The combine for unmerge(cast(merge)) is only valid for vectors, but was
missing a corresponding check. Add a check that the operands are vectors
to avoid an invalid combine.

Without this check, the combiner would emit incorrect code for scalars
and pointers because the artifact cast (trunc/ext) only affects bits at
the end of the type, while this combine assumes that the casted bits
appear between meaningful bits.

This also uncovered a segmentation fault in the AMDGPU
InstructionSelector. The tests triggering this bug have been moved to
their own file and a check for the segmentation fault has been added.

Reviewers: arsenm, dsanders, aemerson, paquette, aditya_nandakumar

Reviewed By: arsenm

Subscribers: tpr, jvesely, wdng, nhaehnle, rovka, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78191
2020-04-15 17:19:14 +02:00
Fangrui Song
9a38a93235 [TimeProfiler] Fix some style issues. NFC
Reviewed By: broadwaylamb, russell.gallop

Differential Revision: https://reviews.llvm.org/D78153
2020-04-15 08:07:40 -07:00
Dominik Montada
8e95564f4c [GlobalISel] translate freeze to new generic G_FREEZE
Summary:
As a follow up to https://reviews.llvm.org/D29014, add translation
support for freeze.

Introduce a new generic instruction G_FREEZE and translate freeze to it.

Reviewers: dsanders, aqjune, arsenm, aditya_nandakumar, t.p.northover, lebedev.ri, paquette, aemerson

Reviewed By: aqjune, arsenm

Subscribers: fhahn, lebedev.ri, wdng, rovka, hiraditya, jfb, volkan, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77795
2020-04-15 16:47:05 +02:00
Florian Hahn
16ffe53637 [DSE,MSSA] Add use of alloca, to guard against removal in the future.
Currently the alloca does not escape and all stores and the memset can
be removed. Adding a use of the alloca ensures not all stores are
eliminated.
2020-04-15 15:23:43 +01:00
jasonliu
03f920bc4c [XCOFF][AIX] Relocation support for SymB
This patch intends to provide relocation support for the expression
 contains two unpaired relocatable terms with opposite signs.

Differential Revision: https://reviews.llvm.org/D77424
2020-04-15 14:03:54 +00:00
Xing Xue
6ee8b37671 [demangler] PPC and S390: Fix parsing of e-prefixed long double literals
Summary:
This patch is to fix the parsing of long double literals encoded with the e prefix on PowerPC and S390. For both PowerPC and S390, type code e is used for 64-bit long double literals and g is used for 128-bit long double literals. libcxxabi test case test_demangle.pass.cpp fails without the fix.

Authored by: xingxue-ibm

Reviewers: hubert.reinterpretcast, jasonliu, erik.pilkington, uweigand, mclow.li
sts, libc++abi

Reviewed by: hubert.reinterpretcast, erik.pilkington

Differential Revision: https://reviews.llvm.org/D74163
2020-04-15 09:59:06 -04:00
Georgii Rymar
ab58cadd23 [FileCheck] - Refine the comment. NFC.
It did not mention the `--implicit-check-not` before,
though it should (https://reviews.llvm.org/D78024#inline-715166).
2020-04-15 16:57:44 +03:00
Benjamin Kramer
d1c1542ac6 Unbreak the build 2020-04-15 15:54:47 +02:00
Benjamin Kramer
be750fb67e Pass shufflevector indices as int instead of unsigned.
No functionality change intended.
2020-04-15 15:52:49 +02:00
Victor Campos
6304beb986 [CodeGen][ARM] Error when writing to specific reserved registers in inline asm
Summary:
No error or warning is emitted when specific reserved registers are
written to in inline assembly. Therefore, writes to the program counter
or to the frame pointer, for instance, were permitted, which could have
led to undesirable behaviour.

Example:
  int foo() {
    register int a __asm__("r7"); // r7 = frame-pointer in M-class ARM
    __asm__ __volatile__("mov %0, r1" : "=r"(a) : : );
    return a;
  }

In contrast, GCC issues an error in the same scenario.

This patch detects writes to specific reserved registers in inline
assembly for ARM and emits an error in such case. The detection works
for output and input operands. Clobber operands are not handled here:
they are already covered at a later point in
AsmPrinter::emitInlineAsm(const MachineInstr *MI). The registers
covered are: program counter, frame pointer and base pointer.

This is ARM only. Therefore the implementation of other targets'
counterparts remain open to do.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76848
2020-04-15 14:40:42 +01:00
Sanjay Patel
c9c33476c5 [InstCombine] prevent infinite loop with sub/abs of constant expression
PR45539:
https://bugs.llvm.org/show_bug.cgi?id=45539
2020-04-15 09:19:16 -04:00
Matt Arsenault
a49e92880a AMDGPU/GlobalISel: Add some artifact combiner tests 2020-04-15 09:03:07 -04:00
Thomas Preud'homme
a8ced4e1db [FileCheck] Better diagnostic for format conflict
Summary:
Improve error message in case of conflict between several implicit
format to mention the operand that conflict.

Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnk

Reviewed By: jdenny

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77741
2020-04-15 13:46:45 +01:00
Simon Moll
3520d0a3e7 [nfc] clang-format TargetTransformInfo.cpp 2020-04-15 14:43:26 +02:00
Benjamin Kramer
7b9f6b2611 Upgrade users of 'new ShuffleVectorInst' to pass indices as an int array
No functionality change intended.
2020-04-15 14:29:43 +02:00