[llvm] r266060 - [SystemZ] Use LDE32 instead of LE, when Offset is small.

Jonas Paulsson via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 12 05:07:24 PDT 2016


Author: jonpa
Date: Tue Apr 12 07:07:23 2016
New Revision: 266060

URL: http://llvm.org/viewvc/llvm-project?rev=266060&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp

Modified: llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp?rev=266060&r1=266059&r2=266060&view=diff
==============================================================================
--- llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/SystemZ/SystemZRegisterInfo.cpp Tue Apr 12 07:07:23 2016
@@ -84,8 +84,14 @@ SystemZRegisterInfo::eliminateFrameIndex
   // accepts the offset exists.
   unsigned Opcode = MI->getOpcode();
   unsigned OpcodeForOffset = TII->getOpcodeForOffset(Opcode, Offset);
-  if (OpcodeForOffset)
+  if (OpcodeForOffset) {
+    if (OpcodeForOffset == SystemZ::LE &&
+        MF.getSubtarget<SystemZSubtarget>().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.




More information about the llvm-commits mailing list