if (auto *ConstEltNo = dyn_cast<ConstantSDNode>(EltNo)) {
int Elt = ConstEltNo->getZExtValue();
unsigned PtrOff = VecEltVT.getSizeInBits() * Elt / 8;
- if (TLI.isBigEndian())
- PtrOff = InVecVT.getSizeInBits() / 8 - PtrOff;
Offset = DAG.getConstant(PtrOff, DL, PtrType);
MPI = OriginalLoad->getPointerInfo().getWithOffset(PtrOff);
} else {
Offset = DAG.getNode(
ISD::MUL, DL, EltNo.getValueType(), EltNo,
DAG.getConstant(VecEltVT.getStoreSize(), DL, EltNo.getValueType()));
- if (TLI.isBigEndian())
- Offset = DAG.getNode(
- ISD::SUB, DL, EltNo.getValueType(),
- DAG.getConstant(InVecVT.getStoreSize(), DL, EltNo.getValueType()),
- Offset);
MPI = OriginalLoad->getPointerInfo();
}
NewPtr = DAG.getNode(ISD::ADD, DL, PtrType, NewPtr, Offset);
--- /dev/null
+; Verify ReplaceExtractVectorEltOfLoadWithNarrowedLoad fixes
+;
+; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
+
+; Test a memory copy of a v2i32 (via the constant pool).
+define void @f1(<2 x i32> *%dest) {
+; CHECK-LABEL: f1:
+; CHECK: lgrl [[REG:%r[0-5]]], {{[._A-Za-z0-9]}}
+; CHECK: stg [[REG]], 0(%r2)
+; CHECK: br %r14
+ store <2 x i32> <i32 1000000, i32 99999>, <2 x i32> *%dest
+ ret void
+}