Commit Graph

31641 Commits

Author SHA1 Message Date
Sam Parker ac0f4f5b2f [NFC][ARM][MVE] More tests
Add some loop tests that cover different float operations and types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373192 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 08:49:42 +00:00
Hans Wennborg f608f8a7c1 Pre-commit a test case for PR43129.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373190 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 08:47:46 +00:00
Sam Parker 132df1d1cd [ARM][MVE] Change VCTP operand
The VCTP instruction will calculate the predicate masked based upon
the number of elements that need to be processed. I had inserted the
sub before the vctp intrinsic and supplied it as the operand, but
this is incorrect as the phi should directly feed the vctp. The sub
is calculating the value for the next iteration.

Differential Revision: https://reviews.llvm.org/D67921

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373188 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 08:03:23 +00:00
Roger Ferrer Ibanez ca6e7338d6 [TargetLowering] Simplify expansion of S{ADD,SUB}O
ISD::SADDO uses the suggested sequence described in the section §2.4 of
the RISCV Spec v2.2. ISD::SSUBO uses the dual approach but checking for
(non-zero) positive.

Differential Revision: https://reviews.llvm.org/D47927

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373187 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 07:58:50 +00:00
Sam Parker 58649a3897 [ARM][CGP] Allow signext arguments
As we perform a zext on any arguments used in the promoted tree, it
doesn't matter if they're marked as signext. The only permitted
user(s) in the tree which would interpret the sign bits are signed
icmps. For these instructions, their promoted operands are truncated
before the icmp uses them.

Differential Revision: https://reviews.llvm.org/D68019

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373186 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 07:52:10 +00:00
Jonas Paulsson 3adcef5bd4 [SystemZ] Add SystemZPostRewrite in addPostRegAlloc() instead at -O0.
SystemZPostRewrite needs to be run before (it may emit COPYs) the Post-RA
pseudo pass also at -O0, so it should be added in addPostRegAlloc().

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373182 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 07:29:54 +00:00
Matt Arsenault fe518bfae1 AMDGPU/GlobalISel: Fix select for v2s16 and/or/xor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373180 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 06:31:30 +00:00
Fangrui Song 3383e0bc3c [test] Change llvm-readobj --arm-attributes to --arch-specific after r373125
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373179 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 04:45:14 +00:00
Craig Topper eb6715931a [X86] Split v16i32/v8i64 bitreverse on avx512f targets without avx512bw to enable the use of vpshufb on the 256-bit halves.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373177 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-30 03:14:38 +00:00
Craig Topper fd32ab2eb9 [X86] Add custom isel logic to match VPTERNLOG from 2 logic ops.
There's room from improvement here, but this is a decent
starting point.

There are a few minor regressions in the vector-rotate tests,
where we are now forming a vpternlog from an and before we get
a chance to form it for a bitselect that we were matching
previously. This results in an AND and an ANDN feeding the
vpternlog where previously we just had an AND after the
vpternlog. I think we can probably DAG combine the AND with
the bitselect to get back to similar codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373172 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 18:43:08 +00:00
Amaury Sechet af884a78b1 Add test case peeking through vector concat when combining insert into shuffles. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373171 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 17:54:03 +00:00
David Green 63b13eaf70 [ARM] Cortex-M4 schedule additions
This is an attempt to fill in some of the missing instructions from the
Cortex-M4 schedule, and make it easier to do the same for other ARM cpus.

- Some instructions are marked as hasNoSchedulingInfo as they are pseudos or
  otherwise do not require scheduling info
- A lot of features have been marked not supported
- Some WriteRes's have been added for cvt instructions.
- Some extra instruction latencies have been added, notably by relaxing the
  regex for dsp instruction to catch more cases, and some fp instructions.

This goes a long way to get the CompleteModel working for this CPU. It does not
go far enough as to get all scheduling info for all output operands correct.

Differential Revision: https://reviews.llvm.org/D67957


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373163 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 08:38:48 +00:00
Craig Topper eccfe58ab8 [X86] Enable isel to fold broadcast loads that have been bitcasted from FP into a vpternlog.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373157 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 01:24:33 +00:00
Craig Topper 52bde850c7 [X86] Move bitselect matching to vpternlog into X86ISelDAGToDAG.cpp
This allows us to reduce the use count on the condition node before
the match. This enables load folding for that operand without
relying on the peephole pass. This will be improved on for
broadcast load folding in a subsequent commit.

This still requires a bunch of isel patterns for vXi16/vXi8 types
though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373156 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 01:24:29 +00:00
Craig Topper ab6082193d [X86] Enable canonicalizeBitSelect for AVX512 since we can use VPTERNLOG now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373155 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 01:24:22 +00:00
Craig Topper c51855f457 [X86] Match (or (and A, B), (andn (A, C))) to VPTERNLOG with AVX512.
This uses a similar isel pattern as we used for vpcmov with XOP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373154 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-29 01:24:16 +00:00
Sanjay Patel 2beb21d7cd [PowerPC] make tests immune to improved undef handling
The fma mutate test will not exercise what it was intended to test
once we simplify those ops immediately, but the test will still
pass with the existing CHECKs, so I'm leaving it in case that
still has minimal value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373149 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 13:34:53 +00:00
Amara Emerson 0134b97df5 [GlobalISel Enable memcpy inlining with optsize.
We should be disabling inline for minsize, not optsize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373143 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 07:55:42 +00:00
Amara Emerson 4818f426ab Add an operand to memory intrinsics to denote the "tail" marker.
We need to propagate this information from the IR in order to be able to safely
do tail call optimizations on the intrinsics during legalization. Assuming
it's safe to do tail call opt without checking for the marker isn't safe because
the mem libcall may use allocas from the caller.

This adds an extra immediate operand to the end of the intrinsics and fixes the
legalizer to handle it.

Differential Revision: https://reviews.llvm.org/D68151

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373140 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 05:33:21 +00:00
Craig Topper 44a5d295cb [X86] Add broadcast load unfolding support for VPTESTMD/Q and VPTESTNMD/Q.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373138 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 01:56:36 +00:00
Craig Topper 056d51bf2f [X86] Split combineGatherScatter into a version for generic ISD nodes and another version for X86 specific nodes.
The majority of the code doesn't run on the X86 nodes today since
its gated by isBeforeLegalizeOps and we don't formm X86 nodes
until after that. Except for a couple special case in type
legalization. But I think we would probably break those if
some of the transforms fire on them.

I want to remove the hardcoded operand numbers and the unusual
use of UpdateNodeOperands. Being able to know which ISD opcodes
are present should help with that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373136 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 01:06:58 +00:00
Craig Topper 336896a764 [X86] Add test case to show missed opportunity to turn (add (zext (vXi1 X)), Y) -> (sub Y, (sext (vXi1 X))) with avx512.
With avx512, the vXi1 type is legal. And we can more easily sign
extend them to vector registers. zext requires a sign extend and
a shift.

If we can easily turn the zext into a sext we should.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373131 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 22:30:24 +00:00
Jakub Kuderski c21089a72e Revert XFAIL a codegen test AArch64/tailmerging_in_mbp.ll
This reverts r373103 (git commit a524e630a793e18e7d5fabc2262781f310eb0279)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373116 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 19:33:35 +00:00
Craig Topper 4c5beb9721 [X86] Call SimplifyDemandedBits in combineGatherScatter any time the mask element is wider than i1, not just when AVX512 is disabled.
The AVX2 intrinsics can still be used when AVX512 is enabled and
those go through this path. So we should simplify them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373108 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 18:23:55 +00:00
Craig Topper 5d34241603 [X86] Add test case to show failure to perform SimplifyDemandedBits on mask of avx2 gather intrinsics when avx512 is enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373107 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 18:23:46 +00:00
Jakub Kuderski 0a5153da47 XFAIL a codegen test AArch64/tailmerging_in_mbp.ll
This test fails when machine dominator tree verifier is run.
Needs more investigation, as this is not a new failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373103 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 17:41:17 +00:00
Kai Nacke 12e921eb1b Change -march=systemz to triple and fix test
These two test cases use -march=systemz instead of a triple. In
particular, the used file format is then based on the default host
triple. This leads to different behaviour on different platforms.

The SystemZ implementation uses the integrated assembler for a
long time now. The mature-mc-support test can be fully enabled.

Differential Revision: https://reviews.llvm.org/D68129

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373098 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 16:19:15 +00:00
Jesper Antonsson fd525cdd72 [CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.
Summary:
An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst()  in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was:
 https://bugs.llvm.org/show_bug.cgi?id=41052
... and the previous fix was D59358.

Reviewers: aprantl, skatkov

Reviewed By: skatkov

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67838

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373084 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 13:01:37 +00:00
Sam Parker b2ca77376c [NFC][ARM] Add some tail-predication tests
Use different data types for some simple loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373064 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 10:33:53 +00:00
Hans Wennborg e15a2ad07a Revert r372893 "[CodeGen] Replace -max-jump-table-size with -max-jump-table-targets"
This caused severe compile-time regressions, see PR43455.

> Modern processors predict the targets of an indirect branch regardless of
> the size of any jump table used to glean its target address.  Moreover,
> branch predictors typically use resources limited by the number of actual
> targets that occur at run time.
>
> This patch changes the semantics of the option `-max-jump-table-size` to limit
> the number of different targets instead of the number of entries in a jump
> table.  Thus, it is now renamed to `-max-jump-table-targets`.
>
> Before, when `-max-jump-table-size` was specified, it could happen that
> cluster jump tables could have targets used repeatedly, but each one was
> counted and typically resulted in tables with the same number of entries.
> With this patch, when specifying `-max-jump-table-targets`, tables may have
> different lengths, since the number of unique targets is counted towards the
> limit, but the number of unique targets in tables is the same, but for the
> last one containing the balance of targets.
>
> Differential revision: https://reviews.llvm.org/D60295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373060 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 09:54:26 +00:00
Thomas Lively 900f4bd9f0 [WebAssembly] v128.andnot
Summary:
As specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#bitwise-and-not

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68113

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373041 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 02:11:40 +00:00
Thomas Lively 24dca8fbcd [WebAssembly] SIMD Load and extend operations
Summary:
As specified at
https://github.com/webassembly/simd/blob/master/proposals/simd/SIMD.md#load-and-extend.
These instructions are behind the unimplemented-simd128 target feature
for now because they have not been implemented in V8 yet.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D68058

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373040 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 02:06:50 +00:00
Peter Collingbourne dfacff4e9c hwasan: Compatibility fixes for short granules.
We can't use short granules with stack instrumentation when targeting older
API levels because the rest of the system won't understand the short granule
tags stored in shadow memory.

Moreover, we need to be able to let old binaries (which won't understand
short granule tags) run on a new system that supports short granule
tags. Such binaries will call the __hwasan_tag_mismatch function when their
outlined checks fail. We can compensate for the binary's lack of support
for short granules by implementing the short granule part of the check in
the __hwasan_tag_mismatch function. Unfortunately we can't do anything about
inline checks, but I don't believe that we can generate these by default on
aarch64, nor did we do so when the ABI was fixed.

A new function, __hwasan_tag_mismatch_v2, is introduced that lets code
targeting the new runtime avoid redoing the short granule check. Because tag
mismatches are rare this isn't important from a performance perspective; the
main benefit is that it introduces a symbol dependency that prevents binaries
targeting the new runtime from running on older (i.e. incompatible) runtimes.

Differential Revision: https://reviews.llvm.org/D68059

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373035 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-27 01:02:10 +00:00
Craig Topper 4b4fd737fd [X86] Add VMOVSSZrrk/VMOVSDZrrk/VMOVSSZrrkz/VMOVSDZrrkz to getUndefRegClearance.
We have isel patterns that can put an IMPLICIT_DEF on one of
the sources for these instructions. So we should make sure
we break any dependencies there. This should be done by
just using one of the other sources.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373025 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 22:56:06 +00:00
Craig Topper d27d2d709e [X86] Add CodeGenOnly instructions for (f32 (X86selects $mask, (loadf32 addr), fp32imm0) to use masked MOVSS from memory.
Similar for f64 and having a non-zero passthru value.

We were previously not trying to fold the load at all. Using
a CodeGenOnly instruction allows us to use FR32X/FR64X as the
register class to avoid a bunch of COPY_TO_REGCLASS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373021 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 22:23:09 +00:00
Roman Lebedev bb5c50ca7d [DAGCombine][X86][AArch64][NFC] Add tests for shift-by-signext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373014 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 20:49:49 +00:00
Xiangling Liao c58a5d49af [AIX]Emit function descriptor csect in assembly
This patch emits the function descriptor csect for functions with definitions
under both 32-bit/64-bit mode on AIX.

Differential Revision: https://reviews.llvm.org/D66724

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373009 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 19:38:32 +00:00
Jinsong Ji 8685e52545 [PowerPC] Add missing pattern for VSX Scalar Negative Multiply-Subtract Single Precision
Summary:
This was found during review of https://reviews.llvm.org/D66050.
In the simple test of fdiv, we miss to fold
```
        fneg 2, 2
        xsmaddasp 3, 2, 0
```
to
```
        xsnmsubasp 3, 2, 0
```
We have the patterns for Double Precision and vectors, just missing
Single Precision, the patch add that.

Reviewers: #powerpc, hfinkel, nemanjai, steven.zhang

Reviewed By: #powerpc, steven.zhang

Subscribers: wuzish, hiraditya, kbarton, MaskRay, shchenz, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67595

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372985 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 15:11:33 +00:00
Petar Avramovic c8116a946b [MIPS GlobalISel] Lower aggregate structure return arguments
Implement aggregate structure split to simpler types in splitToValueTypes.
splitToValueTypes is used for return values.
According to MipsABIInfo from clang/lib/CodeGen/TargetInfo.cpp,
aggregate structure arguments for O32 always get simplified and thus
will remain unsupported by the MIPS GlobalISel for the time being.
For O32, aggregate structures can be encountered only for complex number
returns e.g. 'complex float' or 'complex double' from <complex.h>.

Differential Revision: https://reviews.llvm.org/D67963


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372957 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 10:48:07 +00:00
Jonas Paulsson c0a66ac414 [SystemZ] Recognize mnop-mcount in backend
With -pg -mfentry -mnop-mcount, a nop is emitted instead of the call to
fentry.

Review: Ulrich Weigand
https://reviews.llvm.org/D67765

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372950 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 08:38:07 +00:00
Mikael Holmen 91fdf5127f [IfConversion] Disallow TBB == FBB for valid triangles
Summary:
Previously the case

     EBB
     | \_
     |  |
     | TBB
     |  /
     FBB

was treated as a valid triangle also when TBB and FBB was the same basic
block. This could then lead to an invalid CFG when we removed the edge
from EBB to TBB, since that meant we would also remove the edge from EBB
to FBB.

Since TBB == FBB is quite a degenerated case of a triangle, we now
don't treat it as a valid triangle anymore, and thus we will avoid the
trouble with updating the CFG.

Reviewers: efriedma, dmgreen, kparzysz

Reviewed By: efriedma

Subscribers: bjope, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67832

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 06:35:55 +00:00
Craig Topper dcdbbe2ec4 [X86] Mark the EVEX encoded PSADBW instructions as commutable to enable load folding of the other operand.
The SSE and VEX versions are already correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372941 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-26 04:42:58 +00:00
Nick Desaulniers 67cd776307 [Verifier] add invariant check for callbr
Summary:
The list of indirect labels should ALWAYS have their blockaddresses as
argument operands to the callbr (but not necessarily the other way
around).  Add an invariant that checks this.

The verifier catches a bad test case that was added recently in r368478.
I think that was a simple mistake, and the test was made less strict in
regards to the precise addresses (as those weren't specifically the
point of the test).

This invariant will be used to find a reported bug.

Link: https://www.spinics.net/lists/arm-kernel/msg753473.html
Link: https://github.com/ClangBuiltLinux/linux/issues/649

Reviewers: craig.topper, void, chandlerc

Reviewed By: void

Subscribers: ychen, lebedev.ri, javed.absar, kristof.beyls, hiraditya, llvm-commits, srhines

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67196

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372923 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 22:28:27 +00:00
Vadzim Dambrouski cbcdc5db51 [MSP430] Allow msp430_intrcc functions to not have interrupt attribute.
Summary:
Useful in case you want to have control over interrupt vector generation.
For example in Rust language we have an arrangement where all unhandled
ISR vectors gets mapped to a single default handler function. Which is
hard to implement when LLVM tries to generate vectors on its own.

Reviewers: asl, krisb

Subscribers: hiraditya, JDevlieghere, awygle, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67313

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372910 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 18:58:07 +00:00
Stanislav Mekhanoshin 336dc6d0e8 [AMDGPU] Improve fma.f64 test. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372908 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 18:50:34 +00:00
Stanislav Mekhanoshin 6edc006701 [AMDGPU] gfx10 v_fmac_f16 operand folding
Fold immediates into v_fmac_f16.

Differential Revision: https://reviews.llvm.org/D68037

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372906 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 18:40:20 +00:00
Jessica Paquette 126b679a29 [AArch64][GlobalISel] Choose CCAssignFns per-argument for tail call lowering
When checking for tail call eligibility, we should use the correct CCAssignFn
for each argument, rather than just checking if the caller/callee is varargs or
not.

This is important for tail call lowering with varargs. If we don't check it,
then basically any varargs callee with parameters cannot be tail called on
Darwin, for one thing. If the parameters are all guaranteed to be in registers,
this should be entirely safe.

On top of that, not checking for this could potentially make it so that we have
the wrong stack offsets when checking for tail call eligibility.

Also refactor some of the stuff for CCAssignFnForCall and pull it out into a
helper function.

Update call-translator-tail-call.ll to show that we can now correctly tail call
on Darwin. Also add two extra tail call checks. The first verifies that we still
respect the caller's stack size, and the second verifies that we still don't
tail call when a varargs function has a memory argument.

Differential Revision: https://reviews.llvm.org/D67939

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372897 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 16:45:35 +00:00
Evandro Menezes bd5ddbcfeb [CodeGen] Replace -max-jump-table-size with -max-jump-table-targets
Modern processors predict the targets of an indirect branch regardless of
the size of any jump table used to glean its target address.  Moreover,
branch predictors typically use resources limited by the number of actual
targets that occur at run time.

This patch changes the semantics of the option `-max-jump-table-size` to limit
the number of different targets instead of the number of entries in a jump
table.  Thus, it is now renamed to `-max-jump-table-targets`.

Before, when `-max-jump-table-size` was specified, it could happen that
cluster jump tables could have targets used repeatedly, but each one was
counted and typically resulted in tables with the same number of entries.
With this patch, when specifying `-max-jump-table-targets`, tables may have
different lengths, since the number of unique targets is counted towards the
limit, but the number of unique targets in tables is the same, but for the
last one containing the balance of targets.

Differential revision: https://reviews.llvm.org/D60295

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372893 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 16:10:20 +00:00
Sanjay Patel d7ca0d78e9 [DAGCombiner] add one-use restriction to vector transform with cheap extract
We might be able to do better on the example in the test,
but in general, we should not scalarize a splatted vector
binop if there are other uses of the binop. Otherwise, we
can end up with code as we had - a scalar op that is
redundant with a vector op.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372886 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 15:08:33 +00:00
Sanjay Patel 17118e5be7 [x86] add test for multi-use scalarization of vector binop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372883 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-25 14:57:45 +00:00