[PATCH] D23575: Preserve BasePtr for LEA64_32r

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 16 12:26:41 PDT 2016


mkuper added inline comments.

================
Comment at: lib/Target/X86/X86RegisterInfo.cpp:638
@@ -637,1 +637,3 @@
+  // Don't change BasePtr since it is used later for stack adjustment.
+  unsigned MachineBasePtr;
   if (Opc == X86::LEA64_32r && X86::GR32RegClass.contains(BasePtr))
----------------
Maybe something like:
```
  unsigned MachineBasePtr = BasePtr;
  if (Opc == X86::LEA64_32r && X86::GR32RegClass.contains(BasePtr))
    MachineBasePtr = getX86SubSuperRegister(BasePtr, 64);

```
?

================
Comment at: lib/Target/X86/X86RegisterInfo.cpp:645
@@ -640,2 +644,3 @@
   // This must be part of a four operand memory reference.  Replace the
   // FrameIndex with base register with EBP.  Add an offset to the offset.
+  MI.getOperand(FIOperandNum).ChangeToRegister(MachineBasePtr, false);
----------------
As long as you're touching this, can you fix this comment to make sense?

================
Comment at: test/CodeGen/X86/x32-movtopush64.ll:1
@@ +1,2 @@
+; RUN: llc < %s -mtriple=x86_64-linux-gnux32 -O2 | FileCheck %s -check-prefix=CHECK
+
----------------
You shouldn't need the -O2, I think.


Repository:
  rL LLVM

https://reviews.llvm.org/D23575





More information about the llvm-commits mailing list