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

214714 Commits

Author SHA1 Message Date
Sanjay Patel
b16c2ede3c [InstCombine] add tests for srem-by-2; NFC 2021-04-20 17:10:16 -04:00
Sam Clegg
8c8f002458 [WebAssembly] Remove unused known_gcc_test_failures.txt. NFC
Differential Revision: https://reviews.llvm.org/D100887
2021-04-20 14:07:25 -07:00
Alexey Bataev
907c8ed010 [COST][AARCH64] Improve cost of reverse shuffles for AArch64.
Introduced the cost of thre reverse shuffles for AArch64, currently just
copied the costs for PermuteSingleSrc.

Differential Revision: https://reviews.llvm.org/D100871
2021-04-20 13:47:56 -07:00
Philip Reames
6215df8065 Reapply "Look through invertible recurrences in isKnownNonEqual"
I'd reverted this in commit 3b6acb179708ea2f3caf95ace0f134fcbc460333 due to buildbot failures.  This patch contains the fix for said issue.  I'd forgotten to handle the case where two phis in the same block have different operand order.  We canonicalize away from this, but it's still valid IR.  The tests included in this change (as opposed to simply having test output changed), crashed without the fix.

Original commit message follows...

This extends the phi handling in isKnownNonEqual with a special case based on invertible recurrences. If we can prove the recurrence is invertible (which many common ones are), we can recurse through the start operands of the recurrence skipping the phi cycle.

(Side note: Instcombine currently does not push back through these cases. I will implement that in a follow up change w/separate review.)

Differential Revision: https://reviews.llvm.org/D99912
2021-04-20 12:47:59 -07:00
Jon Roelofs
5807e188d1 [AArch64][GlobalISel] Clarify fallback debug print
... to only print when that fallback actually happens.
2021-04-20 12:41:14 -07:00
Thomas Lively
1844c2454c [WebAssembly] More codegen for f64x2.convert_low_i32x4_{s,u}
af7925b4dd65 added a custom DAG combine for recognizing fp-to-ints of
extract_subvectors that could be lowered to f64x2.convert_low_i32x4_{s,u}
instructions. This commit extends the combines to recognize equivalent
extract_subvectors of fp-to-ints as well.

Differential Revision: https://reviews.llvm.org/D100790
2021-04-20 12:37:13 -07:00
Nico Weber
e44f11e667 [llvm-objdump] Remove "No" prefixes on variables
...to remove double negation in the code. Requested in D100583.

No behavior change.

Differential Revision: https://reviews.llvm.org/D100849
2021-04-20 15:29:07 -04:00
Philip Reames
952b6e81cd Revert "Look through invertible recurrences in isKnownNonEqual"
This reverts commit be20eae25f50f5ef648aeefa1143e1c31e4410fc.  It appears to have caused a crash on a buildbot (https://lab.llvm.org/buildbot#builders/77/builds/5653).  Reverting while investigating.
2021-04-20 11:47:10 -07:00
Philip Reames
de5d0e597e Rearrange code to reduce diff for D99687 [nfc]
Adding the switches to reduce diffs.  I'm about to split that into an lshr part and an ashr part, doing the NFC part first makes it easier to maintain both diffs.
2021-04-20 11:40:15 -07:00
Philip Reames
35e505e294 [tests] Expand coverage for D99687 2021-04-20 11:31:39 -07:00
Roman Lebedev
e640c0f99d [InstCombine] Recognize ((x * y) s/ x) !=/== y as an signed multiplication overflow check (PR48769)
We already had support for it's unsigned variant, so simply extend it
to also handle the signed variant.

Fixes https://bugs.llvm.org/show_bug.cgi?id=48769
2021-04-20 21:29:43 +03:00
Roman Lebedev
f22b1f8ec3 [NFC][InstCombine] Add tests for signed mul overflow check via mul-sdiv pattern (PR48769) 2021-04-20 21:29:21 +03:00
Roman Lebedev
b30f6f3772 [NFC][SCEV] Split getLosslessPtrToIntExpr out of getPtrToIntExpr() 2021-04-20 21:29:21 +03:00
Roman Lebedev
ad50d0ef87 [NFC][LoopVectorize] Autogenerate check lines in pr45259.ll
We might as well test all of the codegen here.
2021-04-20 21:29:21 +03:00
Philip Reames
c647071b9b Look through invertible recurrences in isKnownNonEqual
This extends the phi handling in isKnownNonEqual with a special case based on invertible recurrences. If we can prove the recurrence is invertible (which many common ones are), we can recurse through the start operands of the recurrence skipping the phi cycle.

(Side note: Instcombine currently does not push back through these cases. I will implement that in a follow up change w/separate review.)

Differential Revision: https://reviews.llvm.org/D99912
2021-04-20 10:52:22 -07:00
Alexey Bataev
bc92d5f3ea Update tests checks, NFC. 2021-04-20 10:20:15 -07:00
Fangrui Song
24f76ee9b1 [llvm-objdump] Prefer positive boolean Verbose instead of negative NonVerbose. NFC
Differential Revision: https://reviews.llvm.org/D100791
2021-04-20 10:15:58 -07:00
Philip Reames
ee2a6f57cd [test] Add a couple extra tests for recurrence matching in unreachable code
These are salvaged from D100004 as we took a different approach to the fix.
2021-04-20 10:08:50 -07:00
Alexey Bataev
2eef89addc [COST]Add a test for reverse shuffles cost on AArch64, NFC. 2021-04-20 10:01:14 -07:00
Philip Reames
355ef90ae5 [test] Add a couple more tests for D99912 2021-04-20 09:56:57 -07:00
Philip Reames
ffc966130f [tests] Update per review comment on D99912
(I'd copy and pasted the wrong test before tweaking, as a result, it wasn't a very good negative test.)
2021-04-20 09:42:29 -07:00
Joseph Huber
56eaebd6b2 [OpenMP] Add OpenMPOpt as a Module pass
Summary:
This patch registers OpenMPOpt as a Module pass in addition to a CGSCC
pass. This is so certain optimzations that are sensitive to intact
call-sites can happen before inlining. The old `openmpopt` pass name is
changed to `openmp-opt-cgscc` and `openmp-opt` calls the Module pass.
The current module pass only runs a single check but will be expanded in
the future.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D99202
2021-04-20 12:28:58 -04:00
Simon Pilgrim
41a14bd560 [PhaseOrdering] Add second test case for PR36760 2021-04-20 17:27:24 +01:00
Simon Pilgrim
1042fb4819 Silence MSVC signed/unsigned comparison warning. NFCI. 2021-04-20 17:20:13 +01:00
Simon Pilgrim
afa6d0b27b [PhaseOrdering] Add test case for PR36760
Ensures that the correct sequence of simplifycfg/instcombine/sroa reduce the IR to just a icmp+select
2021-04-20 17:09:49 +01:00
Simon Pilgrim
3ca7870bea [X86][SSE] combineX86ShuffleChain - check if we're blending with zero into already zero elements
Add a SelectionDAG::MaskedElementsAreZero helper that wraps SelectionDAG::MaskedValueIsZero testing for entirely zero vector elements
2021-04-20 17:09:49 +01:00
Alexey Bataev
d36710c53a [SLP] Add detection of shuffled/perfect matching of tree entries.
SLP supports perfect diamond matching for the vectorized tree entries
but do not support it for gathered entries and does not support
non-perfect (shuffled) matching with 1 or 2 tree entries. Patch adds
support for this matching to improve cost of the vectorized tree.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D100495
2021-04-20 09:08:46 -07:00
Philip Reames
9a1971d844 free(nullptr) does not violate the nofree specification
This fixes a subtle and nasty bug in my 86664638. The problem is that free(nullptr) is well defined (and common).

The specification for the nofree attributes talks about memory objects, and doesn't explicitly address null, but I think it's reasonable to assume that nofree doesn't disallow a call to free(nullptr). If it did, we'd have to prove nonnull on an argument to ever infer nofree which doesn't seem to be the intent.

This was found by Nuno and Alive2 over in https://reviews.llvm.org/D100141#2697374.

Differential Revision: https://reviews.llvm.org/D100779
2021-04-20 09:08:05 -07:00
Matt Arsenault
80b31575f3 GlobalISel: Defer register creation in handleAssignments
This is currently built on top of the SelectionDAG call lowering, but
does not use it the same way. SelectionDAG passes legalized types to
the assignment functions, and the tablegenerated assignment functions
may change the value types expected for registers. This does not
change the types used, just moves the register creation to help fix
this in the future.

Defer the register creation until after all of the assignment
decisions have been made. This will also help have correct tail call
compatibility checking in a future change. Currently it does not work
as expected for any arguments split across multiple registers.
2021-04-20 11:48:12 -04:00
Jay Foad
55e098ac95 [AMDGPU] Allow multiple uses of the same literal
In GFX10 VOP3 can have a literal, which opens up the possibility of two
operands using the same literal value, which is allowed and only counts
as one use of the constant bus.

AMDGPUAsmParser::validateConstantBusLimitations already knew about this
but SIInstrInfo::verifyInstruction did not.

Differential Revision: https://reviews.llvm.org/D100770
2021-04-20 16:44:01 +01:00
Ahmed Bougacha
f908c89361 [AArch64] Bump apple-latest CPU alias to apple-a14. 2021-04-20 08:41:04 -07:00
Ahmed Bougacha
95630b78aa [AArch64] Add apple-m1 CPU, and default to it for macOS.
apple-m1 has the same level of ISA support as apple-a14,
so this is a straightforward mechanical change.  However, that
also means this inherits apple-a14's v8.5a+nobti quirkiness.

rdar://68287159
2021-04-20 08:41:04 -07:00
LLVM GN Syncbot
bc0540ed2d [gn build] Port 120fa8293e22 2021-04-20 15:33:43 +00:00
Matt Arsenault
e229e7cbd1 GlobalISel: Check for powers of 2 for inverse funnel shift lowering
This doesn't make a practical difference since it would only be broken
if a target actually had a legal non-power-of-2 inverse shift.
2021-04-20 11:30:22 -04:00
Alexey Bataev
86ad0ff420 Revert "[SLP] Add detection of shuffled/perfect matching of tree entries."
This reverts commit daf6e18c55c2ac56bbf0f9de233fb2a1150ee331 to fix the
compiler crash.
2021-04-20 08:29:32 -07:00
David Green
0f24d11c47 [ARM] Limit PerformExtractEltToVMOVRRD to when f64 is legal.
The generic SoftFloatVectorExtract.ll test was failing when run on arm
machines, as it tries to create a f64 under soft float. Limit the
transform to when f64 is legal.

Also add a missing override, as reported in D100244.
2021-04-20 16:24:36 +01:00
Matt Arsenault
51148e14d7 AMDGPU/GlobalISel: Fix uitofp/sitofp with non-power-of-2 integers 2021-04-20 11:13:29 -04:00
Matt Arsenault
ad2346a20c GlobalISel: Restrict narrow scalar for fptoui/fptosi results
This practically only works for the f16 case AMDGPU uses, not wider
types.

Fixes bug 49710 by failing legalization.
2021-04-20 10:54:40 -04:00
Matt Arsenault
73b19968f2 MachineVerifier: Continue reporting errors for copies
This was skipping verification of later copies, but generally the
verifier tries to report as many things wrong as possible in the
function.
2021-04-20 10:54:40 -04:00
Alexey Bataev
746009e1c5 [SLP] Add detection of shuffled/perfect matching of tree entries.
SLP supports perfect diamond matching for the vectorized tree entries
but do not support it for gathered entries and does not support
non-perfect (shuffled) matching with 1 or 2 tree entries. Patch adds
support for this matching to improve cost of the vectorized tree.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D100495
2021-04-20 07:46:49 -07:00
Nico Weber
14ab5acbae [gn build] reformat all gn files
$ git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format

(and manually wrap two comments)
2021-04-20 10:34:08 -04:00
Bradley Smith
935e65cc31 [AArch64][SVE] Lower MULHU/MULHS nodes to umulh/smulh instructions
Mark MULHS/MULHU nodes as legal for both scalable and fixed SVE types,
and lower them to the appropriate SVE instructions.

Additionally now that the MULH nodes are legal, integer divides can be
expanded into a more performant code sequence.

Differential Revision: https://reviews.llvm.org/D100487
2021-04-20 15:18:06 +01:00
Alexey Bataev
7d693d1c6d Revert "[SLP] Add detection of shuffled/perfect matching of tree entries."
This reverts commit b232771acad6225574a2eaf9f860a0fed7ef0804 to fix
buildbots.
2021-04-20 07:16:11 -07:00
David Green
17e932c916 [ARM] Create VMOVRRD from adjacent vector extracts
This adds a combine for extract(x, n); extract(x, n+1)  ->
VMOVRRD(extract x, n/2). This allows two vector lanes to be moved at the
same time in a single instruction, and thanks to the other VMOVRRD folds
we have added recently can help reduce the amount of executed
instructions. Floating point types are very similar, but will include a
bitcast to an integer type.

This also adds a shouldRewriteCopySrc, to prevent copy propagation from
DPR to SPR, which can break as not all DPR regs can be extracted from
directly.  Otherwise the machine verifier is unhappy.

Differential Revision: https://reviews.llvm.org/D100244
2021-04-20 15:15:43 +01:00
Alexey Bataev
4b716fe7c5 [SLP] Add detection of shuffled/perfect matching of tree entries.
SLP supports perfect diamond matching for the vectorized tree entries
but do not support it for gathered entries and does not support
non-perfect (shuffled) matching with 1 or 2 tree entries. Patch adds
support for this matching to improve cost of the vectorized tree.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D100495
2021-04-20 06:55:55 -07:00
Cullen Rhodes
a845a72a5b [AArch64][AsmParser] NFC: Remove unused ExtendOp struct
Left over from 2625a993f926 when extend and shift were merged.
2021-04-20 13:45:09 +00:00
Thomas Preud'homme
2c0468b550 Fix PR46880: Fail CHECK-NOT with undefined variable
Currently a CHECK-NOT directive succeeds whenever the corresponding
match fails. However match can fail due to an error rather than a lack
of match, for instance if a variable is undefined. This commit makes match
error a failure for CHECK-NOT.

Reviewed By: jdenny

Differential Revision: https://reviews.llvm.org/D86222
2021-04-20 14:42:46 +01:00
Sebastian Neubauer
01dd9602ed [AMDGPU] Add TransVALU to gfx10
Instructions on the transcendental unit are executed in parallel to the
normal VALU, so add this as an extra resource.

This doesn't seem to have any effect, but it should be more correct.

Differential Revision: https://reviews.llvm.org/D100123
2021-04-20 15:34:43 +02:00
Fraser Cormack
67e5cf2db6 [RISCV][NFC] Add tests for scalable-vector DAGCombiner improvements
These will all be improved by future patches.
2021-04-20 14:26:26 +01:00
Jay Foad
c58ec16acd [AMDGPU] Use if instead of foreach in a few places. NFC. 2021-04-20 14:20:30 +01:00