summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/SystemZ/int-const-05.ll
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-08-23 11:18:53 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-08-23 11:18:53 +0000
commita481f5854203e81cde5bba83e3f4c9a7c321fd29 (patch)
treec5813079ba99efebb52f072d1e4b20bbfdcc398e /llvm/test/CodeGen/SystemZ/int-const-05.ll
parent37cd6cfba2e92fa89fbc4e8653edf1bb3229ba0d (diff)
downloadbcm5719-llvm-a481f5854203e81cde5bba83e3f4c9a7c321fd29.tar.gz
bcm5719-llvm-a481f5854203e81cde5bba83e3f4c9a7c321fd29.zip
[SystemZ] Prefer LHI;ST... over LAY;MV...
If we had a store of an integer to memory, and the integer and store size were suitable for a form of MV..., we used MV... no matter what. We could then have sequences like: lay %r2, 0(%r3,%r4) mvi 0(%r2), 4 In these cases it seems better to force the constant into a register and use a normal store: lhi %r2, 4 stc %r2, 0(%r3, %r4) since %r2 is more likely to be hoisted and is easier to rematerialize. llvm-svn: 189098
Diffstat (limited to 'llvm/test/CodeGen/SystemZ/int-const-05.ll')
-rw-r--r--llvm/test/CodeGen/SystemZ/int-const-05.ll19
1 files changed, 9 insertions, 10 deletions
diff --git a/llvm/test/CodeGen/SystemZ/int-const-05.ll b/llvm/test/CodeGen/SystemZ/int-const-05.ll
index d0c85691493..98d6851c197 100644
--- a/llvm/test/CodeGen/SystemZ/int-const-05.ll
+++ b/llvm/test/CodeGen/SystemZ/int-const-05.ll
@@ -66,34 +66,33 @@ define void @f7(i32 *%a) {
ret void
}
-; Check the next word up, which needs separate address logic.
-; Other sequences besides this one would be OK.
+; Check the next word up, which is out of range. We prefer STY in that case.
define void @f8(i32 *%a) {
; CHECK-LABEL: f8:
-; CHECK: aghi %r2, 4096
-; CHECK: mvhi 0(%r2), 42
+; CHECK: lhi [[TMP:%r[0-5]]], 42
+; CHECK: sty [[TMP]], 4096(%r2)
; CHECK: br %r14
%ptr = getelementptr i32 *%a, i64 1024
store i32 42, i32 *%ptr
ret void
}
-; Check negative displacements, which also need separate address logic.
+; Check negative displacements, for which we again prefer STY.
define void @f9(i32 *%a) {
; CHECK-LABEL: f9:
-; CHECK: aghi %r2, -4
-; CHECK: mvhi 0(%r2), 42
+; CHECK: lhi [[TMP:%r[0-5]]], 42
+; CHECK: sty [[TMP]], -4(%r2)
; CHECK: br %r14
%ptr = getelementptr i32 *%a, i64 -1
store i32 42, i32 *%ptr
ret void
}
-; Check that MVHI does not allow an index
+; Check that MVHI does not allow an index.
define void @f10(i64 %src, i64 %index) {
; CHECK-LABEL: f10:
-; CHECK: agr %r2, %r3
-; CHECK: mvhi 0(%r2), 42
+; CHECK: lhi [[TMP:%r[0-5]]], 42
+; CHECK: st [[TMP]], 0({{%r2,%r3|%r3,%r2}})
; CHECK: br %r14
%add = add i64 %src, %index
%ptr = inttoptr i64 %add to i32 *
OpenPOWER on IntegriCloud