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

195562 Commits

Author SHA1 Message Date
Juneyoung Lee
c23e92dedc RFC: [ValueTracking] Let analyses assume a value cannot be partially poison
Summary:
This is RFC for fixes in poison-related functions of ValueTracking.
These functions assume that a value can be poison bitwisely, but the semantics
of bitwise poison is not clear at the moment.
Allowing a value to have bitwise poison adds complexity to reasoning about
correctness of optimizations.

This patch makes the analysis functions simply assume that a value is
either fully poison or not, which has been used to understand the correctness
of a few previous optimizations.
The bitwise poison semantics seems to be only used by these functions as well.

In terms of implementation, using value-wise poison concept makes existing
functions do more precise analysis, which is what this patch contains.

Reviewers: spatel, lebedev.ri, jdoerfert, reames, nikic, nlopes, regehr

Reviewed By: nikic

Subscribers: fhahn, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78503
2020-04-23 07:57:12 +09:00
Alexander Shaposhnikov
1827f4c151 [llvm-objcopy][MachO] Fix n_sect field
This tiny change is a follow-up to the previous commit f34fdbcf996a
where the update of n_sect was missing.

Test plan: make check-all
2020-04-22 15:44:03 -07:00
Stephen Neuendorffer
45eadc83d9 [CMAKE] Provide default location for llvm-lit for out-of-tree users.
Several external build users contain some heuristics for finding llvm-lit.
There are several cases we need to worry about:
- External builds against a build tree (with LLVM_BUILD_UTILS)
- External builds against an install tree (with LLMV_BUILD_UTIL
  and LLVM_INSTALL_UTILS)
- External builds against some location which doesn't have an
  llvm-lit, but llvm-lit is available through some other means, such
  as an available source tree, or a packager provided llvm-lit.

For the third case, LLVM_EXTERNAL_LIT suffices, but in other cases
there's no standard way to find llvm-lit.  It seems like each user
cooks their own heuristics:

- clang tries to look in the LLVM source tree, and failing that falls
  back to looking for a packaged llvm-lit.
- libcxx tries to look in the LLVM source tree, which might come from
  llvm-config or be explicitly specified.

This patch is a first stop to solving this by providing a default location
for llvm-lit using LLVM_DEFAULT_EXTERNAL_LIT.  The expectation is that
future patches can clean up users like clang and libcxx to rely
on this mechanism for out-of-tree builds.

Differential Revision: https://reviews.llvm.org/D77110
2020-04-22 15:13:23 -07:00
Sergej Jaskiewicz
f9b2e0fd91 [TimeProfiler] Emit clock synchronization point
Time profiler emits relative timestamps for events (the number of
microseconds passed since the start of the current process).

This patch allows combining events from different processes while
preserving their relative timing by emitting a new attribute
"beginningOfTime". This attribute contains the system time that
corresponds to the zero timestamp of the time profiler.

This has at least two use cases:

- Build systems can use this to merge time traces from multiple compiler
  invocations and generate statistics for the whole build. Tools like
  ClangBuildAnalyzer could also leverage this feature.

- Compilers that use LLVM as their backend by invoking llc/opt in
  a child process. If such a compiler supports generating time traces
  of its own events, it could merge those events with LLVM-specific
  events received from llc/opt, and produce a more complete time trace.

A proof-of-concept script that merges multiple logs that
contain a synchronization point into one log:
https://github.com/broadwaylamb/merge_trace_events

Differential Revision: https://reviews.llvm.org/D78030
2020-04-23 01:09:31 +03:00
Alexander Shaposhnikov
3158d1df4d [llvm-objcopy][MachO] Make --remove-section clean up dead symbols
Make --remove-section clean up dead symbols, return an Error if it can't be safely done.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D78474
2020-04-22 14:26:42 -07:00
Eli Friedman
84e25b0c20 [MachineOutliner] Teach outliner to set live-ins
Preserving liveness can be useful even late in the pipeline, if we're
doing substantial optimization work afterwards. (See, for example,
D76065.) Teach MachineOutliner how to correctly set live-ins on the
basic block in outlined functions.

Differential Revision: https://reviews.llvm.org/D78605
2020-04-22 14:19:26 -07:00
Lang Hames
4713d7a998 [JITLink] Fix edge removal iterator invalidation.
This patch changes Block::removeEdge to return a valid iterator to the new next
element, and uses this to update the edge removal algorithm in
LinkGraph::splitBlock.
2020-04-22 14:16:46 -07:00
Lang Hames
2ccfae6930 [JITLink] Read MachO Header CPU field only in jitLink_MachO.
It's the only field we need in this function.
2020-04-22 14:16:46 -07:00
Sergej Jaskiewicz
87434205b4 [TimeProfiler] Emit real process ID and thread names
Differential Revision: https://reviews.llvm.org/D78027
2020-04-23 00:12:51 +03:00
Florian Hahn
f89745b6c1 [SCCP] Drop unnecessary early exit for ExtractValueInst.
visitExtractValueInst uses mergeInValue, so it already can handle
constant ranges. Initially the early exit was using isOverdefined to
keep things as NFC during the initial move to ValueLatticeElement.
As the function already supports constant ranges, it can just use
ValueState[&I].isOverdefined.

Reviewers: efriedma, mssimpso, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78393
2020-04-22 22:07:59 +01:00
Victor Huang
07c3ce4d03 [PowerPC][Future] Initial support for PCRel addressing to get block address
Add initial support for PCRelative addressing to get block address
instead of using TOC.

Differential Revision: https://reviews.llvm.org/D76294
2020-04-22 15:01:29 -05:00
Jon Roelofs
7f465f9c3f [docs] Fix :option: links 2020-04-22 14:00:30 -06:00
Craig Topper
16d452e561 [CallSite removal][ValueTracking] Use CallBase instead of ImmutableCallSite for getIntrinsicForCallSite. NFC
Differential Revision: https://reviews.llvm.org/D78613
2020-04-22 12:06:58 -07:00
Puyan Lotfi
8ae69a89d6 [llvm][MIRVRegNamer] Avoid collisions across jump table indices.
Hash Jump Table Indices uniquely within a basic block for MIR
Canonicalizer / MIR VReg Renamer passes.

Differential Revision: https://reviews.llvm.org/D77966
2020-04-22 14:58:44 -04:00
Jon Roelofs
1174953e01 [docs] Document lit's --timeout=N flag 2020-04-22 12:57:25 -06:00
Alexander Shaposhnikov
b5506fb989 [ObjectYAML][MachO] Add support for relocations
Add support for relocations for MachO to ObjectYAML / yaml2obj / obj2yaml.

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D77844
2020-04-22 11:50:55 -07:00
Simon Pilgrim
75d2b100b0 [Lanai] Remove unused forward declarations. NFC. 2020-04-22 18:26:50 +01:00
Simon Pilgrim
50ff948f8f [Hexagon] Remove unused forward declarations. NFC. 2020-04-22 18:26:50 +01:00
Simon Pilgrim
0a1d7f23ff [AVR] Remove unused forward declarations. NFC. 2020-04-22 18:26:50 +01:00
Simon Pilgrim
531c0d116e BPFMCTargetDesc.h - remove unused raw_ostream forward declaration. NFC. 2020-04-22 18:26:50 +01:00
Mikhail Maltsev
303b9c0331 [Docs] Fixed formatting in release notes, NFC 2020-04-22 18:25:22 +01:00
David Green
6e28c84a3a [ARM] Replace arm vendor with none. NFC 2020-04-22 18:19:35 +01:00
Victor Huang
a28ed79957 [PowerPC][Future] Remove redundant r2 save and restore for indirect call
Currently an indirect call produces the following sequence on PCRelative mode:

extern void function( );
extern void (*ptrfunc) ( );

void g() {
    ptrfunc=function;
}

void f() {
    (*ptrfunc) ( );
}

Producing

paddi 3, 0, .LC0@PCREL, 1
ld 3, 0(3)
std 2, 24(1)
ld 12, 0(3)
mtctr 12
bctrl
ld 2, 24(1)

Though the caller does not use or preserve r2, it is still saved and restored
across a function call. This patch is added to remove these redundant save and
restores for indirect calls.

Differential Revision: https://reviews.llvm.org/D77749
2020-04-22 12:05:51 -05:00
Benjamin Kramer
337f501407 Update go bindings for 2dea3f129878e929e5d1f00b91a622eb1ec8be4e 2020-04-22 19:02:59 +02:00
Benjamin Kramer
7a0b21ccae [Hexagon] Silence warning
llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp:296:11: warning: enumeration value 'ScalableVectorTyID' not handled in switch [-Wswitch]
  switch (Ty->getTypeID()) {
          ^
2020-04-22 18:57:08 +02:00
Johannes Doerfert
431b9991f6 [OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush
This was reported as PR45635, committed first as
72a9e7c926f4e32f209e528ec407fe526da5587e, reverted by
188f5cde9635a29a3f20ee2a73abd02890a752c7, and now recommitted with the
test change.
2020-04-22 11:10:54 -05:00
Christopher Tetreault
7f0438624e [SVE] Add new VectorType subclasses
Summary:
Introduce new types for fixed width and scalable vectors.

Does not remove getNumElements yet so as to not break code during transition
period.

Reviewers: deadalnix, efriedma, sdesmalen, craig.topper, huntergr

Reviewed By: sdesmalen

Subscribers: jholewinski, arsenm, jvesely, nhaehnle, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, liufengdb, kerbowa, Joonsoo, grosul1, frgossen, lldb-commits, tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm, #lldb

Differential Revision: https://reviews.llvm.org/D77587
2020-04-22 08:59:01 -07:00
Mark Murray
5e27e52ade [ARM][MC][Thumb] Recommit: Revert relocation for some pc-relative fixups.
Summary:
This commit recommits the reversion of https://reviews.llvm.org/D75039.

Concensus appears to be in favour of assembly-time resolution of
these ADR and LDR relocations, in line with GNU. The previous
backout broke many lld tests, now fixed by Peter Smith in
61bccda9d9d920c72f49025f11e8601daeb096ec.

Reviewers: psmith

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78301
2020-04-22 16:54:26 +01:00
Victor Huang
bce0cee8ed [PowerPC][Future] Initial support for PCRel addressing for jump tables.
Add initial support for PC Relative addressing to get jump table base
address instead of using TOC.

Differential Revision: https://reviews.llvm.org/D75931
2020-04-22 10:45:01 -05:00
Mircea Trofin
074e52bc80 [llvm][NFC][CallSite] Remove CallSite from a few trivial locations
Summary: Implementation details and internal (to module) APIs.

Reviewers: craig.topper, dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78610
2020-04-22 08:39:21 -07:00
Johannes Doerfert
8258e60cba Revert "[OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush"
Forgot to include test changes :(

This reverts commit 72a9e7c926f4e32f209e528ec407fe526da5587e.
2020-04-22 10:36:54 -05:00
Mikhail Maltsev
fb3ce802a6 [ARM] Release notes for the Custom Datapath Extension (CDE)
Summary:
This change mentions CDE assembly in the LLVM release notes and CDE
intrinsics in both Clang and LLVM release notes.

Reviewers: kristof.beyls, simon_tatham

Reviewed By: kristof.beyls

Subscribers: danielkiss, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D78481
2020-04-22 16:34:19 +01:00
Dmitry Vyukov
9871810df0 [TSAN] Add optional support for distinguishing volatiles
Add support to optionally emit different instrumentation for accesses to
volatile variables. While the default TSAN runtime likely will never
require this feature, other runtimes for different environments that
have subtly different memory models or assumptions may require
distinguishing volatiles.

One such environment are OS kernels, where volatile is still used in
various places for various reasons, and often declare volatile to be
"safe enough" even in multi-threaded contexts. One such example is the
Linux kernel, which implements various synchronization primitives using
volatile (READ_ONCE(), WRITE_ONCE()). Here the Kernel Concurrency
Sanitizer (KCSAN) [1], is a runtime that uses TSAN instrumentation but
otherwise implements a very different approach to race detection from
TSAN.

While in the Linux kernel it is generally discouraged to use volatiles
explicitly, the topic will likely come up again, and we will eventually
need to distinguish volatile accesses [2]. The other use-case is
ignoring data races on specially marked variables in the kernel, for
example bit-flags (here we may hide 'volatile' behind a different name
such as 'no_data_race').

[1] https://github.com/google/ktsan/wiki/KCSAN
[2] https://lkml.kernel.org/r/CANpmjNOfXNE-Zh3MNP=-gmnhvKbsfUfTtWkyg_=VqTxS4nnptQ@mail.gmail.com

Author: melver (Marco Elver)
Reviewed-in: https://reviews.llvm.org/D78554
2020-04-22 17:27:09 +02:00
Johannes Doerfert
ce928ca9f5 [OpenMP][FIX] Do not use InaccessibleMemOrArgMemOnly for barrier and flush
This was reported as PR45635.
2020-04-22 10:18:46 -05:00
Haojian Wu
562fbcc0f4 Fix -Wunused-variable error. 2020-04-22 17:17:41 +02:00
Louis Dionne
69bd69a351 [CMake] Add a warning message to prepare the upcoming upgrade to CMake 3.13.4
As discussed in http://lists.llvm.org/pipermail/llvm-dev/2020-March/140349.html,
the minimum version of CMake required to build LLVM will be upgraded to
3.13.4 right after we create the release branch for LLVM 11.0.0.

As part of this effort, this commit adds a warning to give a heads up
to folks regarding the upcoming upgrade. This should allow users to
upgrade their CMake in advance so that the upgrade can sail right
through when the time comes.

Differential Revision: https://reviews.llvm.org/D77740
2020-04-22 11:07:43 -04:00
Roman Lebedev
2bfe7ae375 [NFC][InstCombine] Tests for negation of sign-/zero- extensions
* sext of non-positive can be negated.
* zext of non-negative can be negated.
2020-04-22 17:37:42 +03:00
Simon Pilgrim
ddd19cae7c [BPF] Remove unused forward declarations. NFC. 2020-04-22 15:07:18 +01:00
Simon Pilgrim
2557339c25 BranchFolding.h - remove unused raw_ostream forward declaration. NFC. 2020-04-22 15:07:18 +01:00
Simon Pilgrim
b83ec4f3c2 RecordStreamer.h - cleanup includes and forward declarations. NFC.
Reduce MCSymbol.h include to forward declaration.
Remove unused GlobalValue foward declaration.
2020-04-22 15:07:18 +01:00
Simon Pilgrim
46fa565705 RuntimeDyldImpl.h - remove unused Twine forward declaration. NFC. 2020-04-22 15:07:17 +01:00
Sander de Smalen
01a845ae31 [NFC] Fix unused result of dyn_cast<VectorType> in non-assert build 2020-04-22 14:57:28 +01:00
jasonliu
d6af2bbecf [llvm-objdump][XCOFF] Print more symbol info in relocation
Summary:
Print more symbol info in relocation printing when
--symbol-description is specified.

Differential Revision: https://reviews.llvm.org/D78499
2020-04-22 13:52:08 +00:00
John Brawn
01d2bbce45 [ARM] Don't shrink STM if it would cause an unknown base register store
If a 16-bit thumb STM with writeback stores the base register but it isn't the
first register in the list, then an unknown value is stored. The load/store
optimizer knows this and generates a 32-bit STM without writeback instead, but
thumb2 size reduction converts it into a 16-bit STM. Fix this by having thumb2
size reduction notice such STMs and leave them as they are.

Differential Revision: https://reviews.llvm.org/D78493
2020-04-22 14:50:42 +01:00
Jay Foad
defe519887 [AMDGPU] Fix test failures caused by dbdffe3ee9d. 2020-04-22 14:19:21 +01:00
David Green
2d4a711a67 [ARM] Distribute MVE post-increments
This adds some extra processing into the Pre-RA ARM load/store optimizer
to detect and merge MVE loads/stores and adds of the same base. This we
don't always turn into a post-inc during ISel, and due to the nature of
it being a graph we don't always know an order to use for the nodes, not
knowing which nodes to make post-inc and which to use the new post-inc
of. After ISel, we have an order that we can use to post-inc the
following instructions.

So this looks for a loads/store with a starting offset of 0, and an
add/sub from the same base, plus a number of other loads/stores. We then
do some checks and convert the zero offset load/store into a postinc
variant. Any loads/stores after it have the offset subtracted from their
immediates.  For example:
  LDR #4           LDR #4
  LDR #0           LDR_POSTINC #16
  LDR #8           LDR #-8
  LDR #12          LDR #-4
  ADD #16
It only handles MVE loads/stores at the moment. Normal loads/store will
be added in a followup patch, they just have some extra details to
ensure that we keep generating LDRD/LDM successfully.

Differential Revision: https://reviews.llvm.org/D77813
2020-04-22 14:16:51 +01:00
Pavel Iliin
3003b7b6ab [AArch64][FIX] f16 indexed patterns encoding restrictions. 2020-04-22 14:11:28 +01:00
Simon Pilgrim
869cef2c82 [AsmPrinter] Remove unused forward declarations. NFC. 2020-04-22 14:01:52 +01:00
Simon Pilgrim
ae8d7464e2 MetadataLoader.h - remove unused MDNode forward declaration. NFC. 2020-04-22 14:01:52 +01:00
Simon Pilgrim
f079f94f97 [AsmParser] Remove unused forward declarations. NFC. 2020-04-22 14:01:51 +01:00