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

197842 Commits

Author SHA1 Message Date
Jessica Paquette
99240f6e6e [AArch64][GlobalISel] Add selection support for rev16, rev32, and rev64
This does three things:

1) Adds G_REV16, G_REV32, and G_REV64. These are equivalent to AArch64rev16,
   AArch64rev32, and AArch64rev64 respectively.

2) Adds support for producing G_REV64 in the postlegalizer combiner.
   We don't legalize any of the shuffles which could give us a G_REV32 or
   G_REV16 yet. Since the function for detecting the rev mask is lifted from
   AArch64ISelLowering, it should work for G_REV32 and G_REV16 when we get
   there.

3) Adds a selection test for a good portion of the patterns imported for the rev
   family. The only ones which are not tested are the ones with bitconvert.

This also does a little cleanup, and adds a struct for shuffle vector pseudo
matchdata. This lets us still use `applyShuffleVectorPseudo` rather than adding
a new function.

It should also make it a bit easier to port some of the other masks from
AArch64ISelLowering. (e.g. `isZIP_v_undef_Mask` and friends)

Differential Revision: https://reviews.llvm.org/D81112
2020-06-03 15:30:30 -07:00
Philip Reames
429d883933 [Statepoint] Fix signed vs unsigned in index handling
As noted in a comment on D80937, all of these are specified as unsigned values, but the verifier code was using signed.  Given the practical values involved, the different in range didn't matter, but we might as well clean it up.
2020-06-03 15:10:20 -07:00
Jessica Paquette
8210c19b3b [AArch64][GlobalISel] Select uzp1 and uzp2
Porting the mask stuff for uzp1 and uzp2 from AArch64ISelLowering.

Add two custom opcodes: G_UZP1 and G_UZP2.

Produce them in the post-legalizer combiner when the mask checks out.

Tests:

- postlegalizer-combiner-uzp.mir verifies that we create G_UZP1 and G_UZP2.
The testcases that check that we create them come from neon-perm.ll.

- select-uzp.mir verifies that we can select G_UZP1 and G_UZP2.

Differential Revision: https://reviews.llvm.org/D81049
2020-06-03 15:09:41 -07:00
Philip Reames
16c247c68a Introduce a "gc-live" bundle for the gc arguments of a statepoint
Currently, gc.relocates are defined in terms of indices into the statepoint's operand list. Given the gc args are at the end of a variable length list of operands, this makes interpreting their indices by hand a tad challenging. We can simplify the statepoint sequence and improve readability quite a bit by pulling these new operands into their own named operand bundle.

This patch defines a new operand bundle tag "gc-live". The semantics of the bundle are the same as the existing gc arguments of a statepoint. This patch simply introduces the definition and codegen for the bundle, future patches will migrate RS4GC to emitting the new form.

Interestingly, with this done and the recent migration to using deopt and gc-transition bundles, we really don't have much left in the statepoint itself. It really looks like the existing ID and flags fields are redundant; we have (existing!) attributes for all of them. I think we'll be able to reduce the gc.statepoint signature to simply a wrapped call (e.g. actual target and actual arguments).

Differential Revision: https://reviews.llvm.org/D80937
2020-06-03 15:00:24 -07:00
LLVM GN Syncbot
681892253c [gn build] Port e636e6b79ac 2020-06-03 21:16:03 +00:00
LLVM GN Syncbot
d54ef3e6c9 [gn build] Port 7f50c15be5c 2020-06-03 21:16:02 +00:00
Craig Topper
c81b0cf287 [X86] Separate X86_CPU_TYPE_COMPAT_WITH_ALIAS from X86_CPU_TYPE_COMPAT. NFC
Add a separate X86_CPU_TYPE_COMPAT_ALIAS that carries alias string
and the enum from X86_CPU_TYPE_COMPAT.
2020-06-03 14:13:12 -07:00
Nico Weber
3ece07dc76 [gn build] Fix link with ld.bfd and gold.
lld's symbol resolution algorithm makes it not depend on
the order of object files and libraries, but ld.bfd and
gold require listing dependencies later on the link line.
Put {{libs}} after {{inputs}} so that e.g. -lpthreads
appears after the object files, not before it.

Differential Revision: https://reviews.llvm.org/D81035
2020-06-03 17:06:30 -04:00
Thomas Lively
e9d1d2ae6e Reland "[WebAssembly] Eliminate range checks on br_tables"
This reverts commit 755a89591528b692315ad0325347e2fd4637271b.
Although I was not able to reproduce any test failures locally,
aheejin was able to reproduce them and found a fix, applied here.
2020-06-03 14:04:59 -07:00
Christopher Tetreault
8b6f187cd4 [SVE] Eliminate calls to default-false VectorType::get() from IR
Reviewers: efriedma, kmclaughlin, sdesmalen, dexonsmith, dblaikie

Reviewed By: efriedma

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80261
2020-06-03 13:56:45 -07:00
Matt Arsenault
b7b3e8e261 RegAllocFast: Record internal state based on register units
Record internal state based on register units. This is often more
efficient as there are typically fewer register units to update
compared to iterating over all the aliases of a register.

Original patch by Matthias Braun, but I've been rebasing and fixing it
for almost 2 years and fixed a few bugs causing intermediate failures
to make this patch independent of the changes in
https://reviews.llvm.org/D52010.
2020-06-03 16:51:46 -04:00
Matt Arsenault
7bad2ce0ff X86: Switch fastregalloc test to use generated checks 2020-06-03 16:46:00 -04:00
Florian Hahn
98be203a97 [AArch64] Fix stp-opt-with-renaming-ld3.mir with expensive checks.
Unconditionally use -verify-machineinstrs and XFAIL the test until
fixed.
2020-06-03 20:23:52 +01:00
Arnold Schwaighofer
73b5514282 CoroSplit: Fix coroutine splitting for retcon and retcon.once
Summary:
For retcon and retcon.once coroutines we assume that all uses of spills
can be sunk past coro.begin. This simplifies handling of instructions
that escape the address of an alloca.

The current implementation would have issues if the address of the
alloca is escaped before coro.begin. (It also has issues with casts before and
uses of those casts after the coro.begin instruction)

  %alloca_addr = alloca ...
  %escape  = ptrtoint %alloca_addr
  coro.begin
  store %escape to %alloca_addr

rdar://60272809

Subscribers: hiraditya, modocache, mgrang, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D81023
2020-06-03 12:10:58 -07:00
Simon Pilgrim
145b93d855 [VectorCombine] Add multi-use shl test for D80885 2020-06-03 19:42:15 +01:00
Florian Hahn
c309367c83 [AArch64] Add ld3 test case for renaming in ldst-opt (NFC).
The test case highlights a mis-compile reported in PR46105, where
a consecutive register list is renamed, which invalidates some other
used registers.
2020-06-03 19:30:03 +01:00
Florian Hahn
a101787823 [NewGVN] Add test to ensure metadata is preserved for ssa_copy (NFC)
Add a new test that checks that metadata is preserved when ssa_copy
calls introduced by PredicateInfo are replaced by their original
values.
2020-06-03 19:30:03 +01:00
Lang Hames
5729b54948 [JITLink] Skip debug sections in MachO objects.
Debug sections will not be linked into the final executable and may contain
ambiguous relocations*. Skipping them avoids both some unnecessary processing
cost and the hassle of dealing with the problematic relocations.

* E.g. __debug_ranges contains non-extern relocations to the end of functions
hat begin with named symbols. Under the usual rules for interpreting non-extern
relocations these will be incorrectly associated with the following block, or
no block at all (if there is a gap between one block and the next).
2020-06-03 11:08:14 -07:00
Simon Pilgrim
da424b0d0a [VectorCombine] Add multi-use multiply test for D80885 2020-06-03 18:54:03 +01:00
Dorit Nuzman
826d80e700 [InstSimplify] fix bug in matching or-with-not op (PR46083) 2020-06-03 13:44:29 -04:00
jasonliu
621386835e [XCOFF][AIX] Use 'L..' instead of 'L' for PrivateGlobalPrefix
Without this change, names start with 'L' will get created as
temporary symbol in MCContext::createSymbol.

Some other potential prefix considered:
.L, does not work for AIX, as a function start with L will end
up with .L as prefix for its function entry point.

..L could work, but it does not play well with the convention
on AIX that anything start with '.' are considered as entry point.

L. could work, but not sure if it's safe enough, as it's possible
to have suffixes like .something append to a plain L, giving L.something
which is not necessarily a temporary.

That's why we picked L.. for now.

Differential Revision: https://reviews.llvm.org/D80831
2020-06-03 17:18:11 +00:00
Victor Huang
14cc6c217a [CodeGen] Enable tail call position check for speculatable functions
In the function "Analysis.cpp:isInTailCallPosition", it only checks whether
a call is in a tail call position if the call has side effects, access memory
or it is not safe to speculative execute. Therefore, a speculatable function
will not go through tail call position check and improperly tail called when
it is not in a tail-call position. This patch enables tail call position check
for speculatable functions.

Differential Revision: https://reviews.llvm.org/D80661
2020-06-03 10:37:45 -05:00
Kang Zhang
070c26f0c5 [LiveVariables] Don't set undef reg PHI used as live for FromMBB
Summary:
In the patch D73152, it adds a new function LiveVariables::addNewBlock.
This new function will add the reg which PHI used to the MBB which reg
is from.
But the new function may cause LiveVariable Verification failed when the
Src reg in PHI is undef.

Reviewed By: bjope

Differential Revision: https://reviews.llvm.org/D80077
2020-06-03 15:25:30 +00:00
Henry Kao
d1cc2de77b [CodeGen][SVE] Replace deprecated calls in getCopyFromPartsVector()
Summary: Replaced getVectorNumElements() with getVectorElementCount(). Added operator overloads for class ElementCount. Fixes warning in several AArch64 unit tests.

Reviewers: sdesmalen, kmclaughlin, dancgr, efriedma, each, andwar, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80826
2020-06-03 11:20:02 -04:00
Yonghong Song
0cfb2248a6 [BPF] Remove unnecessary MOV_32_64 instructions
Commit 13f6c81c5d9a ("[BPF] simplify zero extension
with MOV_32_64") tried to use MOV_32_64 instructions
instead of lshift/rshift instructions for zero extension.
This has the benefit to remove the number of instructions
and may help verifier too.

But the same commit also removed the old MOV_32_64
pruning as it deems unsafe as MOV_32_64 does have the
side effect, zeroing out the top 32bit in the register.
This caused the following failure in kernel selftest
test_cls_redirect.o. In linux kernel, we have
     struct __sk_buff {
        __u32 data;
        __u32 data_end;
     };
The compiler will generate 32bit load for __sk_buff->data
and __sk_buff->data_end. But kernel verifier will actually
loads an address (64bit address on 64bit kernel) to the
result register. In this particular example, the explicit zext
was not optimized away and destroyed top 32bit
address and the verifier rejected the program :
     w2 = *(u32 *)(r1 + 76)
     ...
     r2 = w2  /* MOV_32_64: this will clear top 32bit */

Currently, if the load and the zext are next to each other, the
instruction pattern match can actually capture this to
avoid MOV_32_64, e.g., in BPFInstrInfo.td, we have
  def : Pat<(i64 (zextloadi32 ADDRri:$src)),
            (SUBREG_TO_REG (i64 0), (LDW32 ADDRri:$src), sub_32)>;

However, if they are not next to each other, LDW32 and
MOV_32_64 are generated, which may cause the above mentioned
problem.

BPF Backend already tried to optimize away pattern
   mov_32_64 + lshift + rshift

Commit 13f6c81c5d9a may generate mov_32_64 not followed by shifts.
This patch added optimization for only mov_32_64 too.

Differential Revision: https://reviews.llvm.org/D81048
2020-06-03 08:14:54 -07:00
Simon Pilgrim
61f4e104f6 Fix gcc -Wdocumentation warning. NFC.
gcc doesn't recognise @llvm.experimental.guard as a code snippet
2020-06-03 16:11:54 +01:00
Simon Pilgrim
8ca5ce94d4 [DAG] SimplifyDemandedBits - peek through SHL if we only demand sign bits.
If we're only demanding the (shifted) sign bits of the shift source value, then we can use the value directly.

This handles SimplifyDemandedBits/SimplifyMultipleUseDemandedBits for both ISD::SHL and X86ISD::VSHLI.

Differential Revision: https://reviews.llvm.org/D80869
2020-06-03 16:11:54 +01:00
David Tenty
9cf21dc31e [AIX] Update data directives for AIX assembly
Summary:
The standard data emission directives (e.g. .short, .long) in the AIX assembler
have the unintended consequence of aligning their output to the natural byte
boundary. This cause problems because we aren't expecting behavior from the
Data*bitsDirectives, so the final alignment of data isn't correct in some cases
on AIX.

This patch updated the Data*bitsDirectives to use .vbyte pseudo-ops instead to emit the
data, since we will emit the .align directives as needed. We update the existing
testcases and add a test for emission of struct data.

Reviewers: hubert.reinterpretcast, Xiangling_L, jasonliu

Reviewed By: hubert.reinterpretcast, jasonliu

Subscribers: wuzish, nemanjai, hiraditya, kbarton, arphaman, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80934
2020-06-03 10:55:59 -04:00
Matt Arsenault
978e86b6c2 ARM: Reduce debug info testcase
This had multiple functions and only one vague check. Reduce it.
2020-06-03 10:33:32 -04:00
Simon Pilgrim
62baadb119 [X86][AVX] getFauxShuffleMask - fix sub vector size check in INSERT_SUBVECTOR(X,SHUFFLE(Y,Z))
We were bailing on subvector shuffle inputs that were smaller than the subvector type instead of larger than it.

Fixes PR46178
2020-06-03 15:26:22 +01:00
Matt Arsenault
e8f9de31c3 AMDGPU: Switch test to generated checks
This is was a very frustrating test to update manually.
2020-06-03 10:14:54 -04:00
Francesco Petrogalli
1a767c23f0 [llvm][SVE] IR intrinsic for LD1RO.
Reviewers: sdesmalen, efriedma

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80738
2020-06-03 13:57:16 +00:00
Sanjay Patel
f6e5991a6b [InstSimplify] add/move tests for or with not op (PR46083); NFC 2020-06-03 08:13:36 -04:00
Kazushi (Jam) Marukawa
6414d999ea [VE] Support a basic disassembler for Aurora VE target
Summary:
Add a basic disassember and regression tests of LEA/LD/ST
instructions.  This patch also removes DecoderMethod declarations for
branch and call since those are not implemented in this patch.  They
will be added again later.  This patch also corrects DecoderMethod for
LD/ST instructions for one byte or two.

Differential Revision: https://reviews.llvm.org/D80912
2020-06-03 13:48:42 +02:00
Simon Pilgrim
04235a804d Fix gcc "enumeral and non-enumeral type in conditional expression" warning. NFCI. 2020-06-03 12:43:08 +01:00
Simon Pilgrim
fbe2fc786a [DAG] GetDemandedBits - don't bother asserting for a non-null cast<> result. NFC.
cast<> will assert on failure anyhow.

This lets us fold the cast<> with the getAPIntValue() that uses it.
2020-06-03 12:43:07 +01:00
Florian Hahn
06e94a3cd5 [VPlan] Support extracting lanes for defs managed in VPTransformState.
Currently extracting a lane for a VPValue def is not supported, if it is
managed directly by VPTransformState (e.g. because it is created by a
VPInstruction or an external VPValue def).

For now, simply extract the requested lane. In the future, we should
also cache the extracted scalar values, similar to LV.

Reviewers: Ayal, rengolin, gilr, SjoerdMeijer

Reviewed By: SjoerdMeijer

Differential Revision: https://reviews.llvm.org/D80787
2020-06-03 12:14:16 +01:00
LLVM GN Syncbot
8de1b296de [gn build] Port add51e152aa 2020-06-03 10:50:20 +00:00
Jay Foad
f4c80374f0 [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix tests)
Try to fix Windows buildbots.
2020-06-03 11:40:52 +01:00
Braedy Kuzma
463ba33aa8 [LangRef] Fix description of shape args for matrix.multiply.
Currently all code instances within the matrix lowering pass consider
matrix A to be MxN and B to be NxK, producing C which is MxK. Anyone
interacting with this API after reading the docs but without reading the pass
would expect A: MxK, B: KxN, and C: MxN. These changes bring the documentation
in line with the implementation.

One point of concern with this, the original signature as described in the docs
may be better or at least more expected. The interface as it was written
reflected other common matrix multiplication interfaces such as BLAS'[1], where
the matrices are MxK, KxN, MxN respectively. Choosing to honor this requires
changing code and tests instead, but should be mostly just renaming of variables.

Patch by Braedy Kuzma <braedy@ualberta.ca>

[1] http://www.netlib.org/lapack/explore-html/db/dc9/group__single__blas__level3_gafe51bacb54592ff5de056acabd83c260.html#gafe51bacb54592ff5de056acabd83c260

Reviewers: anemet, LuoYuanke, nicolasvasilache, fhahn

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D80663
2020-06-03 11:25:44 +01:00
Simon Pilgrim
fac721d969 TargetFrameLowering.h - remove unnecessary includes. NFC.
Move TargetFrameLowering.h include to the top of the TargetFrameLoweringImpl.cpp includes (clang-format doesn't do this by default as the filenames don't match).
2020-06-03 11:12:42 +01:00
Kadir Cetinkaya
2cb560a712 [llvm] Fix unused variable warnings 2020-06-03 11:49:01 +02:00
Vitaly Buka
9c9a3b8828 [NFC,StackSafety] Fix template arg name 2020-06-03 02:39:21 -07:00
Djordje Todorovic
2533162bf0 [CSInfo][MIPS][DwarfDebug] Add support for delay slots
This adds call site info support for call instructions with delay slot.
Search for instructions inside call delay slot, which load value
into parameter forwarding registers.
Return address of the call points to instruction after call delay slot,
which is not the one, immediately after the call instruction.

Patch by Nikola Tesic

Differential revision: https://reviews.llvm.org/D78107
2020-06-03 11:25:17 +02:00
Jay Foad
14dd772f1b [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics (fix)
Try to fix Windows buildbots.
2020-06-03 09:44:33 +01:00
Serge Pavlov
86f8cab821 Revert "[Support] Add file lock/unlock functions"
This reverts commit f51bc4fb60fbcef26d18eff549fc68307fd46489.
It broke the Solaris buildbots (Builder clang-solaris11-sparcv9 Build #5494
<http://lab.llvm.org:8014/builders/clang-solaris11-sparcv9/builds/54).
2020-06-03 15:40:12 +07:00
Vitaly Buka
f99a2b16cb [StackSafety,NFC] Convert to template internal stuff
It's going to be usefull for ThinLTO.
2020-06-03 01:36:20 -07:00
Vitaly Buka
299555c7e7 [StackSafety,NFC] Rename internal class 2020-06-03 01:36:20 -07:00
Jay Foad
4a4ccbfa8d [AMDGPU] Fold llvm.amdgcn.cos and llvm.amdgcn.sin intrinsics
Differential Revision: https://reviews.llvm.org/D80702
2020-06-03 09:34:22 +01:00
hsmahesha
d03b426308 [AMDGPU/MemOpsCluster] Code clean-up around accessing of memory operand width
Summary:
Clean-up the width computing logic given a memory operand, and re-arrange code to avoid
code duplication.

Reviewers: foad, rampitec, arsenm, vpykhtin, javedabsar

Reviewed By: foad

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D80946
2020-06-03 14:03:52 +05:30