diff options
author | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2015-05-05 19:33:37 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2015-05-05 19:33:37 +0000 |
commit | af2c618e2bc63ede1f79229bcd8d8f9d29e04eee (patch) | |
tree | cb39f63e7f01187d691f5710a5f9ab9e7752de10 /llvm/test | |
parent | 2693c0a4910c2798ac0f4b8fa092e08b630d5c46 (diff) | |
download | bcm5719-llvm-af2c618e2bc63ede1f79229bcd8d8f9d29e04eee.tar.gz bcm5719-llvm-af2c618e2bc63ede1f79229bcd8d8f9d29e04eee.zip |
[DAGCombiner] Fix ReplaceExtractVectorEltOfLoadWithNarrowedLoad for BE
For little-endian, the function would convert (extract_vector_elt (load X), Y)
to X + Y*sizeof(elt). For big-endian it would instead use
X + sizeof(vec) - Y*sizeof(elt). The big-endian case wasn't right since
vector index order always follows memory/array order, even for big-endian.
(Note that the current handling has to be wrong for Y==0 since it would
access beyond the end of the vector.)
Original patch by Richard Sandiford.
llvm-svn: 236529
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/CodeGen/SystemZ/vec-extract-01.ll | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/SystemZ/vec-extract-01.ll b/llvm/test/CodeGen/SystemZ/vec-extract-01.ll new file mode 100644 index 00000000000..549392ffd64 --- /dev/null +++ b/llvm/test/CodeGen/SystemZ/vec-extract-01.ll @@ -0,0 +1,13 @@ +; 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 +} |