aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/SystemZ/and-08.ll
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-09-27 15:29:20 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-09-27 15:29:20 +0000
commit0548a5487ab8648c7c017f87c507ea1bc38bbb1f (patch)
tree81d2743d67d90b027ac4b28f872bc6f55764fad3 /test/CodeGen/SystemZ/and-08.ll
parent8dac19c0708c9bd0da0b832014918e00ded44d86 (diff)
downloadexternal_llvm-0548a5487ab8648c7c017f87c507ea1bc38bbb1f.zip
external_llvm-0548a5487ab8648c7c017f87c507ea1bc38bbb1f.tar.gz
external_llvm-0548a5487ab8648c7c017f87c507ea1bc38bbb1f.tar.bz2
[SystemZ] Rein back the use of block operations
The backend tries to use block operations like MVC, NC, OC and XC for simple scalar operations. For correctness reasons, it rejects any case in which the regions might partially overlap. However, for performance reasons, it should also reject cases where the regions might be equal, since the instruction might then not use the fast path. This fixes a performance regression seen in bzip2. We may want to limit the optimisation even more in future, or even remove it entirely, but I'll try with this for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/and-08.ll')
-rw-r--r--test/CodeGen/SystemZ/and-08.ll77
1 files changed, 28 insertions, 49 deletions
diff --git a/test/CodeGen/SystemZ/and-08.ll b/test/CodeGen/SystemZ/and-08.ll
index f2ab669..519edc6 100644
--- a/test/CodeGen/SystemZ/and-08.ll
+++ b/test/CodeGen/SystemZ/and-08.ll
@@ -2,8 +2,10 @@
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
-@g1 = global i8 1
-@g2 = global i16 2
+@g1src = global i8 1
+@g1dst = global i8 1
+@g2src = global i16 2
+@g2dst = global i16 2
; Test the simple i8 case.
define void @f1(i8 *%ptr1) {
@@ -239,11 +241,12 @@ define void @f16(i64 *%ptr1) {
ret void
}
-; Test that NC is used for aligned loads and stores, even if there is
-; no way of telling whether they alias.
+; Test that NC is not used for aligned loads and stores if there is
+; no way of telling whether they alias. We don't want to use NC in
+; cases where the addresses could be equal.
define void @f17(i64 *%ptr1, i64 *%ptr2) {
; CHECK-LABEL: f17:
-; CHECK: nc 0(8,%r3), 0(%r2)
+; CHECK-NOT: nc
; CHECK: br %r14
%val = load i64 *%ptr1
%old = load i64 *%ptr2
@@ -306,58 +309,34 @@ define void @f21(i64 %base) {
; Test that we can use NC for global addresses for i8.
define void @f22(i8 *%ptr) {
; CHECK-LABEL: f22:
-; CHECK: larl [[REG:%r[0-5]]], g1
-; CHECK: nc 0(1,%r2), 0([[REG]])
-; CHECK: br %r14
- %val = load i8 *@g1
- %old = load i8 *%ptr
- %and = and i8 %val, %old
- store i8 %and, i8 *%ptr
- ret void
-}
-
-; ...and again with the global on the store.
-define void @f23(i8 *%ptr) {
-; CHECK-LABEL: f23:
-; CHECK: larl [[REG:%r[0-5]]], g1
-; CHECK: nc 0(1,[[REG]]), 0(%r2)
+; CHECK-DAG: larl [[SRC:%r[0-5]]], g1src
+; CHECK-DAG: larl [[DST:%r[0-5]]], g1dst
+; CHECK: nc 0(1,[[DST]]), 0([[SRC]])
; CHECK: br %r14
- %val = load i8 *%ptr
- %old = load i8 *@g1
+ %val = load i8 *@g1src
+ %old = load i8 *@g1dst
%and = and i8 %val, %old
- store i8 %and, i8 *@g1
+ store i8 %and, i8 *@g1dst
ret void
}
; Test that we use NC even where LHRL and STHRL are available.
-define void @f24(i16 *%ptr) {
-; CHECK-LABEL: f24:
-; CHECK: larl [[REG:%r[0-5]]], g2
-; CHECK: nc 0(2,%r2), 0([[REG]])
-; CHECK: br %r14
- %val = load i16 *@g2
- %old = load i16 *%ptr
- %and = and i16 %val, %old
- store i16 %and, i16 *%ptr
- ret void
-}
-
-; ...likewise on the other side.
-define void @f25(i16 *%ptr) {
-; CHECK-LABEL: f25:
-; CHECK: larl [[REG:%r[0-5]]], g2
-; CHECK: nc 0(2,[[REG]]), 0(%r2)
+define void @f23(i16 *%ptr) {
+; CHECK-LABEL: f23:
+; CHECK-DAG: larl [[SRC:%r[0-5]]], g2src
+; CHECK-DAG: larl [[DST:%r[0-5]]], g2dst
+; CHECK: nc 0(2,[[DST]]), 0([[SRC]])
; CHECK: br %r14
- %val = load i16 *%ptr
- %old = load i16 *@g2
+ %val = load i16 *@g2src
+ %old = load i16 *@g2dst
%and = and i16 %val, %old
- store i16 %and, i16 *@g2
+ store i16 %and, i16 *@g2dst
ret void
}
; Test a case where offset disambiguation is enough.
-define void @f26(i64 *%ptr1) {
-; CHECK-LABEL: f26:
+define void @f24(i64 *%ptr1) {
+; CHECK-LABEL: f24:
; CHECK: nc 8(8,%r2), 0(%r2)
; CHECK: br %r14
%ptr2 = getelementptr i64 *%ptr1, i64 1
@@ -369,8 +348,8 @@ define void @f26(i64 *%ptr1) {
}
; Test a case where TBAA tells us there is no alias.
-define void @f27(i64 *%ptr1, i64 *%ptr2) {
-; CHECK-LABEL: f27:
+define void @f25(i64 *%ptr1, i64 *%ptr2) {
+; CHECK-LABEL: f25:
; CHECK: nc 0(8,%r3), 0(%r2)
; CHECK: br %r14
%val = load i64 *%ptr1, align 2, !tbaa !1
@@ -381,8 +360,8 @@ define void @f27(i64 *%ptr1, i64 *%ptr2) {
}
; Test a case where TBAA information is present but doesn't help.
-define void @f28(i64 *%ptr1, i64 *%ptr2) {
-; CHECK-LABEL: f28:
+define void @f26(i64 *%ptr1, i64 *%ptr2) {
+; CHECK-LABEL: f26:
; CHECK-NOT: nc
; CHECK: br %r14
%val = load i64 *%ptr1, align 2, !tbaa !1