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

212571 Commits

Author SHA1 Message Date
Serguei Katkov
26844947fb [Statepoint Lowering] Fix the crash with gc.relocate in a separate block
If it was decided to relocate derived pointer using the spill its value is
not exported in general case.
When gc.relocate is located in an another block than a statepoint we cannot
get SD for derived value but for spill case it is not required at all.
However implementation of gc.relocate lowering unconditionally request SD value
causing the assert triggering.

The CL fixes this by handling spill case earlier than SD is really required.

Reviewers: reames, dantrushin
Reviewed By: dantrushin
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D98324
2021-03-10 19:51:04 +07:00
gbtozers
308759bb3b [DebugInfo] Process DBG_VALUE_LIST in LiveDebugVariables
This patch adds support for DBG_VALUE_LIST in the LiveDebugVariables pass. The
changes are mostly in computeIntervals, extendDef, and addDefsFromCopies; when
extending the def of a DBG_VALUE_LIST the live ranges of every used register
must be considered, and when such a def is killed by more than one of its used
registers being killed at the same time it is necessary to find valid copies of
all of those registers to create a new def with.

The DebugVariableValue class has also been changed to reference multiple
location numbers instead of just one. This has been accomplished by using a
C-style array with a unique_ptr and an array length packed into 6 bits, to
minimize the size of the class (which must be kept low to be used with
IntervalMap). This may not be the most efficient solution possible, and should
be looked at if performance issues arise.

Differential Revision: https://reviews.llvm.org/D83895
2021-03-10 12:37:59 +00:00
Alex Richardson
b4fdf05aa0 Avoid shuffle self-assignment in EXPENSIVE_CHECKS builds
Some versions of libstdc++ perform self-assignment in std::shuffle. This
breaks the EXPENSIVE_CHECKS builds of TableGen due to an incorrect assertion
in libstdc++.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85828.

Fixes https://llvm.org/PR37652

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D98167
2021-03-10 11:17:34 +00:00
Alex Richardson
6ae0a3f9c3 [SLC] Simplify strcpy and friends with non-zero address spaces
The current logic in TargetLibraryInfoImpl::getLibFunc() was only treating
strcpy, etc. with i8* arguments in address space zero as a valid library
function. However, in the CHERI and Morello targets we expect all libc
functions to use address space 200 arguments.

This commit updates isValidProtoForLibFunc() to check that the argument
is a pointer type. This also drops the check for i8* since we should not
be checking the pointee type any more.

Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D95142
2021-03-10 11:17:34 +00:00
Alex Richardson
7068939aae [SLC] Baseline test for missed strcpy optimizations in non-zero AS
This will be fixed in D95142

Differential Revision: https://reviews.llvm.org/D95138
2021-03-10 11:17:34 +00:00
Florian Hahn
9450d09863 [DSE] Handle memcpy/memset with equal non-const sizes.
Currently DSE misses cases where the size is a non-const IR value, even
if they match. For example, this means that llvm.memcpy/llvm.memset
calls are not eliminated, even if they write the same number of bytes.

This patch extends isOverwite to try to get IR values for the number of
bytes written from the analyzed instructions. If the values match,
alias checks are performed and the result is returned.

At the moment this only covers llvm.memcpy/llvm.memset. In the future,
we may enable MemoryLocation to also track variable sizes, but this
simple approach should allow us to cover the important cases in DSE.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D98284
2021-03-10 10:13:58 +00:00
Florian Hahn
cf11e8978e [DSE] Add tests with memset & memcpy combinations and non-const sizes. 2021-03-10 09:46:54 +00:00
Qiu Chaofan
0f7e170462 [NFC] [PowerPC] Remove unsafe-fp-math in some tests
As we're going to replace this ambiguous option with more precise
instruction-level fast-math description, some tests need to be updated
and the option doesn't play any role in some of them.
2021-03-10 17:27:21 +08:00
Juneyoung Lee
7228b5e6f4 [InstSimplify] Add tests for pr49495 (NFC) 2021-03-10 17:54:46 +09:00
Vladislav Vinogradov
7536c97c89 [ADT][NFC] Use size_t type for index in indexed_accessor_range
It makes it consistent with `size()` method return type and with
STL-like containers API.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D97921
2021-03-10 11:40:59 +03:00
Kirill Bobyrev
ae45d1cec4 [clangd] Enable reflection for clangd-index-server
This allows sending requests through CLI and more debugging
opportunities. Example:

```bash
$ grpc_cli ls localhost:50051
clang.clangd.remote.v1.SymbolIndex
grpc.reflection.v1alpha.ServerReflection
grpc.health.v1.Health
```
2021-03-10 09:07:39 +01:00
Qiu Chaofan
b78bd4345c [PowerPC] Reduce symmetrical swaps for lane-insensitive vector ops
This patch simplifies pattern (xxswap (vec-op (xxswap a) (xxswap b)))
into (vec-op a b) if vec-op is lane-insensitive. The motivating case
is ScalarToVector-VecOp-ExtractElement sequence on LE, but the
peephole itself is not related to endianness, so BE may also benefit
from this.

Reviewed By: nemanjai

Differential Revision: https://reviews.llvm.org/D97658
2021-03-10 15:21:32 +08:00
Lang Hames
f70507366d [JITLink] Add a null-terminator to eh-frame sections on ELF/x86-64.
__register_ehframes on Linux requires a null terminator to identify the end of
this section.
2021-03-09 22:16:11 -08:00
Wei Mi
d92d400972 [SampleFDO] Support enabling -funique-internal-linkage-name.
now -funique-internal-linkage-name flag is available, and we want to flip
it on by default since it is beneficial to have separate sample profiles
for different internal symbols with the same name. As a preparation, we
want to avoid regression caused by the flip.

When we flip -funique-internal-linkage-name on, the profile is collected
from binary built without -funique-internal-linkage-name so it has no uniq
suffix, but the IR in the optimized build contains the suffix. This kind of
mismatch may introduce transient regression.

To avoid such mismatch, we introduce a NameTable section flag indicating
whether there is any name in the profile containing uniq suffix. Compiler
will decide whether to keep uniq suffix during name canonicalization
depending on the NameTable section flag. The flag is only available for
extbinary format. For other formats, by default compiler will keep uniq
suffix so they will only experience transient regression when
-funique-internal-linkage-name is just flipped.

Another type of regression is caused by places where we miss to call
getCanonicalFnName. Those places are fixed.

Differential Revision: https://reviews.llvm.org/D96932
2021-03-09 21:41:40 -08:00
Yao Zhao
47a5a13f53 [xray] Fix xray document spelling
fix a couple of words spelling

Reviewed By: dberris

Differential Revision: https://reviews.llvm.org/D96658
2021-03-10 16:03:55 +11:00
Lang Hames
ca572d7727 [JITLink] Add support for STT_NOTYPE symbols to ELF/x86-64. 2021-03-09 20:40:24 -08:00
Lang Hames
5cb9edc2d8 [JITLink] Assert that segment mapping does not exceed allocation size. 2021-03-09 20:40:24 -08:00
Philip Reames
483fad77d7 [rs4gc] common bdv operand visitation [nfc] 2021-03-09 20:28:47 -08:00
Yang Fan
d5417396f4 [MC][ELF] Fix "enumeral and non-enumeral type in conditional expression" warning (NFC)
GCC warning:
```
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp: In member function ‘void {anonymous}::ELFWriter::writeHeader(const llvm::MCAssembler&)’:
/llvm-project/llvm/lib/MC/ELFObjectWriter.cpp:421:20: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
  420 |   W.OS << char(OSABI == ELF::ELFOSABI_NONE && OWriter.seenGnuAbi()
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  421 |                    ? ELF::ELFOSABI_GNU
      |                    ^~~~~~~~~~~~~~~~~~~
  422 |                    : OSABI);
      |                    ~~~~~~~
```
2021-03-10 11:27:15 +08:00
Philip Reames
7bfe628a33 [tests] add a few more tests for D98122 2021-03-09 19:18:22 -08:00
Arnold Schwaighofer
d007879c91 [coro async] Transfer the original function's attributes to the clone
rdar://75052917

Differential Revision: https://reviews.llvm.org/D98051
2021-03-09 17:01:41 -08:00
David Blaikie
78d56b1873 Remove unused variable (rolling it into an assert) 2021-03-09 16:06:44 -08:00
William S. Moses
1194a6394c [MemoryDependence] Fix invariant group store
Fix bug in MemoryDependence [and thus GVN] for invariant group.

Previously MemDep didn't verify that the store was storing into a
pointer rather than a store simply using a pointer.

Differential Revision: https://reviews.llvm.org/D98267
2021-03-09 19:03:39 -05:00
Leonard Chan
bf4eac0c1d [llvm] Change DSOLocalEquivalent type if the underlying global value type changes
We encountered an issue where LTO running on IR that used the DSOLocalEquivalent
constant would result in bad codegen. The underlying issue was ValueMapper wasn't
properly handling DSOLocalEquivalent, so this just adds the machinery for handling
it. This code path is triggered by a fix to DSOLocalEquivalent::handleOperandChangeImpl
where DSOLocalEquivalent could potentially not have the same type as its underlying GV.

This updates DSOLocalEquivalent::handleOperandChangeImpl to change the type if
the GV type changes and handles this constant in ValueMapper.

Differential Revision: https://reviews.llvm.org/D97978
2021-03-09 15:09:48 -08:00
Zequan Wu
801d7bdaee Revert "[llvm-cov] reset executation count to 0 after wrapped segment"
This reverts D85036

Differential Revision: https://reviews.llvm.org/D98084
2021-03-09 14:47:32 -08:00
Sanjay Patel
0693f65f6c [SLP] remove dead null check; NFC
We cast<> to Instruction (not dyn_cast<>), so we already
required/assumed that Cmp is not null.
2021-03-09 17:43:07 -05:00
Jianzhou Zhao
608bd2d3b1 [dfsan] Tracking origins at memory transfer
This is a part of https://reviews.llvm.org/D95835.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D98192
2021-03-09 22:15:07 +00:00
David Green
0f30d3a7e2 [ARM] Test for predicated scalar memops. NFC
This test shows a case where we can potentially scalarize the store in a
predicated loop, creating a lot of instructions that would be much
slower than scalar.
2021-03-09 21:57:18 +00:00
Philip Reames
cd8ba874a3 [tests] add tests to show effects of D98122 2021-03-09 13:54:15 -08:00
Dave Lee
e6ad3413ca [cmake] Enable -Werror=return-type
Turn `-Wreturn-type` into an error.

This is currently used by libcxx, libcxxabi, and libunwind, and would be a good default
for all of llvm. I'm not aware of any cases where this shouldn't be an error. This
ensures different build configs, merges, and downstream branches catch issues sooner.

Differential Revision: https://reviews.llvm.org/D98224
2021-03-09 13:51:09 -08:00
Albion Fung
b9ad035427 [P10] [Power PC] Exploiting new load rightmost vector element instructions.
This pull request implements patterns to exploit the load rightmost vector
element instructions for loading element 0 on little endian PowerPC subtargets
into v8i16 and v16i8 vector registers for i16 and i8 data types.

Differential Revision: https://reviews.llvm.org/D94816#inline-921403
2021-03-09 16:08:17 -05:00
Juneyoung Lee
0ac1e53c7e Revert "[InstCombine] Add simplification of two logical and/ors"
This reverts commit 07c3b97e184d5bd828b8a680cdce46e73f3db9fc due to a reported failure in two-stage build.
2021-03-10 05:48:31 +09:00
Philip Reames
722ae22297 [test] precommit tests from D98222 2021-03-09 12:39:47 -08:00
Philip Reames
54b4ece1ff [SCEV] Infer known bits from known sign bits
This was suggested by lebedev.ri over on D96534.  You'll note lack of tests.  During review, we weren't actually able to find a case which exercises it, but both I and lebedev.ri feel it's a reasonable change, straight forward, and near free.

Differential Revision: https://reviews.llvm.org/D97064
2021-03-09 12:37:17 -08:00
Florian Hahn
c4e8be9da1 [DSE] Add test cases with memory intrinsics and varying size values.
This patch adds a few tests for memset/memcyp with non-constant size
values. Some of the tests will be optimized in further patches.
2021-03-09 20:31:21 +00:00
Douglas Yung
5f54866a8c Add requirement for aarch64-registered-target to test change added in 42e3f97a9dd3a439f63a733c4ee909cba6b77e49. 2021-03-09 12:26:15 -08:00
George Balatsouras
96bb976c88 [dfsan] Update store.ll test
This removes hard-coded shadow width references and adds more RUN
lines to increase test coverage under different options (fast16 labels
mode).

Also, shortens the test by unifying common lines under both combine- and no-combine-ptr-label options.

Reviewed By: stephan.yichao.zhao

Differential Revision: https://reviews.llvm.org/D98227
2021-03-09 12:21:29 -08:00
Philip Reames
fedce4ad20 [cgp] improve robustness of uadd/usub transforms
LSR prefers to schedule iv increments just before the latch.  The recent 80511565 broadened this to moving increments in the original IR.  This pointed out a robustness problem with the CGP transform.

When we have a use of an induction increment outside of the loop (we canonicalize away from this form, but it happens e.g. unanalyzeable loops) we'd avoid performing the uadd/usub transform.  Interestingly, all of these involve moving the increment closer to it's operands, so there's no concern about dominating all uses.  We can handle that case cheaply, resulting in a more robust transform.
2021-03-09 11:52:08 -08:00
Philip Reames
72e71e056e [tests] precommit test for an upcoming change 2021-03-09 11:52:07 -08:00
Amara Emerson
bbe082f248 [AArch64][GlobalISel] Form G_DUPLANE32 for <2 x s32> shufflevectors in lowering.
For <2 x s32>, we can use G_DUPLANE32, but with a <4 x s32> source. To make it
work, we can just widen the original source with a concat_vectors.

Doing this allows <2 x float> indexed fmul instruction selection patterns to
fire, which gives a nice 0.3% code size saving on Bullet with -Os.

Differential Revision: https://reviews.llvm.org/D98059
2021-03-09 11:36:26 -08:00
Amara Emerson
ef0ba5e19d [GlobalISel] Fold away G_BUILD_VECTOR with all elements extracted.
If every element is extracted from a G_BUILD_VECTOR, pass through the source
registers. This is different to the extract(build_vector) combine because this
one tolerates multiple users as long as they're exhaustive.

Differential Revision: https://reviews.llvm.org/D97890
2021-03-09 11:34:26 -08:00
Philip Reames
794f535aaa [cgp] group related code together [nfc] 2021-03-09 11:23:15 -08:00
Amara Emerson
a3470733b1 [AArch64][GlobalISel] Add combine for extract_vector_elt(build_vector, cst)
Differential Revision: https://reviews.llvm.org/D97835
2021-03-09 11:08:02 -08:00
Jay Foad
75fd560edb [AMDGPU] Refactor AMDGPUTargetStreamer::EmitCodeEnd
Refactor and add comments to explain where the magic numbers come from
in terms of the instruction cache line size. NFC.

Differential Revision: https://reviews.llvm.org/D98266
2021-03-09 19:02:18 +00:00
gbtozers
0b8acbe1f0 [DebugInfo] Process DBG_VALUE_LIST in LiveDebugValues
This patch implements DBG_VALUE_LIST handling to the LiveDebugValues pass. This
is a substantial change, and makes a few fundamental changes to the existing
logic.

We still use the basic model of a VarLocMap that is indexed by a LocIndex, with
a VarLocSet (a CoalescingBitVector underneath) giving us efficient lookups of
existing variable locations for a given location type. The main change is that
the VarLocMap may contain a given VarLoc multiple times (once for each unique
location operand), so that a VarLoc can be looked up from any of the registers
that it uses. This means that each VarLoc has multiple corresponding LocIndexes;
to allow us to iterate through the set of VarLocs (previously we would iterate
through the VarLocSet), we now also maintain a single entry in the VarLocMap
that contains every VarLoc exactly once.

The VarLoc class itself is also changed; this change is much simpler,
refactoring out location-specific members into a MachineLocation class and
adding a vector of these locations.

Differential Revision: https://reviews.llvm.org/D83890
2021-03-09 18:58:26 +00:00
Markus Böck
5ca102f600 [Support][test] Unconditionally use setenv macro when compiling on Windows
This test currently fails to compile when using a MinGW toolchain as setenv is not defined. This function is a POSIX function Windows does not implement.

This patch enables the setenv macro used in the unit test for all of Windows, making the test compile and run successfully.

Differential Revision: https://reviews.llvm.org/D98271
2021-03-09 19:53:22 +01:00
Nikita Popov
d8092ee676 [cmake] Link socket/nsl on SunOS in llvm-jitlink
llvm-jitlink and llvm-jitlink-executor make use of APIs that are
part of the socket and nsl libraries on SunOS systems (Solaris and
Illumos). Make sure they get linked.

Ran into this in Rust CI when cross-compiling LLVM 12 to these
targets.

Differential Revision: https://reviews.llvm.org/D97633
2021-03-09 19:04:59 +01:00
Craig Topper
48f016a681 [RISCV] Add support for VECTOR_REVERSE for scalable vector types.
I've left mask registers to a future patch as we'll need
to convert them to full vectors, shuffle, and then truncate.

Reviewed By: frasercrmck

Differential Revision: https://reviews.llvm.org/D97609
2021-03-09 10:03:45 -08:00
Amara Emerson
f9107e0902 [AArch64][GlobalISel] Lower scalar G_{SMIN, SMAX, UMIN, UMAX}. 2021-03-09 10:03:16 -08:00
Fangrui Song
9bcdc90dd9 [MC] Change ELFOSABI_NONE to ELFOSABI_GNU for SHF_GNU_RETAIN
GNU ld does not give SHF_GNU_RETAIN GC root semantics for ELFOSABI_NONE.
(https://sourceware.org/pipermail/binutils/2021-March/115581.html)

This allows GNU ld to interpret SHF_GNU_RETAIN and avoids a gold quirk
https://sourceware.org/bugzilla/show_bug.cgi?id=27490

Because ELFObjectWriter is in an anonymous namespace, I have to place
`markGnuAbi` in the parent MCObjectWriter.

Differential Revision: https://reviews.llvm.org/D97976
2021-03-09 09:59:47 -08:00