[PATCH] [X86] Use single add/sub for large stack offsets

Robert Lougher rob.lougher at gmail.com
Wed Jan 28 09:53:31 PST 2015

Comment at: lib/Target/X86/X86FrameLowering.cpp:202
@@ +201,3 @@
+      unsigned Reg = isSub
+        ? (unsigned)(Is64BitTarget ? X86::RAX : X86::EAX)
+        : findDeadCallerSavedReg(MBB, MBBI, TRI, Is64BitTarget);
asl wrote:
> This clobbers rax/eax w/o checking whether it's a livein or not. This may be a problem for functions with inreg attributes. I believe the code should always use findDeadCallerSavedReg().
I copied that from the code that generates a push/pop (lines 223-225), so the existing code always uses rax/eax in the prologue for a push.  If this is a problem for inreg attributes, this code will also need to be fixed.



More information about the llvm-commits mailing list