1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

195128 Commits

Author SHA1 Message Date
Sergej Jaskiewicz
430e5ccef4 Introduce llvm::sys::Process::getProcessId() and adopt it
Differential Revision: https://reviews.llvm.org/D78022
2020-04-16 15:05:37 +03:00
Georgii Rymar
ced5ee12e6 [FileCheck] - Fix the false positive when -implicit-check-not is used with an unknown -check-prefix.
Imagine we have the following invocation:

`FileCheck -check-prefix=UNKNOWN-PREFIX -implicit-check-not=something`

When the check prefix does not exist it does not fail.
This patch fixes the issue.

Differential revision: https://reviews.llvm.org/D78024
2020-04-16 15:00:50 +03:00
Kirill Bobyrev
ce8df193da [clangd] Pull installed gRPC and introduce clangd-remote-(server|client)
Summary:
This patch allows using installed gRPC to build two simple tools which
currently provide the functionality of looking up the symbol by name.
remote-index-client is a simplified version of dexp which connects to
remote-index-server passes lookup requests.

I also significantly reduced the scope of this patch to prevent large changelist
and more bugs. The next steps would be:

* Extending Protocol for deep copies of Symbol and inherit RemoteIndex from
  Index to unify the interfaces
* Make remote-index-server more generic and merge the remote index client with
  dexp
* Modify Clangd to allow using remote index instead of the local one for all
  global index requests

Reviewers: sammccall

Reviewed By: sammccall

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77794
2020-04-16 13:55:08 +02:00
Konstantin Schwarz
9edce7f809 [MIR] Add comments to INLINEASM immediate flag MachineOperands
Summary:
The INLINEASM MIR instructions use immediate operands to encode the values of some operands.
The MachineInstr pretty printer function already handles those operands and prints human readable annotations instead of the immediates. This patch adds similar annotations to the output of the MIRPrinter, however uses the new MIROperandComment feature.

Reviewers: SjoerdMeijer, arsenm, efriedma

Reviewed By: arsenm

Subscribers: qcolombet, sdardis, jvesely, wdng, nhaehnle, hiraditya, jrtc27, atanasyan, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78088
2020-04-16 13:46:14 +02:00
Carl Ritson
3aeca434d7 [LiveIntervals] Replace handleMoveIntoBundle
Summary:
The current handleMoveIntoBundle implementation is unusable,
it attempts to access the slot indexes of bundled instructions.
It also leaves bundled instructions with slot indexes assigned.

Replace handleMoveIntoBundle this with a more explicit
handleMoveIntoNewBundle function which recalculates the live
intervals for all instructions moved into a newly formed bundle,
and removes slot indexes from these instructions.

Reviewers: arsenm, MaskRay, kariddi, tpr, qcolombet

Reviewed By: qcolombet

Subscribers: MatzeB, wdng, hiraditya, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77969
2020-04-16 19:58:19 +09:00
David Zarzycki
e8df66d65f Fix -Wdocumentation-html warning 2020-04-16 06:33:53 -04:00
Jeremy Morse
7af5cc5a22 [LiveDebugValues] Terminate open ranges on DBG_VALUE $noreg
In D68209, LiveDebugValues::transferDebugValue had a call to
OpenRanges.erase shifted, and by accident this led to a code path where
DBG_VALUEs of $noreg would not have their open range terminated, allowing
variable locations to extend past blocks where they were terminated.

This patch correctly terminates the open range, if present, when such a
DBG_VAUE is encountered, and adds a test for this behaviour.

Differential Revision: https://reviews.llvm.org/D78218
2020-04-16 10:26:47 +01:00
Johannes Doerfert
f857828ed0 [Attributor][NFC] Reduce indention for call site attribute seeding
Also added a TODO to remind us that indirect calls could be optimized as
well.
2020-04-16 02:32:31 -05:00
Johannes Doerfert
87507aa30d [Attributor][NFC] Do not create temporary maps during lookup
The AAMap.lookup() call created a temporary value if the key was not
present. Since the value was another map it was not free to create it.
Instead of a lookup we now use find and compare the result against the
end iterator explicitly. The result is the same but we never need to
create a temporary map.
2020-04-16 02:32:31 -05:00
Dominik Montada
7a4ea32a4b Revert "Revert "[GlobalISel] Fix invalid combine of unmerge(merge) with intermediate cast""
This reverts commit 1265899c5f7d34034a8c1f67e69a5ab6087310e7.
2020-04-16 09:30:34 +02:00
Craig Topper
d669b41d2c [CallSite removal][TargetLowering] Remove ArgListEntry::setAttributes signature that took an ImmutableCallSite. NFC
There's another signature that takes a CallBase. The uses of the
ImmutableCallSite version were removed in previous patches.
2020-04-16 00:07:59 -07:00
Matthias Gehre
2655761c21 [LifetimeAnalysis] Add [[gsl::Pointer]] to llvm::StringRef
Summary:
This detected the bugs fixed in
  https://reviews.llvm.org/D66442
and
  https://reviews.llvm.org/D66440

The warning itself was implemented in
  https://reviews.llvm.org/D63954
  https://reviews.llvm.org/D64256
  https://reviews.llvm.org/D65120
  https://reviews.llvm.org/D65127
  https://reviews.llvm.org/D66152

Reviewers: zturner, mehdi_amini, gribozavr

Subscribers: dexonsmith, Szelethus, xazax.hun, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D66443
2020-04-16 08:23:30 +02:00
Johannes Doerfert
5cd12eed5d [Attributor][FIX] Handle droppable uses when replacing values
Since we use the fact that some uses are droppable in the Attributor we
need to handle them explicitly when we replace uses. As an example, an
assumed dead value can have live droppable users. In those we cannot
replace the value simply by an undef. Instead, we either drop the uses
(via `dropDroppableUses`) or keep them as they are. In this patch we do
both, depending on the situation. For values that are dead but not
necessarily removed we keep droppable uses around because they contain
information we might be able to use later. For values that are removed
we drop droppable uses explicitly to avoid replacement with undef.
2020-04-16 00:56:08 -05:00
Johannes Doerfert
d25b5c4936 [InstCombine] Simplify calls with casted returned attribute
The handling of the `returned` attribute in D75815 did miss the case
where the argument is (bit)casted to a different type. This is
explicitly allowed by the language reference and exposed by the
Attributor.

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D77977
2020-04-16 00:56:00 -05:00
Johannes Doerfert
9e717a8ca7 [MustExecute][NFC] Copy function_ref instead of passing a reference 2020-04-16 00:55:34 -05:00
Johannes Doerfert
43bc83599e [Attributor][FIX] Properly check for accesses to globals
The check if globals were accessed was not always working because two
bits are set for NO_GLOBAL_MEM. The new check works also if only on kind
of globals (internal/external) is accessed.
2020-04-16 00:55:34 -05:00
Johannes Doerfert
94df1673c9 [Attributor][NFC] Run the verifier only on functions and under EXPENSIVE_CHECKS
Running the verifier is expensive so we want to avoid it even in runs
that enable assertions. As we move closer to enabling the Attributor
this code will be executed by some buildbots but not cause overhead for
most people.
2020-04-16 00:55:33 -05:00
Craig Topper
3454be975b [CallSite removal][TargetLibraryInfo] Replace ImmutableCallSite with CallBase in one of the getLibFunc signatures. NFC
Differential Revision: https://reviews.llvm.org/D78083
2020-04-15 22:43:41 -07:00
Mircea Trofin
2c2f3008dd [llvm][NFC][CallSite] Removed CallSite from some implementation details.
Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, jfb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78256
2020-04-15 22:27:05 -07:00
Shengchen Kan
84df69e0e6 [X86] Add interface X86II::isPseudo
Avoid duplicate code in X86MCCodeEmitter, NFCI.
2020-04-16 12:40:17 +08:00
Fangrui Song
7a1a2170b7 [MC][COFF][ELF] Reject instructions in IMAGE_SCN_CNT_UNINITIALIZED_DATA/SHT_NOBITS sections
For `.bss; nop`, MC inappropriately calls abort() (via report_fatal_error()) with a message
`cannot have fixups in virtual section!`
It is a bug to crash for invalid user input. Fix it by erroring out early in EmitInstToData().

Similarly, emitIntValue() in a virtual section (SHT_NOBITS in ELF) can crash with the mssage
`non-zero initializer found in section '.bss'` (see D4199)
It'd be nice to report the location but so many directives can call emitIntValue()
and it is difficult to track every location.
Note, COFF does not crash because MCAssembler::writeSectionData() is not
called for an IMAGE_SCN_CNT_UNINITIALIZED_DATA section.

Note, GNU as' arm64 backend reports ``Error: attempt to store non-zero value in section `.bss'``
for a non-zero .inst but fails to do so for other instructions.
We simply reject all instructions, even if the encoding is all zeros.

The Mach-O counterpart is D48517 (see `test/MC/MachO/zerofill-text.s`)

Reviewed By: rnk, skan

Differential Revision: https://reviews.llvm.org/D78138
2020-04-15 21:02:47 -07:00
Shengchen Kan
6d0a3a0081 [X86][MC][NFC] Code cleanup in X86MCCodeEmitter
Make some function static, move the definitions of functions to a better
place and use C++ style cast, etc.
2020-04-16 11:30:49 +08:00
Johannes Doerfert
19f2743c2d [Attributor] Lazily collect function information
Before, we eagerly analyzed all the functions to collect information
about them, e.g. what instructions may read/write memory. This had
multiple drawbacks:
  - In CGSCC-mode we can end up looking at a callee which is not in the
    SCC but for which we need an initialized cache.
  - We end up looking at functions that we deem dead and never need to
    analyze in the first place.
  - We have a implicit dependence which is easy to break.

This patch moves the function analysis into the information cache and
makes it lazy. There is no real functional change expected except due to
the first reason above.
2020-04-15 22:26:38 -05:00
Johannes Doerfert
7648c209da [Attributor] Replace call graph call sites after function replacement
The CallGraphUpdater allows to directly alter call site information and
we should do so. This might appease the windows buildbot that crashes
during the SCC traversal.
2020-04-15 22:24:09 -05:00
Shengchen Kan
29a623413f [X86][MC][NFC] Refine code in X86MCCodeEmitter
As we mentioned in D78180, merge some if clauses and use CamelCase for
variables, etc.
2020-04-16 10:43:42 +08:00
Johannes Doerfert
76d1dd6841 [Attributor] Remove large and seemingly useless test
This was supposed to be part of D76588 already.
2020-04-15 21:26:36 -05:00
Johannes Doerfert
2f5079bf19 [CallGraphUpdater][NFC] Minor updates to D77855
I uploaded the old version accidentally instead of the one with these
minor adjustments requested by the reviewers.

Differential Revision: https://reviews.llvm.org/D77855
2020-04-15 21:26:35 -05:00
Shengchen Kan
582612b7f2 [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part I)
Summary:
The function in X86MCCodeEmitter has too many parameters to make it look
messy, and some parameters are unnecessary. This is the first patch to
reduce their parameters.

The follwing operations are cheap
```
unsigned Opcode = MI.getOpcode();
const MCInstrDesc &Desc = MCII.get(Opcode);
uint64_t TSFlags = Desc.TSFlags;
```
So if we pass a `MCInst`, we don't need to pass `MCInstrDesc`;
if we pass a `MCInstrDesc`, we don't need to pass `TSFlags`.

Reviewers: craig.topper, MaskRay, pengfei

Reviewed By: craig.topper

Subscribers: annita.zhang, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78180
2020-04-16 09:53:45 +08:00
Fangrui Song
c42561a4e5 [MC] Replace MCSection*::getName() with MCSection::getName(). NFC
I plan to use MCSection::getName() in D78138. Having the function in the base class is also convenient for debugging.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D78251
2020-04-15 18:35:27 -07:00
Johannes Doerfert
00f7cba872 [Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.

Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }

Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.

Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.

An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.

Tests have been adjusted in the process but we tried to keep their
intend unchanged.

Reviewed By: sstefan1

Differential Revision: https://reviews.llvm.org/D76588
2020-04-15 19:59:51 -05:00
Richard Smith
2741804bdf Remove vptr dispatch from FoldingSet.
Summary:
Instead of storing a vptr in each FoldingSet instance, form an
equivalent struct and pass it implicitly from FoldingSet into the
various FoldingSetBase methods.

This has three benefits:
 * FoldingSet becomes one pointer smaller.
 * Under LTO, the "virtual" functions are much easier to inline.
 * The element type no longer needs to be complete when instantiating
   FoldingSet<T>, only when instantiating an insert / lookup member.

Reviewers: rnk

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78247
2020-04-15 17:39:35 -07:00
Alina Sbirlea
abe80c91f6 [Reassociate] Preserve AAManager and BasicAA analyses.
Now Reassociate Pass invalidates the analysis results of AAManager and BasicAA,
but it saves GlobalsAA, although it seems that it should preserve them, since
it affects only Unary and Binary operators.

Author: kpolushin (Kirill)

Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D77137
2020-04-15 16:58:03 -07:00
Fangrui Song
a2531f8d6e [MC] Rename MCSection*::getSectionName() to getName(). NFC
A pending change will merge MCSection*::getName() to MCSection::getName().
2020-04-15 16:48:14 -07:00
Johannes Doerfert
e17a443ac9 [CallGraphUpdater] Remove nodes from their SCC (old PM)
Summary:
We can and should remove deleted nodes from their respective SCCs. We
did not do this before and this was a potential problem even though I
couldn't locally trigger an issue. Since the `DeleteNode` would assert
if the node was not in the SCC, we know we only remove nodes from their
SCC and only once (when run on all the Attributor tests).

Reviewers: lebedev.ri, hfinkel, fhahn, probinson, wristow, loladiro, sstefan1, uenoku

Subscribers: hiraditya, bollu, uenoku, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77855
2020-04-15 18:38:50 -05:00
Johannes Doerfert
651f32e04d [CallGraphUpdater] Update the ExternalCallingNode for node replacements
Summary:
While it is uncommon that the ExternalCallingNode needs to be updated,
it can happen. It is uncommon because most functions listed as callees
have external linkage, modifying them is usually not allowed. That said,
there are also internal functions that have, or better had, their
"address taken" at construction time. We conservatively assume various
uses cause the address "to be taken". Furthermore, the user might have
become dead at some point. As a consequence, transformations, e.g., the
Attributor, might be able to replace a function that is listed
as callee of the ExternalCallingNode.

Since there is no function corresponding to the ExternalCallingNode, we
did just remove the node from the callee list if we replaced it (so
far). Now it would be preferable to replace it if needed and remove it
otherwise. However, removing the node has implications on the CGSCC
iteration. Locally, that caused some other nodes to be never visited
but it is for sure possible other (bad) side effects can occur. As it
seems conservatively safe to keep the new node in the callee list we
will do that for now.

Reviewers: lebedev.ri, hfinkel, fhahn, probinson, wristow, loladiro, sstefan1, uenoku

Subscribers: hiraditya, bollu, uenoku, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77854
2020-04-15 18:38:50 -05:00
Johannes Doerfert
46d3056c40 [CallGraphUpdater] Properly remove strongly connected components (oldPM)
Summary:
The old code did eliminate references from and to functions that were
about to be deleted only just before we deleted them. This can cause
references from other functions that are supposed to be deleted to still
exist, depending on the order. If the functions form a strongly
connected component the problem manifests regardless of the order in
which we try to actually delete the functions.

This patch introduces a two step deletion. First we remove all
references and then we delete the function. Note that this only affects
the old call graph. There should not be any functional changes if no old
style call graph was given.

To test this we delete two strongly connected functions instead of one
in an existing test.

Reviewers: hfinkel

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77975
2020-04-15 18:38:49 -05:00
Christopher Tetreault
8901ccbcf6 [SVE] Remove calls to getBitWidth from x86
Reviewers: efriedma, RKSimon, sdesmalen

Reviewed By: RKSimon

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77901
2020-04-15 15:48:48 -07:00
Craig Topper
8acbddd42f [CallSite removal][CallSiteSplitting] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78240
2020-04-15 15:38:02 -07:00
Craig Topper
88526434a7 [CallSite removal][CloneFunction] Use CallSite instead of CallBase. NFC
Differential Revision: https://reviews.llvm.org/D78236
2020-04-15 15:38:02 -07:00
Stanislav Mekhanoshin
c3d2b3efdc [AMDGPU] Fixed lane mask in test. NFC. 2020-04-15 15:26:53 -07:00
Michael Spencer
8faefa96c5 [LLVM][SupportTests] Ask the OS how large the page size is instead of guessing.
PPC64 had a larger than expected page size. Instead of guessing just
use the same API that `MemoryBuffer` does to determine the page size.
2020-04-15 15:12:28 -07:00
Chris Bowler
5100383a20 [AIX][PowerPC] Implement caller byval arguments in stack memory
Differential Revision: https://reviews.llvm.org/D77578
2020-04-15 17:57:31 -04:00
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