diff options
| author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2015-05-05 19:34:10 +0000 |
|---|---|---|
| committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2015-05-05 19:34:10 +0000 |
| commit | 9958c489bb85708438fa66b1c0e2c2c1c5d73424 (patch) | |
| tree | 8cab65a5dfe7f65e304ec7647e2277731d8050cf /llvm/lib | |
| parent | af2c618e2bc63ede1f79229bcd8d8f9d29e04eee (diff) | |
| download | bcm5719-llvm-9958c489bb85708438fa66b1c0e2c2c1c5d73424.tar.gz bcm5719-llvm-9958c489bb85708438fa66b1c0e2c2c1c5d73424.zip | |
[DAGCombiner] Account for getVectorIdxTy() when narrowing vector load
This patch makes ReplaceExtractVectorEltOfLoadWithNarrowedLoad convert
the element number from getVectorIdxTy() to PtrTy before doing pointer
arithmetic on it. This is needed on z, where element numbers are i32
but pointers are i64.
Original patch by Richard Sandiford.
llvm-svn: 236530
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 4669d6c2f18..bf42aabeab2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -11416,9 +11416,10 @@ SDValue DAGCombiner::ReplaceExtractVectorEltOfLoadWithNarrowedLoad( Offset = DAG.getConstant(PtrOff, DL, PtrType); MPI = OriginalLoad->getPointerInfo().getWithOffset(PtrOff); } else { + Offset = DAG.getZExtOrTrunc(EltNo, DL, PtrType); Offset = DAG.getNode( - ISD::MUL, DL, EltNo.getValueType(), EltNo, - DAG.getConstant(VecEltVT.getStoreSize(), DL, EltNo.getValueType())); + ISD::MUL, DL, PtrType, Offset, + DAG.getConstant(VecEltVT.getStoreSize(), DL, PtrType)); MPI = OriginalLoad->getPointerInfo(); } NewPtr = DAG.getNode(ISD::ADD, DL, PtrType, NewPtr, Offset); |

