diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-07-08 21:25:33 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-07-08 21:25:33 +0000 |
commit | 3fb8f9eabff53c720b3b447a3649e373b8057295 (patch) | |
tree | 917b6a5e1aa0d62012067dec4bdac359488e19a1 /llvm/lib | |
parent | 0a24048bb7a00633c895a3bb5a493156259023c6 (diff) | |
download | bcm5719-llvm-3fb8f9eabff53c720b3b447a3649e373b8057295.tar.gz bcm5719-llvm-3fb8f9eabff53c720b3b447a3649e373b8057295.zip |
Reapply r274829 with fix for FP vectors
llvm-svn: 274937
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f1b2566f43a..0afd54ae0b2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -12407,8 +12407,10 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) { // This only really matters if the index is non-constant since other combines // on the constant elements already work. if (InVec.getOpcode() == ISD::INSERT_VECTOR_ELT && - EltNo == InVec.getOperand(2)) - return InVec.getOperand(1); + EltNo == InVec.getOperand(2)) { + SDValue Elt = InVec.getOperand(1); + return VT.isInteger() ? DAG.getAnyExtOrTrunc(Elt, SDLoc(N), NVT) : Elt; + } // Transform: (EXTRACT_VECTOR_ELT( VECTOR_SHUFFLE )) -> EXTRACT_VECTOR_ELT. // We only perform this optimization before the op legalization phase because |