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

196099 Commits

Author SHA1 Message Date
Sanjay Patel
291f36c314 [InstCombine] update auto-generated test checks; NFC 2020-04-30 08:39:02 -04:00
Simon Pilgrim
fcbbc1dc0f [DAGCombine] Move the remaining X86 funnel shift patterns to DAGCombine
X86 matches several 'shift+xor' funnel shift patterns:

  fold (or (srl (srl x1, 1), (xor y, 31)), (shl x0, y))  -> (fshl x0, x1, y)
  fold (or (shl (shl x0, 1), (xor y, 31)), (srl x1, y))  -> (fshr x0, x1, y)
  fold (or (shl (add x0, x0), (xor y, 31)), (srl x1, y)) -> (fshr x0, x1, y)

These patterns are also what we end up with the proposed expansion changes in D77301.

This patch moves these to DAGCombine's generic MatchFunnelPosNeg.

All existing X86 test cases still pass, and we just have a small codegen change in pr32282.ll.

Reviewed By: @spatel

Differential Revision: https://reviews.llvm.org/D78935
2020-04-30 12:57:17 +01:00
Simon Pilgrim
b8c2c33aef [DAG] Add TODO comment regarding ADD(X,X) -> SHL(X,1) canonicalization
As discussed on D78935
2020-04-30 12:57:16 +01:00
Sanjay Patel
164896de35 [InstCombine] add tests for FP->int->FP->FP casting; NFC 2020-04-30 07:41:28 -04:00
Jay Foad
7dd9dfd3dc Fix silly mistake in 31c09d03a1f [AMDGPU] Remove WaitcntBrackets::MixedPendingEvents[]. NFC. 2020-04-30 11:41:14 +01:00
David Spickett
ee47d74637 [globalopt] Don't emit DWARF fragments for members
of a struct that cover the whole struct

This can happen when the rest of the
members of are zero length. Following
the same pattern applied to the SROA
pass in:
d7f6f1636d53c3e2faf55cdf20fbb44a1a149df1

Fixes: https://bugs.llvm.org/show_bug.cgi?id=45335

Differential Revision: https://reviews.llvm.org/D78720
2020-04-30 11:36:55 +01:00
Sam Elliott
0833c3a896 [RISCV][NFC] Remove Duplicated F Extension Patterns 2020-04-30 11:35:49 +01:00
Cullen Rhodes
46cf6a3780 [AArch64][SVE] Remove unused FP reduction intrinsic definitions
Summary: FP reductions no longer use these intrinsics since D78723.

Reviewers: efriedma, sdesmalen

Reviewed By: efriedma, sdesmalen

Differential Revision: https://reviews.llvm.org/D79010
2020-04-30 10:18:40 +00:00
Cullen Rhodes
afefea82b4 [AArch64][SVE] Custom lowering of floating-point reductions
Summary:
This patch implements custom floating-point reduction ISD nodes that
have vector results, which are used to lower the following intrinsics:

    * llvm.aarch64.sve.fadda
    * llvm.aarch64.sve.faddv
    * llvm.aarch64.sve.fmaxv
    * llvm.aarch64.sve.fmaxnmv
    * llvm.aarch64.sve.fminv
    * llvm.aarch64.sve.fminnmv

SVE reduction instructions keep their result within a vector register,
with all other bits set to zero.

Changes in this patch were implemented by Paul Walker and Sander de
Smalen.

Reviewers: sdesmalen, efriedma, rengolin

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78723
2020-04-30 10:18:40 +00:00
David Sherwood
43a45ae454 [CodeGen] Add support for inserting elements into scalable vectors
Summary:
This patch tries to ensure that we do something sensible when
generating code for the ISD::INSERT_VECTOR_ELT DAG node when operating
on scalable vectors. Previously we always returned 'undef' when
inserting an element into an out-of-bounds lane index, whereas now
we only do this for fixed length vectors. For scalable vectors it
is assumed that the backend will do the right thing in the same way
that we have to deal with variable lane indices.

In this patch I have permitted a few basic combinations for scalable
vector types where it makes sense, but in general avoided most cases
for now as they currently require the use of BUILD_VECTOR nodes.

This patch includes tests for all scalable vector types when inserting
into lane 0, but I've only included one or two vector types for other
cases such as variable lane inserts.

Differential Revision: https://reviews.llvm.org/D78992
2020-04-30 11:14:04 +01:00
James Henderson
0082b94912 [docs][llvm-cxxfilt] Fix indentation in rst file
This makes it consistent throughout the options, although the end result
is unchanged.
2020-04-30 10:41:45 +01:00
serge-sans-paille
cde8d0150c Fix spurious warning in ExtensionDependencies.inc [nfc] 2020-04-30 11:16:37 +02:00
Evgeniy Brevnov
fc47b546d8 [BPI][NFC] IRCE shoud qequest BPI through analysis manager.
Summary: There is no need to create BPI explicitly. It should be requested through AM in a normal way.

Reviewers: skatkov

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79080
2020-04-30 16:04:06 +07:00
Alexey Lapshin
37007c3d4c [Debuginfo][NFC] findRecursively: Replace std::vector by SmallVector
Summary:
Change std::vector to SmallVector to prevent re-allocations and to
have small pre-allocated storage.

Reviewers: clayborg, dblaikie

Differential Revision: https://reviews.llvm.org/D79123
2020-04-30 11:01:41 +03:00
Jay Foad
2f76a4c44d [AMDGPU] Simplify loops in SIInsertWaitcnts::generateWaitcntInstBefore
The loops over use operands and def operands were mostly identical.
Combine them, and likewise for load memoperands and store memoperands.
NFC.
2020-04-30 08:53:12 +01:00
Jay Foad
253705ed76 [AMDGPU] Remove Def argument from WaitcntBrackets::getRegInterval. NFC.
It's cleaner to check this in the callers instead.
2020-04-30 08:53:12 +01:00
Fangrui Song
79d84987ff [MC] Move MCInstrAnalysis::evaluateBranch to X86MCInstrAnalysis::evaluateBranch
The generic implementation is actually specific to x86. It assumes the
offset is relative to the end of the instruction and the immediate is
not scaled (which is false on most RISC).
2020-04-29 23:23:52 -07:00
Evgeniy Brevnov
86a7336cb6 [BPI] Incorrect probability reported in case of mulptiple edges.
Summary:
By design 'BranchProbabilityInfo:: getEdgeProbability(const BasicBlock *Src, const BasicBlock *Dst) const' should return sum of probabilities over all edges from Src to Dst. Current implementation is buggy and returns 1/num_of_successors if probabilities are not explicitly set.

Note current implementation of BPI printing has an issue as well and annotates each edge with sum of probabilities over all ages from one basic block to another. That's why 30% probability reported (instead of 10%) in the lit test. This is not urgent issue since only printing is affected.
Note also current implementation assumes that either all or none edges have probabilities set. This is not the only place which uses such assumption. At least we should assert that in verifier. In addition we can think on a more robust API of BPI which would prevent situations.

Reviewers: skatkov, yrouban, taewookoh

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79071
2020-04-30 11:41:03 +07:00
Evgeniy Brevnov
850ecb1d9c [BPI][NFC] Reuse post dominantor tree from analysis manager when available
Summary: Currenlty BPI unconditionally creates post dominator tree each time. While this is not incorrect we can save compile time by reusing existing post dominator tree (when it's valid) provided by analysis manager.

Reviewers: skatkov, taewookoh, yrouban

Reviewed By: skatkov

Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78987
2020-04-30 11:31:03 +07:00
Julian Lettner
5d3d0aa563 [lit] Provide extension API for custom result categories
The lnt test suite defines custom result codes [1].  Support those via
an extension API instead of "by accident", which should offer the
advantage of properly handling them when we print test results.

[1] https://reviews.llvm.org/D77986

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D78164
2020-04-29 19:45:55 -07:00
Arthur Eubanks
ef49e838aa Make wrong preallocated arg count verifier error clearer
Reviewers: rnk

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79128
2020-04-29 18:31:30 -07:00
Puyan Lotfi
7cb813a632 [test][MachineOutliner] REQUIRES: asserts
This new test checks some of the debug output to ensure what iteration
the outliner reached a fixed point. For now I am making it REQUIRES:
asserts so that it wont break any bots that have asserts disabled.
2020-04-29 19:43:17 -04:00
LLVM GN Syncbot
c4aa35950b [gn build] Port 9854edd817c 2020-04-29 22:52:50 +00:00
Mircea Trofin
67161923d6 [llvm][NFC] Use CallBase explicitly instead of Instruction in FunctionComparator
Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79098
2020-04-29 15:37:46 -07:00
Puyan Lotfi
6858f83603 [NFCi] Iterative Outliner + clang-format refactoring.
Prior to D69446 I had done some NFC cleanup to make landing an iterative
outliner a cleaner more straight-forward patch. Since then, it seems that has
landed but I noticed some ways it could be cleaned up. Specifically:

1) doOutline was meant to be the re-runable function, but instead
   runOnceOnModule was created that just calls doOutline.
2) In D69446 we discussed that the flag allowing the re-run of the
   outliner should be a flag to tell how many additional times to run
   the outliner again, not the total number of times. I don't think it
   makes sense to introduce a flag, but print an error if the flag is
   set to 0.

This is an NFCi, the i being that I get rid of the way that the
machine-outline-runs flag could be used to tell the outliner to not run
at all, and because I renamed the flag to '-machine-outliner-reruns'.

Differential Revision: https://reviews.llvm.org/D79070
2020-04-29 18:36:47 -04:00
Mircea Trofin
6d66d5c05c [llvm][NFC] Inliner: rename call site variables.
Summary:
Renamed 'CS' to 'CB', and, in one case, to a more specific name to avoid
naming collision with outer scope (a maintainability/readability reason,
not correctness)

Also updated comments.

Reviewers: davidxl, dblaikie, jdoerfert

Subscribers: eraman, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79101
2020-04-29 15:36:29 -07:00
Kirill Naumov
c7ceb85a1d Revert "[InlineCost] Addressing a very strict assert check in CostAnnotationWriter::emitInstructionAnnot"
This reverts commit 66947d05fd193bb8948943a62455d617974f2012.
2020-04-29 22:00:51 +00:00
Craig Topper
902656a553 [X86] Merge the last of the useBWIRegs() section into the useAVX512Regs() section of the X86TargetLowering constructor. NFC
This section is the remnant of how this code was structured before
we made v32i16/v64i8 legal types with avx512f when not restricting
to 256 bit vectors. Now that there are just a few items left,
merge them near similar things in the other section.
2020-04-29 14:40:04 -07:00
Tobias Bosch
04d3b45df4 [SVE][NFC] Remove unused variable
Summary: Remove unused variable.

Reviewers: echristo, efriedma

Reviewed By: echristo

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79129
2020-04-29 14:30:32 -07:00
Alina Sbirlea
dfbd550d47 [MemorySSA] Pass DT to the upward iterator for proper PhiTranslation.
Summary:
A valid DominatorTree is needed to do PhiTranslation.
Before this patch, a MemoryUse could be optimized to an access outside a loop, while the address it loads from is modified in the loop.
This can lead to a miscompile.

Reviewers: george.burgess.iv

Subscribers: Prazek, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79068
2020-04-29 14:28:31 -07:00
Christopher Tetreault
832c6c8b84 [NFC] Make ConstantVector/ConstantDataVector::getType() return a FixedVectorType
Reviewers: efriedma, huihuiz, dexonsmith, spatel

Reviewed By: efriedma

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D79122
2020-04-29 14:23:40 -07:00
Kirill Naumov
6ff0f0a484 [CFG] Turning on Heat Colors for CFG by default
This option seems to be very useful, so let's turn it on by default

Reviewed-By: davidxl
Diff: https://reviews.llvm.org/D79110
2020-04-29 20:44:10 +00:00
Kirill Naumov
1dfdb7e739 [InlineCost] Addressing a very strict assert check in CostAnnotationWriter::emitInstructionAnnot
The assert checks that every instruction must be annotated by this point while it is not
necessary. If the inlining process was interrupted because the threshold was reached, the rest
of the instructions would not be annotated which triggers the assert.
The added test shows the situation in which it can happen.

Reviewed-By: mtrofin
Diff: https://reviews.llvm.org/D79107
2020-04-29 20:44:10 +00:00
Craig Topper
c0032a63c6 [X86] Lower the cost of v4i64->v4i32 and v8i64->v8i32 truncate with AVX
We generate much better code these days than we used to. And we use the same sequence for AVX1 and AVX2 for these

For v4i64->v4i32 we generate:
vextractf128    xmm1, ymm0, 1
vshufps xmm0, xmm0, xmm1, 136   # xmm0 = xmm0[0,2],xmm1[0,2]

And for v8i64->v8i32 we generate:
vperm2f128      ymm2, ymm0, ymm1, 49 # ymm2 = ymm0[2,3],ymm1[2,3]
vinsertf128     ymm0, ymm0, xmm1, 1
vshufps ymm0, ymm0, ymm2, 136   # ymm0 = ymm0[0,2],ymm2[0,2],ymm0[4,6],ymm2[4,6]

Differential Revision: https://reviews.llvm.org/D79109
2020-04-29 13:21:44 -07:00
Jay Foad
08a2a72a8d [AMDGPU] Remove WaitcntBrackets::MixedPendingEvents[]. NFC.
It's trivial to derive this information from other state.
2020-04-29 19:58:19 +01:00
Jay Foad
050a36ad06 [AMDGPU] Initialize gpr upper bounds to -1. NFC.
These upper bounds are inclusive, so -1 (rather than 0) is the natural
way to express an empty range.
2020-04-29 19:58:06 +01:00
Jay Foad
36eedf3705 [AMDGPU] Simplify MergeInfo calculations. NFC.
This makes the definition and uses of NewUB more symmetrical, and makes
it clear that ScoreLBs[T] does not change.
2020-04-29 19:58:06 +01:00
Jan Korous
3df53b5637 [FileCollector] move Root creation
If we don't handle the errors we can't rely on the directory being created early anyway.

Differential Revision: https://reviews.llvm.org/D78959
2020-04-29 11:47:23 -07:00
Christopher Tetreault
bab428d88d [SVE] Upgrade VectorType tests to test new types
Reviewers: efriedma, sdesmalen, c-rhodes, ddunbar

Reviewed By: sdesmalen

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78831
2020-04-29 11:45:46 -07:00
Ulrich Weigand
b3af96584e [SystemZ] Allow specifying plain register numbers in AsmParser
For compatibility with other assemblers on the platform, allow
using just plain integer register numbers in all places where a
register operand is expected.

Bug: llvm.org/PR45582
2020-04-29 20:42:30 +02:00
Ulrich Weigand
832956c0cf [SystemZ] Simplify register parsing in AsmParser
Remove redundant Group and Regs arguments from parseRegister
and eliminate one of its overloaded versions.

Remove redundant Regs argument from parseAddress.

NFC intended.
2020-04-29 20:42:30 +02:00
Sanjay Patel
b38b7dc80b [x86] add tests for awkward 'icmp eq i1'; NFC 2020-04-29 14:39:47 -04:00
Martin Storsjö
579a3edad4 [llvm-objcopy] [COFF] Fix a misconception about debug directory payloads
The debug directory payload is not located directly after the
debug directory entry itself, but can essentially be located anywhere
in the binary (even outside of mapped sections, although we don't
handle that case).

Differential Revision: https://reviews.llvm.org/D78921
2020-04-29 20:35:36 +03:00
Martin Storsjö
f4aa425c92 [llvm-readobj] [COFF] Cope with debug directory payloads in unmapped areas
According to the spec, the payload for debug directories can be
in parts of the binary that aren't mapped at runtime - in these
cases, AddressOfRawData is just set to zero.

Differential Revision: https://reviews.llvm.org/D78920
2020-04-29 20:35:33 +03:00
Anh Tuyen Tran
3734d8462b [VFDatabase] Scalar functions are vector functions with VF =1
Summary:
Return scalar function when VF==1. The new trivial mapping scalar --> scalar when VF==1 to prevent false positive for "isVectorizable" query.

Author: masoud.ataei (Masoud Ataei)

Reviewers: Whitney (Whitney Tsang), fhahn (Florian Hahn), pjeeva01 (Jeeva P.), fpetrogalli (Francesco Petrogalli), rengolin (Renato Golin)

Reviewed By: fpetrogalli (Francesco Petrogalli)

Subscribers: hiraditya (Aditya Kumar), llvm-commits, LLVM

Tag: LLVM

Differential Revision: https://reviews.llvm.org/D78054
2020-04-29 17:20:37 +00:00
Davide Italiano
ccd250964b [MachineVerifier] Remove an unused function. NFCI. 2020-04-29 09:58:27 -07:00
Mircea Trofin
56233d7e37 [llvm][NFC] Removed addressed fixme; formatting.
Removed already-addressed fixme, and updated formatting of a few lines
that were triggering Harbormaster.
2020-04-29 09:06:01 -07:00
Hiroshi Yamauchi
0969628399 [PGO][PGSO] Prep for enabling non-cold code size opts under non-partial-profile sample PGO.
Summary:
- Distinguish between partial-profile and non-partial-profile sample PGO.
- Add a flag for partial-profile sample PGO.
- Tune the sample PGO cutoff.
- No default behavior change (yet).

Reviewers: davidxl

Subscribers: eraman, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78949
2020-04-29 08:57:47 -07:00
Simon Pilgrim
84ceaccaeb [x86] Enable bypassing 64-bit division on generic x86-64
This is currently enabled for Intel big cores from Sandy Bridge onward, as well as Atom, Silvermont, and KNL, due to 64-bit division being so slow on these cores. AMD cores can do this in hardware (use 32-bit division based on input operand width), so it's not a win there. But since the majority of x86 CPUs benefit from this optimization, and since the potential upside is significantly greater than the downside, we should enable this for the generic x86-64 target.

Patch By: @atdt

Reviewed By: @craig.topper, @RKSimon

Differential Revision: https://reviews.llvm.org/D75567
2020-04-29 16:55:48 +01:00
Nico Weber
7d27d0c9d0 [gn build] (manually) port ad97ccf6b26a 2020-04-29 11:51:22 -04:00