From 2e015ef9bb40e5d9f98db9a9509b9986873089ea Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 9 Jul 2013 09:46:39 +0000 Subject: [SystemZ] Use MVC for simple load/store pairs Look for patterns of the form (store (load ...), ...) in which the two locations are known not to partially overlap. (Identical locations are OK.) These sequences are better implemented by MVC unless either the load or the store could use RELATIVE LONG instructions. The testcase showed that we weren't using LHRL and LGHRL for extload16, only sextloadi16. The patch fixes that too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185919 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SystemZ/SystemZInstrInfo.td | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/Target/SystemZ/SystemZInstrInfo.td') diff --git a/lib/Target/SystemZ/SystemZInstrInfo.td b/lib/Target/SystemZ/SystemZInstrInfo.td index b4e5c25..5e13c7f 100644 --- a/lib/Target/SystemZ/SystemZInstrInfo.td +++ b/lib/Target/SystemZ/SystemZInstrInfo.td @@ -294,6 +294,20 @@ let mayLoad = 1, mayStore = 1, usesCustomInserter = 1 in [(z_mvc bdaddr12only:$dest, bdaddr12only:$src, imm32len8:$length)]>; +defm LoadStore8_32 : MVCLoadStore; +defm LoadStore16_32 : MVCLoadStore; +defm LoadStore32_32 : MVCLoadStore; + +defm LoadStore8 : MVCLoadStore; +defm LoadStore16 : MVCLoadStore; +defm LoadStore32 : MVCLoadStore; +defm LoadStore64 : MVCLoadStore; + //===----------------------------------------------------------------------===// // Sign extensions //===----------------------------------------------------------------------===// @@ -339,6 +353,14 @@ def : Pat<(i64 (extloadi8 bdxaddr20only:$src)), (LGB bdxaddr20only:$src)>; def : Pat<(i64 (extloadi16 bdxaddr20only:$src)), (LGH bdxaddr20only:$src)>; def : Pat<(i64 (extloadi32 bdxaddr20only:$src)), (LGF bdxaddr20only:$src)>; +// We want PC-relative addresses to be tried ahead of BD and BDX addresses. +// However, BDXs have two extra operands and are therefore 6 units more +// complex. +let AddedComplexity = 7 in { + def : Pat<(i32 (extloadi16 pcrel32:$src)), (LHRL pcrel32:$src)>; + def : Pat<(i64 (extloadi16 pcrel32:$src)), (LGHRL pcrel32:$src)>; +} + //===----------------------------------------------------------------------===// // Zero extensions //===----------------------------------------------------------------------===// -- cgit v1.1