1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

204560 Commits

Author SHA1 Message Date
Petr Hosek
f0e2e6062a [CMake] Don't use CMakePushCheckState
When we call cmake_pop_check_state, we undo any changes to REQUIRED
variables performed by HandleLLVMOptions which is undesirable. Rather
use replacement which is what we've used prior to 8d26760a.

Differential Revision: https://reviews.llvm.org/D88756
2020-10-02 17:13:34 -07:00
LLVM GN Syncbot
235ba6748a [gn build] Port ace644030e6 2020-10-02 23:59:59 +00:00
Arthur Eubanks
7b924b5661 [MetaRenamer][NewPM] Port metarenamer to NPM
Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D88690
2020-10-02 15:42:25 -07:00
Arthur Eubanks
0ff48c3948 [test][Coro][NewPM] Fix coro-elide.ll under NPM 2020-10-02 15:39:42 -07:00
Vitaly Buka
dd7abb8112 [NFC][MSAN] Extract llvm.abs handling into a function
Reviewed By: eugenis

Differential Revision: https://reviews.llvm.org/D88519
2020-10-02 15:01:25 -07:00
Krzysztof Parzyszek
3482300416 [Hexagon] Move selection of HVX multiply from lowering to patterns
Also, change i32*i32 to V6_vmpyieoh + V6_vmpyiewuh_acc, which works
on V60 as well.
2020-10-02 16:04:34 -05:00
Alexey Lapshin
30ff1827df [llvm-objcopy][NFC] refactor error handling. part 3.
Remove usages of special error reporting functions(error(),
reportError()). Errors are reported as Expected<>/Error returning
values. This part is for ELF subfolder of llvm-objcopy.

Testing: check-all.

Differential Revision: https://reviews.llvm.org/D87987
2020-10-02 23:55:05 +03:00
Nikita Popov
7c28a02e21 [MemCpyOpt] Add helper to erase instructions (NFC)
Next to erasing the instruction, we also always want to remove
it from MSSA and MD. Use a common function to do so.

This is a refactoring split out from D26739.
2020-10-02 21:52:10 +02:00
Nikita Popov
ce5df66011 [MemCpyOpt] Avoid double invalidation (NFCI)
The removal of the cpy instruction is left to the caller of
performCallSlotOptzn(), including the invalidation of MD. Both
call-sites already do this.

Also handle incrementation of NumMemCpyInstr consistently at the
call-site. One of the call-site was already doing this, which
ended up incrementing the statistic twice.

This fix was part of D26739.
2020-10-02 21:50:46 +02:00
Douglas Yung
8e7f29d213 Relax newly added opcode alias check to check only for a number instead of a specific opcode. 2020-10-02 12:18:56 -07:00
Fangrui Song
3f6a90dc9a [llc] Initialize TargetOptions after Triple is available
Some targets have different defaults. This patch defers initialization of `TargetOptions` so that a future patch can pass `TargetOptions` to `InitTargetOptionsFromCodeGenFlags`

Reviewed By: jasonliu

Differential Revision: https://reviews.llvm.org/D88748
2020-10-02 11:43:40 -07:00
Amara Emerson
a827dbae48 Update legalizer-info-validation.mir test to test all opcodes.
The test doesn't fail if we add opcodes to the end of the opcodes definition
list, so we were missing some.
2020-10-02 11:32:54 -07:00
Nikita Popov
ec91124460 [MemCpyOpt] Add tests from D40802 (NFC)
Even though that patch didn't stick, we should retain the test
coverage.
2020-10-02 20:28:38 +02:00
Arthur Eubanks
45cb3d9d33 [DAE] MarkLive in MarkValue(MaybeLive) if any use is live
While looping through all args or all return values, we may mark a use
of a later iteration as live. Previously when we got to that later value
it would ignore that and continue adding to Uses instead of marking it
live. For example, when looping through arg#0 and arg#1,
MarkValue(arg#0, Live) may cause some use of arg#1 to be live, but
MarkValue(arg#1, MaybeLive) will not notice that and continue adding
into Uses.

Now MarkValue(RA, MaybeLive) will MarkLive(RA) if any use is live.

Fixes PR47444.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D88529
2020-10-02 10:55:08 -07:00
Arthur Eubanks
f5b5e12c12 Reland [AlwaysInliner] Update BFI when inlining
Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88324
2020-10-02 10:46:57 -07:00
Arthur Eubanks
63659fb23e [gn build] Don't define CINDEX_EXPORTS
This causes
../../clang/include\clang-c/Platform.h(23,11): warning: 'CINDEX_EXPORTS' macro redefined [-Wmacro-redefined]
  #define CINDEX_EXPORTS
2020-10-02 10:39:49 -07:00
Arthur Eubanks
a9e66fc8ae Revert "[AlwaysInliner] Update BFI when inlining"
This reverts commit b1bf24667fc3ec5dc4b541148d0d722ffa28a6df.
2020-10-02 10:34:51 -07:00
Arthur Eubanks
c7e9e40f25 [AlwaysInliner] Update BFI when inlining
Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D88324
2020-10-02 10:26:34 -07:00
Simon Pilgrim
3bb9de009e Revert rG3d14a1e982ad27 - "[InstCombine] recognizeBSwapOrBitReverseIdiom - support for 'partial' bswap patterns (PR47191)"
This reverts commit 3d14a1e982ad27111346471564d575ad5efc6419.

This is breaking on some 2stage clang buildbots
2020-10-02 18:17:14 +01:00
Simon Pilgrim
2441c7530e [InstCombine] Add trunc(bswap(trunc/zext(x))) vector tests 2020-10-02 18:05:16 +01:00
Florian Hahn
268685e51a [VPlan] Use isa<> instead of directly checking VPRecipeID (NFC).
getVPRecipeID is intended to be only used in `classof` helpers. Instead
of checking it directly, use isa<> with the correct recipe type.
2020-10-02 17:47:35 +01:00
Nikita Popov
dbabc555fe [MemCpyOpt] Regnerate test checks (NFC) 2020-10-02 18:42:13 +02:00
Sanjay Patel
94a4949871 [CostModel] move default handling after switch; NFC
We will need to add intrinsics to the switch (such as
the ones that are currently in the switch above this
one) that deal with special cases and then break to
the default handling.
2020-10-02 12:26:49 -04:00
Stella Stamenova
08f43b87cf Revert "[WebAssembly] Emulate v128.const efficiently"
This reverts commit 542523a61a21c13e7f244bcf821b0fdeb8c6bb24.
2020-10-02 09:26:21 -07:00
Simon Pilgrim
ea1585a27a [InstCombine] recognizeBSwapOrBitReverseIdiom - support for 'partial' bswap patterns (PR47191)
If we're bswap'ing some bytes and zero'ing the remainder we can perform this as a bswap+mask which helps us match 'partial' bswaps as a first step towards folding into a more complex bswap pattern.

Differential Revision: https://reviews.llvm.org/D88578
2020-10-02 17:25:12 +01:00
Simon Pilgrim
27f9eda390 TruncInstCombine.cpp - fix header include ordering to fix llvm-include-order clang-tidy warning. NFCI. 2020-10-02 17:25:12 +01:00
Simon Pilgrim
b4f44537cd TruncInstCombine.cpp - use auto * to fix llvm-qualified-auto clang-tidy warning. NFCI. 2020-10-02 17:25:11 +01:00
Vinay Madhusudan
ef91dcec77 [AArch64] Generate dot for v16i8 sum reduction to i32
Convert VECREDUCE_ADD( EXTEND(v16i8_type) ) to VECREDUCE_ADD( DOTv16i8(v16i8_type) ) whenever the result type is i32. This gains in one of the SPECCPU 2017 benchmark.

This partially solves the bug: https://bugs.llvm.org/show_bug.cgi?id=46888
Meta ticket: https://bugs.llvm.org/show_bug.cgi?id=46929

Differential Revision: https://reviews.llvm.org/D88577
2020-10-02 17:11:02 +01:00
serge-sans-paille
3b873fda21 Fix interaction between stack alignment and inline-asm stack clash protection
As reported in https://github.com/rust-lang/rust/issues/70143 alignment is not
taken into account when doing the probing. Fix that by adjusting the first probe
if the stack align is small, or by extending the dynamic probing if the
alignment is large.

Differential Revision: https://reviews.llvm.org/D84419
2020-10-02 16:51:49 +02:00
Denis Antrushin
d93ad92fef [Statepoints][ISEL] visitGCRelocate: chain to current DAG root.
This is similar to D87251, but for CopyFromRegs nodes.
Even for local statepoint uses we generate CopyToRegs/CopyFromRegs
nodes.  When generating CopyFromRegs in visitGCRelocate, we must chain
to current DAG root, not EntryNode, to ensure proper ordering of copy
w.r.t. statepoint node producing result for it.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D88639
2020-10-02 21:41:22 +07:00
LLVM GN Syncbot
6db7f6f068 [gn build] Port 0c1bb4f8851 2020-10-02 14:24:01 +00:00
Paul C. Anagnostopoulos
6ec902749c [TableGen] New backend to print detailed records.
Pertinent lints are fixed.
2020-10-02 10:22:13 -04:00
Simon Pilgrim
d4e8ee9243 [Analysis] Drop local maxAPInt/minAPInt helpers. NFCI.
Use standard APIntOps::smax/smin helpers instead.
2020-10-02 14:56:12 +01:00
Simon Pilgrim
065a86f6d4 BlockFrequencyInfoImpl.h - use const references to avoid FrequencyData copies. NFCI. 2020-10-02 13:56:30 +01:00
Simon Pilgrim
bb73c06802 LoopAccessAnalysis.cpp - use const reference in for-range loops. NFCI. 2020-10-02 13:56:30 +01:00
Florian Hahn
e9c0a0b891 [SLP] Add test where reduction result is used in PHI.
Test case for PR47670.
2020-10-02 13:38:53 +01:00
Simon Pilgrim
e685fa49f9 [InstCombine] Add partial bswap vector test from D88578 2020-10-02 13:19:19 +01:00
Sjoerd Meijer
b331da3823 [AArch64] Add CPU Cortex-R82
This adds support for -mcpu=cortex-r82. Some more information about this
core can be found here:

https://www.arm.com/products/silicon-ip-cpu/cortex-r/cortex-r82

One note about the system register: that is a bit of a refactoring because of
small differences between v8.4-A AArch64 and v8-R AArch64.

This is based on patches from Mark Murray and Mikhail Maltsev.

Differential Revision: https://reviews.llvm.org/D88660
2020-10-02 12:47:23 +01:00
Florian Hahn
a4d04e324c [PhaseOrdering] Add test that requires peeling before vectorization.
Test case for PR47671.
2020-10-02 12:19:22 +01:00
Serguei Katkov
0f296dd7a4 [GVN LoadPRE] Add test to show an opportunty.
We can use context to prove that load can be safely executed
at a point where load is being hoisted.
2020-10-02 17:53:37 +07:00
Simon Pilgrim
f845fd9a51 [InstCombine] Add some basic vector bswap tests
We get the vNi16 cases already via matching as a rotate followed by the fshl -> bswap combines
2020-10-02 11:08:12 +01:00
Simon Pilgrim
3969f66c53 [InstCombine] Add partial bswap test from D88578 2020-10-02 10:34:30 +01:00
Meera Nakrani
e8e42a228c [ARM] Prevent constants from iCmp instruction from being hoisted if part of a min(max()) pattern
Marks constants of an ICmp instruction as free if it's only user is a select
instruction that is part of a min(max()) pattern. Ensures that in loops, in
particular when loop unrolling is turned on, SSAT will still be correctly generated.

Differential Revision: https://reviews.llvm.org/D88662
2020-10-02 09:28:35 +00:00
Hsiangkai Wang
4adfe21466 [RISCV] Support vmsge.vx and vmsgeu.vx pseudo instructions in RVV.
Implement vmsge{u}.vx pseudo instruction.

According to RISC-V V specification, there are different scenarios for this
pseudo instruction. I list them below.

unmasked va >= x

  pseudoinstruction: vmsge{u}.vx vd, va, x
  expansion: vmslt{u}.vx vd, va, x; vmnand.mm vd, vd, vd

masked va >= x, vd != v0

  pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t
  expansion: vmslt{u}.vx vd, va, x, v0.t; vmxor.mm vd, vd, v0

masked va >= x, vd == v0

  pseudoinstruction: vmsge{u}.vx vd, va, x, v0.t, vt
  expansion: vmslt{u}.vx vt, va, x;  vmandnot.mm vd, vd, vt

Use pseudo instruction to model vmsge{u}.vx. The pseudo instruction will convert
to different expansion according to the condition.

Differential Revision: https://reviews.llvm.org/D84732
2020-10-02 17:20:34 +08:00
serge-sans-paille
8d06bcf25b Fix limit behavior of dynamic alloca
When the allocation size is 0, we shouldn't probe. Within [1,  PAGE_SIZE], we
should probe once etc.

This fixes https://bugs.llvm.org/show_bug.cgi?id=47657

Differential Revision: https://reviews.llvm.org/D88548
2020-10-02 11:10:02 +02:00
Georgii Rymar
d37400ab28 [yaml2obj][elf2yaml] - Add a support for the EntSize field for SHT_HASH sections.
Specification  for SHT_HASH table says (https://refspecs.linuxbase.org/elf/gabi4+/ch5.dynamic.html#hash)
that it contains Elf32_Word entries for both 32/64 bit objects.

Currently both GNU linkers and LLD sets the `sh_entsize` field to `4`.

At the same time, `yaml2obj` ignores the `EntSize` field for SHT_HASH sections.
This patch fixes this and also adds a support for obj2yaml: it will not
dump this field when the `sh_entsize` contains the default value (`4`).

Differential revision: https://reviews.llvm.org/D88652
2020-10-02 12:01:50 +03:00
Tres Popp
6a5c2de672 Handle unused variable without asserts 2020-10-02 10:22:55 +02:00
Thomas Lively
1ac57615ef [WebAssembly] Emulate v128.const efficiently
v128.const was recently implemented in V8, but until it rolls into Chrome
stable, we can't enable it in the WebAssembly backend without breaking origin
trial users. So far we have been lowering build_vectors that would otherwise
have been lowered to v128.const to splats followed by sequences of replace_lane
instructions to initialize each lane individually. That produces large and
inefficient code, so this patch introduces new logic to lower integer vector
constants to a single i64x2.splat where possible, with at most a single
i64x2.replace_lane following it if necessary.

Adapted from a patch authored by @omnisip.

Differential Revision: https://reviews.llvm.org/D88591
2020-10-02 00:28:06 -07:00
David Sherwood
6fb9333083 [SVE][CodeGen] Fix implicit TypeSize->uint64_t casts in TypePromotion
The TypePromotion pass only operates on scalar types so I've fixed up
all places where we were relying upon the implicit cast from
TypeSize->uint64_t.

Differential Revision: https://reviews.llvm.org/D88575
2020-10-02 08:12:11 +01:00
David Sherwood
9542ca0d95 [SVE][CodeGen] Add new EVT/MVT getFixedSizeInBits() functions
When we know that a particular type is always going to be fixed
width we have so far been writing code like this:

  getSizeInBits().getFixedSize()

Since we are doing this in quite a few places now it seems to make
sense to add a new helper function that allows us to replace
these calls with a single getFixedSizeInBits() call.

Differential Revision: https://reviews.llvm.org/D88649
2020-10-02 07:47:31 +01:00