Commit Graph

27003 Commits

Author SHA1 Message Date
Sanjay Patel 2ef4e14af3 [DAGCombiner] allow undef elts in vector fmul matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344534 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 16:54:07 +00:00
Sanjay Patel 772e632e25 [AArch64] add tests for fmul x, -2.0 with undef elts; NFC
Also, add tests with commuted operands. There was no coverage for that case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344531 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 16:44:00 +00:00
Sanjay Patel 907565571c [DAGCombiner] allow undef elts in vector fma matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344528 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 15:56:39 +00:00
Sanjay Patel 0ea7fc0dde [x86] add tests for fma with undef elts; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344527 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 15:47:37 +00:00
Sanjay Patel fb06745cac [DAGCombiner] allow undef elts in vector fma matching
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344525 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 15:38:38 +00:00
Sanjay Patel 8559689cb2 [x86] add tests for fma with undef elts; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344523 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 15:28:44 +00:00
Simon Pilgrim 7f770f7d21 [ARM][NEON] Improve vector popcnt lowering with PADDL (PR39281)
As I suggested on PR39281, this patch uses PADDL pairwise addition to widen from the vXi8 CTPOP result to the target vector type.

This is a blocker for moving more x86 code to generic vector CTPOP expansion (P32655 + D53258) - ARM's vXi64 CTPOP currently expands, which would generate a vXi64 MUL but ARM's custom lowering expands the general MUL case and vectors aren't well handled in LegalizeDAG - improving the CTPOP lowering was a lot easier than fixing the MUL lowering for this one case......

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344512 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 13:20:41 +00:00
Nicolai Haehnle 69b3f302bf AMDGPU: Test showing a scalar buffer load deficiency
Change-Id: I5b64a565f22a8482aa0712488d85e45163ac3d12

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344506 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 11:37:04 +00:00
Bjorn Pettersson ffc5ec8c81 [TwoAddressInstructionPass] Replace subregister uses when processing tied operands
Summary:
TwoAddressInstruction pass typically rewrites
  %1:short = foo %0.sub_lo:long
as
  %1:short = COPY %0.sub_lo:long
  %1:short = foo %1:short
when having tied operands.

If there are extra un-tied operands that uses the same reg and
subreg, such as the second and third inputs to fie here:
  %1:short = fie %0.sub_lo:long, %0.sub_hi:long, %0.sub_lo:long
then there was a bug which replaced the register %0 also for
the un-tied operand, but without changing the subregister indices.
So we used to get:
  %1:short = COPY %0.sub_lo:long
  %1:short = fie %1, %1.sub_hi:short, %1.sub_lo:short
With this fix we instead get:
  %1:short = COPY %0.sub_lo:long
  %1:short = fie %1, %0.sub_hi:long, %1

Reviewers: arsenm, JesperAntonsson, kparzysz, MatzeB

Reviewed By: MatzeB

Subscribers: bjope, kparzysz, wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 08:36:03 +00:00
Craig Topper 15ca92098a [X86] Autogenerate checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344490 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 05:31:24 +00:00
Craig Topper a0b9470673 [X86] Move promotion of vector and/or/xor from legalization to DAG combine
Summary:
I've noticed that the bitcasts we introduce for these make computeKnownBits and computeNumSignBits not work well in LegalizeVectorOps. LegalizeVectorOps legalizes bottom up while LegalizeDAG legalizes top down. The bottom up strategy for LegalizeVectorOps means operands are legalized before their uses. So we promote and/or/xor before we legalize the operands that use them making computeKnownBits/computeNumSignBits in places like LowerTruncate suboptimal. I looked at changing LegalizeVectorOps to be top down as well, but that was more disruptive and caused some regressions. I also looked at just moving promotion of binops to LegalizeDAG, but that had a few issues one around matching AND,ANDN,OR into VSELECT because I had to create ANDN as vXi64, but the other nodes hadn't legalized yet, I didn't look too hard at fixing that.

This patch seems to produce better results overall than my other attempts. We now form broadcasts of constants better in some cases. For at least some of them the AND was being introduced in LegalizeDAG, promoted to vXi64, and the BUILD_VECTOR was also legalized there. I think we got bad ordering of that. Now the promotion is out of the legalizer so we handle this better.

In the longer term I think we really should evaluate whether we should be doing this promotion at all. It's really there to reduce isel pattern count, but I'm wondering if we'd be better served just eating the pattern cost or doing C++ based isel for vector and/or/xor in X86ISelDAGToDAG. The masked and/or/xor will definitely be difficult in patterns if a bitcast gets between the vselect and the and/or/xor node. That becomes a lot of permutations to cover.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 01:51:58 +00:00
Craig Topper 5854a1f283 [X86] Add 128 MOVDDUP to the constant pool printing in X86AsmPrinter::EmitInstruction.
We use this instruction to broadcast a single 64-bit value to a v2i64/v2f64 vector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344486 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 01:51:53 +00:00
Craig Topper be51e5f963 [X86] Autogenerate complete checks. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344485 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-15 01:51:50 +00:00
Simon Pilgrim d92ffe6698 [X86][AVX] Enable lowerVectorShuffleAsLanePermuteAndPermute v16i16/v32i8 shuffle lowering
Extends D53148 from v4f64 now that we have test coverage for v16i16/v32i8 shuffles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344481 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-14 17:34:20 +00:00
Simon Pilgrim 7e9c8da5fd [ARM] Regenerate cttz tests
Improve codegen view as part of PR32655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-14 16:49:04 +00:00
Craig Topper 1ccfde68b8 [X86] Type legalize v2f32 stores by widening to v4f32, casting to v2f64, extracting f64 and storing.
Summary: This is similar to what D52528 did for loads. It should match what generic type legalization does in 64-bit mode where it uses a v2i64 cast and an i64 store.

Reviewers: RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344470 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-14 03:36:27 +00:00
Simon Pilgrim cc018b73f8 [AARCH64] Regenerate popcnt tests
Improve codegen view as part of PR32655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344466 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 21:50:15 +00:00
Simon Pilgrim 1289860732 [ARM] Regenerate popcnt tests
Improve codegen view as part of PR32655

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344465 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 21:32:49 +00:00
Craig Topper ebbe713579 [LegalizeTypes] Prevent an assertion from PromoteIntRes_BSWAP and PromoteIntRes_BITREVERSE if the shift amount is too large for the VT returned by getShiftAmountTy
Summary:
getShiftAmountTy for X86 returns MVT::i8. If a BSWAP or BITREVERSE is created that requires promotion and the difference between the original VT and the promoted VT is more than 255 then we won't able to create the constant.

This patch adds a check to replace the result from getShiftAmountTy to MVT::i32 if the difference won't fit. This should get legalized later when the shift is ultimately expanded since its clearly an illegal type that we're only promoting to make it a power of 2 bit width. Alternatively we could base the decision completely on the largest shift amount the promoted VT could use.

Vectors should be immune here because getShiftAmountTy always returns the incoming VT for vectors. Only the scalar shift amount can be changed by the targets.

Reviewers: eli.friedman, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344460 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 17:47:20 +00:00
Simon Pilgrim 097be3b516 [X86][SSE] combineIncDecVector - use isConstantSplat
Use isConstantSplat instead of ISD::isConstantSplatVector to let us us peek through to illegal types (in this case for i686 targets to recognise i64 constants)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344452 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 14:45:44 +00:00
Simon Pilgrim 3b18a97f3a [X86][SSE] Improve CTTZ lowering when CTLZ is legal
If we have better CTLZ support than CTPOP, then use cttz(x) = width - ctlz(~x & (x - 1)) - and remove the CTTZ_ZERO_UNDEF handling as it no longer gives better codegen.

Similar to rL344447, this is also closer to LegalizeDAG's approach

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344448 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 13:05:19 +00:00
Simon Pilgrim e76d709902 [X86][SSE] Change CTTZ vector lowering to cttz(x) = ctpop(~x & (x - 1))
This patch changes the vector CTTZ lowering from:

cttz(x) = ctpop((x & -x) - 1)

to:

cttz(x) = ctpop(~x & (x - 1))

Not only does this make better use of the PANDN instruction, but it also matches the LegalizeDAG method which should allow us to remove the x86 specific code at some point in the future (we need to fix some issues with the bitcasted logic ops and CTPOP lowering first).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344447 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 12:12:06 +00:00
Simon Pilgrim 0f13604417 [X86][AVX] Add lowerVectorShuffleAsLanePermuteAndPermute for v4f64 shuffles (PR39161)
Add shuffle lowering for the case where we can shuffle the lanes into place followed by an in-lane permute.

This is mainly for cases where we can have non-repeating permutes in each lane, but for now I've just enabled it for v4f64 unary shuffles to fix PR39161 - there is no test coverage for other shuffles that might benefit yet.

We now have several cross-lane shuffle lowering methods that all do something similar - I've looked at merging some of these (notably by making the repeated mask mechanism in lowerVectorShuffleByMerging128BitLanes optional), but there is a lot of assertions/assumptions in the way that makes this tricky - I ended up going for adding yet another relatively simple method instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344446 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 11:38:10 +00:00
Arnaud A. de Grandmaison 952b7309b1 [AArch64] Swap comparison operands if that enables some folding.
Summary:
AArch64 can fold some shift+extend operations on the RHS operand of
comparisons, so swap the operands if that makes sense.

This provides a fix for https://bugs.llvm.org/show_bug.cgi?id=38751

Reviewers: efriedma, t.p.northover, javed.absar

Subscribers: mcrosier, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344439 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 07:43:56 +00:00
Thomas Lively 3baba1cf36 [WebAssembly] SIMD min and max
Summary: Depends on D52324 and D52764.

Reviewers: aheejin, dschuff

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344438 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-13 07:26:10 +00:00
Alex Bradbury 56ebea371f [RISCV] Eliminate unnecessary masking of promoted shift amounts
SelectionDAGBuilder::visitShift will always zero-extend a shift amount when it
is promoted to the ShiftAmountTy. This results in zero-extension (masking)
which is unnecessary for RISC-V as the shift operations only read the lower 5
or 6 bits (RV32 or RV64).

I initially proposed adding a getExtendForShiftAmount hook so the shift amount
can be any-extended (D52975). @efriedma explained this was unsafe, so I have
instead eliminate the unnecessary and operations at instruction selection time
in a manner similar to X86InstrCompiler.td.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344432 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 23:18:52 +00:00
Craig Topper bb098ae625 [X86] Improve type legalization of (v2i32/v4i16/v8i16 (bitcast (v2f32))) to avoid a stack stack temporary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344425 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 22:00:04 +00:00
Craig Topper 5650e8ff90 [LegalizeVectorTypes] When widening the result of a bitcast from a scalar type, use a scalar_to_vector to turn the scalar into a vector intead of a build vector full of mostly undefs.
This is more consistent with what we usually do and matches some code X86 custom emits in some cases that I think I can cleanup.

The MIPS test change just looks to be an instruction ordering change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344422 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 21:59:55 +00:00
Craig Topper c646992975 [LegalizeVectorTypes] When widening the operands to a concat_vectors, see if we can use the widened operand 0 if the width matches and the other operands are undef.
This saves a conversion to extracts and build_vector. We already do this when both the result and the input need to be widened to the same type.

This changed the sse-intrinsics-fast-isel test because we don't lower (insert_vector_elt (scalar_to_vector X), Y, 1) well. We turn it into (vector_shuffle (scalar_to_vector X), (scalar_to_vector Y), <0, 4, 2, 3>) losing track of the fact that the upper elts could be undef.

We should probably find a way to prevent the scalarization of the <2 x f32> load on these tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344404 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 19:37:49 +00:00
Simon Pilgrim c27563a142 Regenerate test. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 19:03:54 +00:00
Sanjay Patel 8f99faa030 [x86] add and use fast horizontal vector math subtarget feature
This is the planned follow-up to D52997. Here we are reducing horizontal vector math codegen 
by default. AMD Jaguar (btver2) should have no difference with this patch because it has 
fast-hops. (If we want to set that bit for other CPUs, let me know.)

The code changes are small, but there are many test diffs. For files that are specifically 
testing for hops, I added RUNs to distinguish fast/slow, so we can see the consequences 
side-by-side. For files that are primarily concerned with codegen other than hops, I just 
updated the CHECK lines to reflect the new default codegen.

To recap the recent horizontal op story:

1. Before rL343727, we were producing hops for all subtargets for a variety of patterns. 
   Hops were likely not optimal for all targets though.
2. The IR improvement in r343727 exposed a hole in the backend hop pattern matching, so 
   we reduced hop codegen for all subtargets. That was bad for Jaguar (PR39195).
3. We restored the hop codegen for all targets with rL344141. Good for Jaguar, but 
   probably bad for other CPUs.
4. This patch allows us to distinguish when we want to produce hops, so everyone can be 
   happy. I'm not sure if we have the best predicate here, but the intent is to undo the 
   extra hop-iness that was enabled by r344141.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344361 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:41:02 +00:00
Nick Desaulniers b609135fc9 [MC][ELF] fix newly added test
Summary:
Reland of
- r344197 "[MC][ELF] compute entity size for explicit sections"
- r344206 "[MC][ELF] Fix section_mergeable_size.ll"
after being reverted in r344278 due to build breakages from not
specifying a target triple.

Move test from test/CodeGen/Generic/ to test/MC/ELF/.
Add explicit target triple so we don't try to run
this test on non ELF targets.

Reported: https://reviews.llvm.org/D53056#1261707

Reviewers: fhahn, rnk, espindola, NoQ

Reviewed By: fhahn, rnk

Subscribers: NoQ, MaskRay, rengolin, emaste, arichardson, llvm-commits, pirama, srhines

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344360 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:35:44 +00:00
Zachary Turner d5e155bacd Make YAML quote forward slashes.
If you have the string /usr/bin, prior to this patch it would not
be quoted by our YAML serializer.  But a string like C:\src would
be, due to the presence of a backslash.  This makes the quoting
rules of basically every single file path different depending on
the path syntax (posix vs. Windows).

While technically not required by the YAML specification to quote
forward slashes, when the behavior of paths is inconsistent it
makes it difficult to portably write FileCheck lines that will
work with either kind of path.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344359 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:31:20 +00:00
Zachary Turner 7b3c188641 Revert "Make YAML quote forward slashes."
This reverts commit b86c16ad8c97dadc1f529da72a5bb74e9eaed344.

This is being reverted because I forgot to write a useful
commit message, so I'm going to resubmit it with an actual
commit message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344358 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:31:08 +00:00
Zachary Turner 185de913d5 Make YAML quote forward slashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 16:24:09 +00:00
Sanjay Patel a6b5202ae0 [AArch64][x86] add tests for trunc disguised as vector ops (PR39016); NFC
These correspond to the IR transform from:
D52439


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344353 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 15:22:14 +00:00
Simon Pilgrim 08bc40e744 [SelectionDAG] Move VectorLegalizer::ExpandCTLZ codegen into SelectionDAGLegalize
Generalize SelectionDAGLegalize's CTLZ expansion to handle vectors - lets VectorLegalizer::ExpandCTLZ to just pass the expansion on instead of repeating the same codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344349 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 14:45:57 +00:00
Simon Pilgrim c4e53cf2f6 [X86][SSE] LowerVectorCTPOP - pull out repeated byte sum stage.
Pull out repeated byte sum stage for popcount of vector elements > 8bits.

This allows us to simplify the LUT/BITMATH popcnt code to always assume vXi8 vectors, and also improves avx512bitalg codegen which only has access to vpopcntb/vpopcntw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344348 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 14:18:47 +00:00
Hiroshi Inoue 706d3da44f [PowerPC] avoid masking already-zero bits in BitPermutationSelector
The current BitPermutationSelector generates a code to build a value by tracking two types of bits: ConstZero and Variable.
ConstZero means a bit we need to mask off and Variable is a bit we copy from an input value.

This patch add third type of bits VariableKnownToBeZero caused by AssertZext node or zero-extending load node.
VariableKnownToBeZero means a bit comes from an input value, but it is known to be already zero. So we do not need to mask them.
VariableKnownToBeZero enhances flexibility to group bits, since we can avoid redundant masking for these bits.

This patch also renames "HasZero" to "NeedMask" since now we may skip masking even when we have zeros (of type VariableKnownToBeZero).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344347 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 14:02:20 +00:00
Simon Pilgrim cadc63b548 [X86][AVX] Regenerate tzcnt tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344341 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 13:24:51 +00:00
Simon Pilgrim d584a99dbb [X86][SSE] Add extract_subvector(PSHUFB) -> PSHUFB(extract_subvector()) combine
Fixes PR32160 by reducing the size of PSHUFB if we only use one of the lanes.

This approach can probably be generalized to handle any target shuffle (and any subvector index) but we have no test coverage at the moment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344336 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 12:10:34 +00:00
Simon Pilgrim 0b50ad3f83 [X86][AVX] Add examples of shuffles that can be reduced to a cross-lane shuffle followed by a in-lane permute
Suitable for lowering by D53148

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344332 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 10:26:59 +00:00
Simon Pilgrim 39e3cf3d16 [X86] Ignore float/double non-temporal loads (PR39256)
Scalar non-temporal loads were asserting instead of just being ignored.

Reduced from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10895

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344331 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 10:20:16 +00:00
Stefan Maksimovic edac9f00e9 [mips] Mark fmaxl as a long double emulation routine
Failure was discovered upon running
projects/compiler-rt/test/builtins/Unit/divtc3_test.c
in a stage2 compiler build.

When compiling projects/compiler-rt/lib/builtins/divtc3.c,
a call to fmaxl within the divtc3 implementation had its
return values read from registers $2 and $3 instead of $f0 and $f2.
Include fmaxl in the list of long double emulation routines
to have its return value correctly interpreted as f128.

Almost exact issue here: https://reviews.llvm.org/D17760

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344326 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-12 08:18:38 +00:00
Sanjay Patel bd755d4e27 [DAGCombiner] rearrange extract_element+bitcast fold; NFC
I want to add another pattern here that includes scalar_to_vector,
so this makes that patch smaller. I was hoping to remove the
hasOneUse() check because it shouldn't be necessary for common
codegen, but an AMDGPU test has a comment suggesting that the
extra check makes things better on one of those targets.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344320 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 23:56:56 +00:00
Tom Stellard 639949cb15 Revert "AMDGPU/GlobalISel: Implement select for G_INSERT"
This reverts commit r344310.

The test case was failing on some bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 23:36:46 +00:00
Tom Stellard 1a0ffaa454 AMDGPU/GlobalISel: Implement select for G_INSERT
Reviewers: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344310 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 22:49:54 +00:00
Sanjay Patel 9b3effed99 [x86] add tests for extract_element; NFC
The transform for this pattern has an unnecessary one-use limitation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344303 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 22:04:36 +00:00
Sanjay Patel b4c8a95abb [x86] regenerate CHECKs; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344301 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 21:44:38 +00:00
Craig Topper efad4789d8 [X86] Type legalize v2f32 loads by using an f64 load and a scalar_to_vector.
On 64-bit targets the generic legalize will use an i64 load and a scalar_to_vector for us. But on 32-bit targets i64 isn't legal and the generic legalizer will end up emitting two 32-bit loads. We have DAG combines that try to put those two loads back together with pretty good success.

This patch instead uses f64 to avoid the splitting entirely. I've made it do the same for 64-bit mode for consistency and to keep the load in the fp domain.

There are a few things in here that look like regressions in 32-bit mode, but I believe they bring us closer to the 64-bit mode codegen. And that the 64-bit mode code could be better. I think those issues should be looked at separately.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344291 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-11 20:36:06 +00:00