1993 Commits

Author SHA1 Message Date
Sanjay Patel
68d10b6699 add and use isBitwiseLogicOp() helper function; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:54:36 +00:00
Sanjay Patel
fe998e6ec2 [InstCombine] change bitwise logic type to eliminate bitcasts
In PR27925:
https://llvm.org/bugs/show_bug.cgi?id=27925

...we proposed adding this fold to eliminate a bitcast. In D20774, there was 
some concern about changing the type of a bitwise op as well as creating 
bitcasts that might not be free for a target. However, if we're strictly 
eliminating an instruction (by limiting this to one-use ops), then we should 
be able to do this in InstCombine.

But we're cautiously restricting the transform for now to vector types to
avoid possible backend problems. A transform to make sure the logic op is
legal for the target should be added to reverse this transform and improve
codegen.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287707 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 22:05:48 +00:00
Sanjay Patel
fea0530bd5 [InstCombine] canonicalize min/max constant to select's false value
This is a first step towards canonicalization and improved folding/codegen
for integer min/max as discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2016-November/106868.html

Here, we're just matching the simplest min/max patterns and adjusting the
icmp predicate while swapping the select operands.

I've included FIXME tests in test/Transforms/InstCombine/select_meta.ll
so it's easier to see how this might be extended (corresponds to the TODO
comment in the code). That's also why I'm using matchSelectPattern()
rather than a simpler check; once the backend is patched, we can just 
remove some of the restrictions to allow the obfuscated min/max patterns
in the FIXME tests to be matched.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 22:04:14 +00:00
Sanjay Patel
52b86bf6c0 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-21 21:48:36 +00:00
Simon Pilgrim
431da84b02 Fix spelling mistakes in Transforms comments. NFC.
Identified by Pedro Giffuni in PR27636.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-20 13:19:49 +00:00
Craig Topper
35b775d13a [InstCombine][AVX-512] Teach InstCombineCalls how to handle the intrinsics for variable shift with 16-bit elements.
This is a straightforward extension of the existing support for 32/64-bit element types. Just needed to add the additional instrinsics to the switches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287316 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 06:04:33 +00:00
Chris Bieneman
92cb3eecbd [CMake] NFC. Updating CMake dependency specifications
This patch updates a bunch of places where add_dependencies was being explicitly called to add dependencies on intrinsics_gen to instead use the DEPENDS named parameter. This cleanup is needed for a patch I'm working on to add a dependency debugging mode to the build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 04:36:50 +00:00
Sanjay Patel
2318eb95f5 [InstCombine] replace unreachable with assert and remove unreachable code; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:40:02 +00:00
Sanjay Patel
1c3c35ef97 [InstCombine] fix formatting and add FIXMEs to foldOperationIntoSelectOperand(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287145 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 20:18:34 +00:00
Craig Topper
614df99de4 [X86] Remove the scalar intrinsics for fadd/fsub/fdiv/fmul
Summary: These intrinsics have been unused for clang for a while. This patch removes them. We auto upgrade them to extractelements, a scalar operation and then an insertelement. This matches the sequence used by clangs intrinsic file.

Reviewers: zvi, delena, RKSimon

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287083 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 05:24:10 +00:00
Craig Topper
e59ef16ac1 [InstCombine][AVX-512] Teach InstCombineCalls to handle the new unmasked AVX-512 variable shift intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-13 07:26:19 +00:00
Craig Topper
eb14a74d58 [InstCombine][AVX-512] Expand vector shift handling to work on the AVX-512 shift by immediate and shift by single value.
This does not include support for the AVX-512 variable shifts. That will be coming in a future patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286739 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-13 01:51:55 +00:00
Sanjay Patel
a8a96a9e94 [InstCombine] use dyn_cast rather isa+cast; NFC
Follow-up to r286664 cleanup as suggested by Eli. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286671 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:20:01 +00:00
Sanjay Patel
9728332add [InstCombine] clean up foldSelectOpOp(); NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286664 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:01:20 +00:00
Sanjay Patel
d78e6da29d [InstCombine] fix formatting of FoldOpIntoSelect(); NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 17:42:16 +00:00
Sanjay Patel
9c5e4bac4a [InstCombine] avoid infinite loop from shuffle-extract-insert sequence (PR30923)
Removing the limitation in visitInsertElementInst() causes several regressions
because we're not prepared to fold sequences of shuffles or inserts and extracts
separated by shuffles. Fixing that appears to be a difficult mission because we
are purposely trying to avoid creating shuffles with arbitrary shuffle masks
because some targets may choke on those.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 00:15:14 +00:00
Sanjay Patel
6382ee0e42 [InstCombine] fix profitability equation for max-of-nots transform
As the test change shows, we can increase the critical path by adding
a 'not' instruction, so make sure that we're actually removing an
instruction if we do this transform.

This transform could also cause us to miss folds of min/max pairs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 00:13:11 +00:00
Sanjay Patel
97d780bf60 [InstCombine] reduce indentation; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 23:49:15 +00:00
Sanjay Patel
901ccced28 [InstCombine] allow splat vector folds in adjustMinMax() (retry r285732)
This was reverted at r285866 because there was a crash handling a scalar
select of vectors. I added a check for that pattern and a test case based
on the example provided in the post-commit thread for r285732.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286113 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 15:52:45 +00:00
Greg Bedwell
2ad749ea5e Revert "[InstCombine] allow splat vector folds in adjustMinMax()"
This reverts commit r285732.

This change introduced a new assertion failure in the following
testcase at -O2:

typedef short __v8hi __attribute__((__vector_size__(16)));
__v8hi foo(__v8hi &V1, __v8hi &V2, unsigned mask) {
  __v8hi Result = V1;
  if (mask & 0x80)
    Result[0] = V2[0];
  return Result;
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-02 23:17:05 +00:00
Sanjay Patel
b40f34e4b3 [InstCombine] allow splat vector folds in adjustMinMax()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285732 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 20:08:02 +00:00
Sanjay Patel
e7291efa87 [InstCombine] Fold nuw left-shifts in ugt/ule comparisons.
This transforms

%a = shl nuw %x, c1
%b = icmp {ugt|ule} %a, c0

into

%b = icmp {ugt|ule} %x, (c0 >> c1)

z3:

(declare-const x (_ BitVec 64))
(declare-const c0 (_ BitVec 64))
(declare-const c1 (_ BitVec 64))

(push)
(assert (= x (bvlshr (bvshl x c1) c1)))  ; nuw
(assert (not (= (bvugt (bvshl x c1) c0)
                (bvugt x
                       (bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)

(push)
(assert (= x (bvlshr (bvshl x c1) c1)))  ; nuw
(assert (not (= (bvule (bvshl x c1) c0)
                (bvule x
                       (bvlshr c0 c1)))))
(check-sat)
(get-model)
(pop)

Patch by bryant!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285729 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 19:19:29 +00:00
Sanjay Patel
cb06b587a2 [InstCombine] clean up adjustMinMax(); NFCI
1. Change param names for readability
2. Change pointer param to ref
3. Early exit to reduce indent
4. Change switch to if/else


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285718 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 18:15:03 +00:00
Sanjay Patel
f89a6d6792 [InstCombine] add helper function for adjustMinMax(); NFCI
This is just a cut and paste; clean-up and enhancements to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 17:46:08 +00:00
Simon Pilgrim
cf8d4833fd [InstCombine] Folding of shifts by the sum of positive values
This patch introduces the combine:

(C1 shift (A add C2)) -> ((C1 shift C2) shift A)
iff A and C2 are both positive

If both A and C2 are know to be positive then we can safely split into 2 shifts, permitting the folding of the Inner shift.

Fix for the spec benchmark case mentioned by @nadav on PR15141 (assuming we can prove that the inputs as positive).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 15:40:30 +00:00
Sanjay Patel
9978e17243 [InstCombine] re-use bitcasted compare operands in selects (PR28001)
These mixed bitcast patterns show up with SSE/AVX intrinsics because we bitcast function parameters to <2 x i64>.

The bitcasts obfuscate the expected min/max forms as shown in PR28001:
https://llvm.org/bugs/show_bug.cgi?id=28001#c6

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-29 15:22:04 +00:00
Sanjay Patel
428b70f50e [InstCombine] fix foldSPFofSPF() to handle vector splats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 21:19:40 +00:00
Sanjay Patel
74906fa09e [InstCombine] handle simple vector integer constants in IsFreeToInvert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-27 17:30:50 +00:00
Sanjay Patel
d0147e5c78 [InstCombine] clean up commonCastTransforms; NFC
1. Use 'auto' with dyn_cast.
2. Variables start with a capital letter.
3. Use proper punctuation in comments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-26 14:52:35 +00:00
Guozhi Wei
413fdf3b7f [InstCombine] Resubmit the combine of A->B->A BitCast and fix for pr27996
The original patch of the A->B->A BitCast optimization was reverted by r274094 because it may cause infinite loop inside compiler https://llvm.org/bugs/show_bug.cgi?id=27996.

The problem is with following code

xB = load (type B); 
xA = load (type A); 
+yA = (A)xB; B -> A
+zAn = PHI[yA, xA]; PHI 
+zBn = (B)zAn; // A -> B
store zAn;
store zBn;

optimizeBitCastFromPhi generates

+zBn = (B)zAn; // A -> B

and expects it will be combined with the following store instruction to another

store zAn 

Unfortunately before combineStoreToValueType is called on the store instruction, optimizeBitCastFromPhi is called on the new BitCast again, and this pattern repeats indefinitely.

optimizeBitCastFromPhi only generates BitCast for load/store instructions, only the BitCast before store can cause the reexecution of optimizeBitCastFromPhi, and BitCast before store can easily be handled by InstCombineLoadStoreAlloca.cpp. So the solution to the problem is if all users of a CI are store instructions, we should not do optimizeBitCastFromPhi on it. Then optimizeBitCastFromPhi will not be called on the new BitCast instructions.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285116 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:43:42 +00:00
Sanjay Patel
20cfefb146 [InstCombine] Ensure that truncated int types are legal.
Fixes the FIXMEs in D25952 and rL285075.

Patch by bryant!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285108 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 20:11:47 +00:00
Sanjay Patel
614c32bf11 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285078 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 16:12:31 +00:00
Sanjay Patel
ce0f082662 [InstCombine] add test and code comment to show potentially misguided icmp trunc transform
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285075 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-25 15:16:39 +00:00
Peter Collingbourne
7e2bd34085 Analysis: Move llvm::getConstantRangeFromMetadata to IR library.
We're about to start using it there.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-21 19:59:26 +00:00
Sanjay Patel
7aaf99b572 [InstCombine] use m_APInt to allow sub with constant folds for splat vectors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 16:31:54 +00:00
Sanjay Patel
1d3aecea02 [InstCombine] sub X, sext(bool Y) -> add X, zext(bool Y)
Prefer add/zext because they are better supported in terms of value-tracking.

Note that the backend should be prepared for this IR canonicalization 
(including vector types) after:
https://reviews.llvm.org/rL284015

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 15:24:31 +00:00
Simon Pilgrim
3f978ba958 [InstCombine] Fix constexpr issue in select combining
As discussed by Andrea on PR30486, we have an unsafe cast to an Instruction type in the select combine which doesn't take into account that it could be a ConstantExpr instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284000 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 10:20:15 +00:00
David Majnemer
365654256b [InstCombine] Transform !range metadata to !nonnull when combining loads
When combining an integer load with !range metadata that does not include 0 to a pointer load, make sure emit !nonnull metadata on the newly-created pointer load. This prevents the !nonnull metadata from being dropped during a ptrtoint/inttoptr pair.

This fixes PR30597.

Patch by Ariel Ben-Yehuda!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-11 01:00:45 +00:00
Davide Italiano
6d57e1cce1 [InstCombine] Don't unpack arrays that are too large (part 2).
This is similar to r283599, but for store instructions.
Thanks to David for pointing out!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283612 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 21:53:09 +00:00
Davide Italiano
b6ae30c083 [InstCombine] Don't unpack arrays that are too large
Differential Revision:  https://reviews.llvm.org/D25376

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283599 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 20:57:42 +00:00
Sanjay Patel
7a0dadb15b [InstCombine] fold select X, (ext X), C
If we're going to canonicalize IR towards select of constants, try harder to create those.
Also, don't lose the metadata.

This is actually 4 related transforms in one patch:
      // select X, (sext X), C --> select X, -1, C
      // select X, (zext X), C --> select X,  1, C
      // select X, C, (sext X) --> select X, C, 0
      // select X, C, (zext X) --> select X, C, 0

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283575 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-07 17:53:07 +00:00
Sanjoy Das
f6a95d4da8 Remove duplicated code; NFC
ICmpInst::makeConstantRange does exactly the same thing as
ConstantRange::makeExactICmpRegion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283059 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-02 00:09:57 +00:00
Sanjay Patel
59fe6b08fa [InstCombine] allow non-splat folds of select cond (ext X), C
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-30 19:49:22 +00:00
Sanjay Patel
8a50db91a8 [InstCombine] fix function names; NFC
Also, make foldSelectExtConst() a member of InstCombiner, remove
unnecessary parameters from its interface, and group visitSelectInst
helpers together in the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 22:18:30 +00:00
Sanjay Patel
a18c5f6c3f fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-29 17:48:19 +00:00
Alexey Bataev
34552649e8 [InstCombine] Fixed bug introduced in r282237
The index of the new insertelement instruction was evaluated in the
wrong way, it was considered as the index of the inserted value instead
of index of the position, where the value should be inserted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282401 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 13:18:59 +00:00
Andrea Di Biagio
56f90d72c8 [InstCombine] Teach the udiv folding logic how to handle constant expressions.
This patch fixes PR30366.

Function foldUDivShl() worked under the assumption that one of the values
in input to the function was always an instance of llvm::Instruction.
However, function visitUDivOperand() (the only user of foldUDivShl) was
clearly violating that precondition; internally, visitUDivOperand() uses pattern
matches to check the operands of a udiv. Pattern matchers for binary operators
know how to handle both Instruction and ConstantExpr values.

This patch fixes the problem in foldUDivShl(). Now we use pattern matchers
instead of explicit casts to Instruction. The reduced test case from PR30366
has been added to test file InstCombine/udiv-simplify.ll.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-26 12:07:23 +00:00
Alexey Bataev
b9dfeea817 [InstCombine] Fix for PR29124: reduce insertelements to shufflevector
If inserting more than one constant into a vector:

define <4 x float> @foo(<4 x float> %x) {
  %ins1 = insertelement <4 x float> %x, float 1.0, i32 1
  %ins2 = insertelement <4 x float> %ins1, float 2.0, i32 2
  ret <4 x float> %ins2
}

InstCombine could reduce that to a shufflevector:

define <4 x float> @goo(<4 x float> %x) {
 %shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0, float 2.0, float undef>, <4 x i32><i32 0, i32 5, i32 6, i32 3>
 ret <4 x float> %shuf
}
Also, InstCombine tries to convert shuffle instruction to single insertelement, if one of the vectors is a constant vector and only a single element from this constant should be used in shuffle, i.e.
shufflevector <4 x float> %v, <4 x float> <float undef, float 1.0, float
undef, float undef>, <4 x i32> <i32 0, i32 5, i32 undef, i32 undef> ->
insertelement <4 x float> %v, float 1.0, 1

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 09:14:08 +00:00
Sanjay Patel
38d30e5d19 [InstCombine] fold X urem C -> X < C ? X : X - C when C is big (PR28672)
We already have the udiv variant of this transform, so I think this is ok for 
InstCombine too even though there is an increase in IR instructions. As the 
tests and TODO comments show, the transform can lead to follow-on combines.

This should fix: https://llvm.org/bugs/show_bug.cgi?id=28672

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 22:36:26 +00:00
Sanjay Patel
16150b3947 [InstCombine] canonicalize vector select with constant vector condition to shuffle
As discussed on llvm-dev ( http://lists.llvm.org/pipermail/llvm-dev/2016-August/104210.html ): 
turn a vector select with constant condition operand into a shuffle as a canonicalization step.
Shuffles may be easier to reason about in conjunction with other shuffles and insert/extract.

Possible known (minor?) regressions from this change are filed as:
https://llvm.org/bugs/show_bug.cgi?id=28530 
https://llvm.org/bugs/show_bug.cgi?id=28531 
https://llvm.org/bugs/show_bug.cgi?id=30371

If something terrible happens to perf after this commit, feel free to revert until a backend
fix is in place.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-16 22:16:18 +00:00