summaryrefslogtreecommitdiff
path: root/lib/Target/SystemZ/SystemZISelLowering.cpp
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-09 09:32:42 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-07-09 09:32:42 +0000
commitf6ea5e0d8007234fc74c1ff6ac2c3ca316c41d92 (patch)
tree885d12c6564d8dc4cc6042b030eb521372518cbb /lib/Target/SystemZ/SystemZISelLowering.cpp
parentfcb7b97892dad5bc6ae55f513f8a111563078996 (diff)
downloadllvm-f6ea5e0d8007234fc74c1ff6ac2c3ca316c41d92.tar.gz
llvm-f6ea5e0d8007234fc74c1ff6ac2c3ca316c41d92.tar.bz2
llvm-f6ea5e0d8007234fc74c1ff6ac2c3ca316c41d92.tar.xz
[SystemZ] Use "STC;MVC" for memset
Use "STC;MVC" for memsets that are too big for two STCs or MV...Is yet small enough for a single MVC. As with memcpy, I'm leaving longer cases till later. The number of tests might seem excessive, but f33 & f34 from memset-04.ll failed the first cut because I'd not added the "?:" on the calculation of Size1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185918 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/SystemZ/SystemZISelLowering.cpp')
-rw-r--r--lib/Target/SystemZ/SystemZISelLowering.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Target/SystemZ/SystemZISelLowering.cpp b/lib/Target/SystemZ/SystemZISelLowering.cpp
index bf359468e6..b1abc2c3c1 100644
--- a/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -245,6 +245,14 @@ SystemZTargetLowering::SystemZTargetLowering(SystemZTargetMachine &tm)
// We want to use MVC in preference to even a single load/store pair.
MaxStoresPerMemcpy = 0;
MaxStoresPerMemcpyOptSize = 0;
+
+ // The main memset sequence is a byte store followed by an MVC.
+ // Two STC or MV..I stores win over that, but the kind of fused stores
+ // generated by target-independent code don't when the byte value is
+ // variable. E.g. "STC <reg>;MHI <reg>,257;STH <reg>" is not better
+ // than "STC;MVC". Handle the choice in target-specific code instead.
+ MaxStoresPerMemset = 0;
+ MaxStoresPerMemsetOptSize = 0;
}
bool SystemZTargetLowering::isFPImmLegal(const APFloat &Imm, EVT VT) const {