Commit Graph

10546 Commits

Author SHA1 Message Date
Saleem Abdulrasool
9d697e1c3c X86: treat SwiftCC as Win64_CC on Win64
The Swift CC is identical to Win64 CC with the exception of swift error
being passed in r12 which is a CSR.  However, since this calling
convention is only used in swift -> swift code, it does not impact
interoperability and can be treated entirely as Win64 CC.  We would
previously incorrectly lower the frame setup as we did not treat the
frame as conforming to Win64 specifications.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313813 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 21:00:40 +00:00
Saleem Abdulrasool
a689afa09d CodeGen: support SwiftError SwiftCC on Windows x64
Add support for passing SwiftError through a register on the Windows x64
calling convention.  This allows the use of swifterror attributes on
parameters which is used by the swift front end for the `Error`
parameter.  This partially enables building the swift standard library
for Windows x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313791 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 18:40:59 +00:00
Simon Pilgrim
652f5e624e [X86][SSE] Add PR22415 test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313755 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 13:49:52 +00:00
Florian Hahn
6aed42109d Recommit [MachineCombiner] Update instruction depths incrementally for large BBs.
This version of the patch fixes an off-by-one error causing PR34596. We
do not need to use std::next(BlockIter) when calling updateDepths, as
BlockIter already points to the next element.

Original commit message:
> For large basic blocks with lots of combinable instructions, the
> MachineTraceMetrics computations in MachineCombiner can dominate the compile
> time, as computing the trace information is quadratic in the number of
> instructions in a BB and it's relevant successors/predecessors.

> In most cases, knowing the instruction depth should be enough to make
> combination decisions. As we already iterate over all instructions in a basic
> block, the instruction depth can be computed incrementally. This reduces the
> cost of machine-combine drastically in cases where lots of instructions
> are combined. The major drawback is that AFAIK, computing the critical path
> length cannot be done incrementally. Therefore we only compute
> instruction depths incrementally, for basic blocks with more
> instructions than inc_threshold. The -machine-combiner-inc-threshold
> option can be used to set the threshold and allows for easier
> experimenting and checking if using incremental updates for all basic
> blocks has any impact on the performance.
>
> Reviewers: sanjoy, Gerolf, MatzeB, efriedma, fhahn
>
> Reviewed By: fhahn
>
> Subscribers: kiranchandramohan, javed.absar, efriedma, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D36619


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313751 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20 11:54:37 +00:00
Simon Pilgrim
9ba154704c [X86][SSE] Add 'redundant pand' test case from PR34620
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313632 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 14:02:16 +00:00
Sanjay Patel
031d34937f [x86] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313631 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 13:43:09 +00:00
Daniel Sanders
86721de9e5 [globalisel] Add support for intrinsic_w_chain.
This maps directly to G_INTRINSIC_W_SIDE_EFFECTS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313627 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 12:56:36 +00:00
Jina Nahias
eef725fc85 [x86] Lowering Mask Set1 intrinsics to LLVM IR
This patch, together with a matching clang patch (https://reviews.llvm.org/D37668), implements the lowering of X86 mask set1 intrinsics to IR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 11:03:06 +00:00
Andrei Elovikov
8632b8a5bb Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313617 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 07:56:20 +00:00
Gadi Haber
bbbe81ad6a [X86][Skylake] Adding the scheduling information for the SkylakeClient target
This patch adds the instruction scheduling information for the SkylakeClient (SKL) architecture target by adding the file X86SchedSkylakeClient.td located under the X86 Target.
We used the scheduling information retrieved from the Skylake architects in order to create the file.
The scheduling information includes latency, number of micro-Ops and used ports by each SKL instruction.
The patch continues the scheduling replacement and insertion effort started with the SNB target in r307529 and r310792 and for HSW in r311879.

Please expect some performance fluctuations due to code alignment effects.

Reviewers: craig.topper, zvi, chandlerc, igorb, aymanmus, RKSimon, delena
Differential Revision: https://reviews.llvm.org/D37294

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 06:19:27 +00:00
Craig Topper
4c92030df7 [X86] Add VPERMPD/VPERMQ and VPERMPS/VPERMD to the execution domain fixing table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313610 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-19 04:39:55 +00:00
Sanjay Patel
a3209ae52e [DAGCombiner] fold assertzexts separated by trunc
If we have an AssertZext of a truncated value that has already been AssertZext'ed, 
we can assert on the wider source op to improve the zext-y knowledge:
 assert (trunc (assert X, i8) to iN), i1 --> trunc (assert X, i1) to iN

This moves a fold from being Mips-specific to general combining, and x86 shows
improvements.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313577 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 22:05:35 +00:00
Sanjay Patel
e3402afeee [DAG, x86] allow store merging before and after legalization (PR34217)
rL310710 allowed store merging to occur after legalization to catch stores that are created late,
but this exposes a logic hole seen in PR34217:
https://bugs.llvm.org/show_bug.cgi?id=34217

We will miss merging stores if the target lowers vector extracts into target-specific operations.
This patch allows store merging to occur both before and after legalization if the target chooses
to get maximum merging.

I don't think the potential regressions in the other tests are relevant. The tests are for
correctness of weird IR constructs rather than perf tests, and I think those are still correct.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 20:54:26 +00:00
Craig Topper
1ae3ba04b8 [X86] Make sure we still emit zext for GR32 to GR64 when the source of the zext is AssertZext
The AssertZext we might see in this case is only giving information about the lower 32 bits. It isn't providing information about the upper 32 bits. So we should emit a zext.

This fixes PR28540.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313563 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 20:49:13 +00:00
Sanjay Patel
d800c2eba5 [x86] add tests for PR34217; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313548 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 18:07:50 +00:00
Simon Pilgrim
d7c4504964 [X86][AVX] Improve (i8 bitcast (v8i1 x)) handling for 256-bit vector compare results.
As commented on D37849, AVX1 targets were missing a chance to use vmovmskps for v8f32/v8i32 results for bool vector bitcasts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313547 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 17:58:31 +00:00
Sanjay Patel
fe612a2f7f [x86] regenerate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 17:33:47 +00:00
Simon Pilgrim
3632da7880 [SelectionDAG] Add BITCAST handling to ComputeNumSignBits for splatted sign bits.
For cases where we are BITCASTing to vectors of smaller elements, then if the entire source was a splatted sign (src's NumSignBits == SrcBitWidth) we can say that the dst's NumSignBit == DstBitWidth, as we're just splitting those sign bits across multiple elements.

We could generalize this but at the moment the only use case I have is to peek through bitcasts to vector comparison results.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313543 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 16:45:05 +00:00
Craig Topper
09f2a0775a [X86] Fix two more places to prefer VPERMQ/PD over VPERM2X128 when AVX2 is enabled
The shuffle combining and lowerVectorShuffleAsLanePermuteAndBlend were both still trying to use VPERM2XF128 for unary shuffles when AVX2 is enabled. VPERM2X128 takes two inputs meaning when we use it for a unary shuffle one of those inputs is left undefined creating a false dependency on whatever register gets allocated there.

If we have VPERMQ/PD we should prefer those since they only have a single input.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 16:39:49 +00:00
Simon Pilgrim
00fb00243b [X86][SSE] Improve support for vselect(Cond, 0, X) -> ANDN(Cond, X)
As discussed on PR28925 and D37849.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313532 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 14:23:23 +00:00
Simon Pilgrim
70c6728fba [X86][SSE] Add vselect with zero tests (PR28925)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313529 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 13:32:33 +00:00
Nikolai Bozhenov
289d643bfb [X86FixupBWInsts] More precise register liveness if no <imp-use> on MOVs.
Summary:
Subregister liveness tracking is not implemented for X86 backend, so
sometimes the whole super register is said to be live, when only a
subregister is really live. That might happen if the def and the use
are located in different MBBs, see added fixup-bw-isnt.mir test.

However, using knowledge of the specific instructions handled by the
bw-fixup-pass we can get more precise liveness information which this
change does.

Reviewers: MatzeB, DavidKreitzer, ab, andrew.w.kaylor, craig.topper

Reviewed By: craig.topper

Subscribers: n.bozhenov, myatsina, llvm-commits, hiraditya

Patch by Andrei Elovikov <andrei.elovikov@intel.com>

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313524 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 10:17:59 +00:00
Mohammed Agabaria
bcb17980a9 [X86][Codegen] adding masked gathers tests for avx2
related to patch: https://reviews.llvm.org/D35772
adding llvm gathers test before gathers codegen support.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 06:49:54 +00:00
Craig Topper
d28a1eae08 [X86] Teach the execution domain fixing tables to use movlhps inplace of unpcklpd for the packed single domain.
MOVLHPS has a smaller encoding than UNPCKLPD in the legacy encodings. With VEX and EVEX encodings it doesn't matter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313509 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 04:40:58 +00:00
Craig Topper
2dc0224dbf [X86] Teach execution domain fixing to convert between FP and int unpack instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313508 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 03:29:54 +00:00
Craig Topper
bcd1d60259 [X86] Teach execution domain fixing to convert between VPERMILPS and VPSHUFD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313507 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-18 03:29:47 +00:00
Craig Topper
1f42623bce [X86] Teach shuffle lowering to use MOVLHPS/MOVHLPS for lowering v4f32 unary shuffles with SSE1 only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313504 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 22:36:41 +00:00
Craig Topper
0f51ef8516 [X86] Add a couple more unary shuffles to the sse1 shuffle test.
These can be implemented with movlhps and movhlps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 22:36:39 +00:00
Jatin Bhateja
2aa82e0930 Adding test cases for PR34629 & PR34634.
Differential Revision: https://reviews.llvm.org/D37962

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313490 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 18:16:26 +00:00
Igor Breger
1183423ec5 [GlobalISel][X86] Legalize i1 G_ADD/G_SUB/G_MUL/G_XOR/G_OR/G_AND instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313483 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 11:34:17 +00:00
Igor Breger
f4b98addfb [GlobalISel][X86] Use correct physical register in mir tests.NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 08:30:42 +00:00
Igor Breger
9e0b9aa749 [GlobalISel][X86] G_FCONSTANT support.
Summary: G_FCONSTANT support, port the implementation from X86FastIsel.

Reviewers: zvi, delena, guyblank

Reviewed By: delena

Subscribers: rovka, llvm-commits, kristof.beyls

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-17 08:08:13 +00:00
Sanjay Patel
153209826e [x86] enable storeOfVectorConstantIsCheap() target hook
This allows vector-sized store merging of constants in DAGCombiner using the existing code in MergeConsecutiveStores(). 
All of the twisted logic that decides exactly what vector operations are legal and fast for each particular CPU are 
handled separately in there using the appropriate hooks.

For the motivating tests in merge-store-constants.ll, we already produce the same vector code in IR via the SLP vectorizer. 
So this is just providing a backend backstop for code that doesn't go through that pass (-O1). More details in PR24449:
https://bugs.llvm.org/show_bug.cgi?id=24449 (this change should be the last step to resolve that bug)

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313458 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 13:29:12 +00:00
Craig Topper
343595467c [X86] Add isel patterns to be able to fold loads into VPERM2F128 even when the load is on the first input to the SDNode.
We just need to toggle bits 1 and 5 of the immediate and swap the sources. The peephole pass could trigger commuting/folding for this later, but its easy enough to fix in isel.

Disable the peephole pass on the main vperm2x128 test so we know we're doing this through isel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313455 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 09:16:48 +00:00
Craig Topper
2fa59dfd39 [X86] Remove unused check lines that got left behind when I moved tests to the instrinsic upgrade file and regenerated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313454 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 09:16:46 +00:00
Craig Topper
00530eccc1 [X86] Remove the vperm2f128 test file I just added in r313450.
I missed the we already had a pretty thorough test file for these instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:51:01 +00:00
Craig Topper
20d3306cef [X86] Remove VPERM2F128/VPERM2I128 intrinsics and autoupgrade to native shuffles.
I've moved the test cases from the InstCombine optimizations to the backend to keep the coverage we had there. It covered every possible immediate so I've preserved the resulting shuffle mask for each of those immediates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:36:14 +00:00
Craig Topper
a2d920301b [X86] Fix some FileCheck lines that use the wrong prefix.
Assume they were moved during autoupgrading and not changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 07:13:39 +00:00
Craig Topper
679ad58393 [X86] Don't set reserved bits in the immediate in the test cases for vperm2f128.
I'm going to autoupgrade these intrinsics in a future commit. This bit will never be set in the resulting output so pre-removing the bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 02:11:21 +00:00
Craig Topper
b819906631 [X86] Remove slash in front of a CHECK line in a test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313433 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-16 01:43:21 +00:00
Craig Topper
4cd1955e65 [X86] Remove usages of vperm2f intrinsics from fast isel tests to match what clang generates after r313418.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 23:53:43 +00:00
Hans Wennborg
126ab47270 Revert r313343 "[X86] PR32755 : Improvement in CodeGen instruction selection for LEAs."
This caused PR34629: asserts firing when building Chromium. It also broke some
buildbots building test-suite as reported on the commit thread.

> Summary:
>    1/  Operand folding during complex pattern matching for LEAs has been
>        extended, such that it promotes Scale to accommodate similar operand
>        appearing in the DAG.
>        e.g.
>           T1 = A + B
>           T2 = T1 + 10
>           T3 = T2 + A
>        For above DAG rooted at T3, X86AddressMode will no look like
>           Base = B , Index = A , Scale = 2 , Disp = 10
>
>    2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs
>        so that if there is an opportunity then complex LEAs (having 3 operands)
>        could be factored out.
>        e.g.
>           leal 1(%rax,%rcx,1), %rdx
>           leal 1(%rax,%rcx,2), %rcx
>        will be factored as following
>           leal 1(%rax,%rcx,1), %rdx
>           leal (%rdx,%rcx)   , %edx
>
>    3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops,
>       thus avoiding creation of any complex LEAs within a loop.
>
> Reviewers: lsaba, RKSimon, craig.topper, qcolombet
>
> Reviewed By: lsaba
>
> Subscribers: spatel, igorb, llvm-commits
>
> Differential Revision: https://reviews.llvm.org/D35014

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313376 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 18:40:26 +00:00
Craig Topper
46f3eda2f5 [X86] Prefer VPERMQ over VPERM2F128 for any unary shuffle, not just the ones that can be done with a insertf128
The early out for AVX2 in lowerV2X128VectorShuffle is positioned in a weird spot below some shuffle mask equivalency checks.

But I think we want to allow VPERMQ for any unary shuffle.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 18:11:13 +00:00
Craig Topper
dca8ff7a7d [X86] Don't create i64 constants on 32-bit targets when lowering v64i1 constant build vectors
When handling a v64i1 build vector of constants on 32-bit targets we were creating an illegal i64 constant that we then bitcasted back to v64i1. We need to instead create two 32-bit constants, bitcast them to v32i1 and concat the result. We should also take care to handle the halves being all zeros/ones after the split.

This patch splits the build vector and then recursively lowers the two pieces. This allows us to handle the all ones and all zeros cases with minimal effort. Ideally we'd just do the split and concat, and let lowering get called again on the new nodes, but getNode has special handling for CONCAT_VECTORS that reassembles the pieces back into a single BUILD_VECTOR. Hopefully the two temporary BUILD_VECTORS we had to create to do this that don't get returned don't cause any issues.

Fixes PR34605.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 17:09:03 +00:00
Craig Topper
566eb704ab [X86] Add isel pattern infrastructure to begin recognizing when we're inserting 0s into the upper portions of a vector register and the producing instruction as already produced the zeros.
Currently if we're inserting 0s into the upper elements of a vector register we insert an explicit move of the smaller register to implicitly zero the upper bits. But if we can prove that they are already zero we can skip that. This is based on a similar idea of what we do to avoid emitting explicit zero extends for GR32->GR64.

Unfortunately, this is harder for vector registers because there are several opcodes that don't have VEX equivalent instructions, but can write to XMM registers. Among these are SHA instructions and a MMX->XMM move. Bitcasts can also get in the way.

So for now I'm starting with explicitly allowing only VPMADDWD because we emit zeros in combineLoopMAddPattern. So that is placing extra instruction into the reduction loop.

I'd like to allow PSADBW as well after D37453, but that's currently blocked by a bitcast. We either need to peek through bitcasts or canonicalize insert_subvectors with zeros to remove bitcasts on the value being inserted.

Longer term we should probably have a cleanup pass that removes superfluous zeroing moves even when the producer is in another basic block which is something these isel tricks can't do. See PR32544.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 17:09:00 +00:00
Simon Pilgrim
fc31426768 [X86][SSE] Add test cases vector for integer multiplies
Mainly inspired by PR34474 / D37896

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 11:17:42 +00:00
Jatin Bhateja
37c3b169a5 [X86] PR32755 : Improvement in CodeGen instruction selection for LEAs.
Summary:
   1/  Operand folding during complex pattern matching for LEAs has been
       extended, such that it promotes Scale to accommodate similar operand
       appearing in the DAG.
       e.g.
          T1 = A + B
          T2 = T1 + 10
          T3 = T2 + A
       For above DAG rooted at T3, X86AddressMode will no look like
          Base = B , Index = A , Scale = 2 , Disp = 10

   2/  During OptimizeLEAPass down the pipeline factorization is now performed over LEAs
       so that if there is an opportunity then complex LEAs (having 3 operands)
       could be factored out.
       e.g.
          leal 1(%rax,%rcx,1), %rdx
          leal 1(%rax,%rcx,2), %rcx
       will be factored as following
          leal 1(%rax,%rcx,1), %rdx
          leal (%rdx,%rcx)   , %edx

   3/ Aggressive operand folding for AM based selection for LEAs is sensitive to loops,
      thus avoiding creation of any complex LEAs within a loop.

Reviewers: lsaba, RKSimon, craig.topper, qcolombet

Reviewed By: lsaba

Subscribers: spatel, igorb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313343 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-15 05:29:51 +00:00
Simon Pilgrim
da89c08512 [X86] Regenerate test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313259 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 13:00:27 +00:00
Simon Pilgrim
2664884ef8 Regenerate test (broadcast comment). NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 12:41:19 +00:00
Ayman Musa
8493f91192 [X86] When applying the shuffle-to-zero-extend transformation on floating point, bitcast to integer first.
Fix issue described in PR34577.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14 12:06:38 +00:00