From f0fc50905f361f30b1f07c0335db2585cdfed77b Mon Sep 17 00:00:00 2001 From: Jonas Paulsson Date: Tue, 12 Apr 2016 12:07:23 +0000 Subject: [PATCH] [SystemZ] Use LDE32 instead of LE, when Offset is small. On z13, if eliminateFrameIndex() chooses LE (and not LEY), immediately transform that LE to LDE32 to avoid partial register dependencies. LEY should be generally preferred for big offsets over an expansion into LAY + LDE32. Reviewed by Ulrich Weigand. llvm-svn: 266060 --- llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp index 6fd24e3..8d872b7 100644 --- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp @@ -84,8 +84,14 @@ SystemZRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, // accepts the offset exists. unsigned Opcode = MI->getOpcode(); unsigned OpcodeForOffset = TII->getOpcodeForOffset(Opcode, Offset); - if (OpcodeForOffset) + if (OpcodeForOffset) { + if (OpcodeForOffset == SystemZ::LE && + MF.getSubtarget().hasVector()) { + // If LE is ok for offset, use LDE instead on z13. + OpcodeForOffset = SystemZ::LDE32; + } MI->getOperand(FIOperandNum).ChangeToRegister(BasePtr, false); + } else { // Create an anchor point that is in range. Start at 0xffff so that // can use LLILH to load the immediate. -- 2.7.4