[PATCH] [X86] Convert esp-relative movs of function arguments to pushes, step 2

Reid Kleckner rnk at google.com
Thu Jan 15 10:19:39 PST 2015


================
Comment at: lib/Target/X86/X86InstrInfo.cpp:1717-1718
@@ +1716,4 @@
+  // pseudo. This leaves us with a choice:
+  // 1) Look for the next ADJCALLSTACKUP, like the code below. This
+  // works, but certainly doesn't belong here.
+  // 2) Factor out the code that makes the decision on whether a function
----------------
mkuper wrote:
> rnk wrote:
> > This is the best thing I can think of at the moment. =/
> Too bad. :-\ 
> 
> So you think I should commit with this code as is?
> This shouldn't be a huge problem in terms of compile-time (since I'm looking only until the next call, it can't go quadratic), but it's insanely ugly.
Yeah, if we go with this MI pass approach to mov -> push conversion, then we'll have to keep this ADJCALLSTACKUP scan. We aren't going to move the callee cleanup stack adjustment onto the CALL instr without major changes.

================
Comment at: lib/Target/X86/X86InstrInfo.cpp:1745
@@ +1744,3 @@
+  // in call sequences
+  switch (MI->getOpcode()) {
+  default: 
----------------
I wonder if it's possible for __readeflags() (pushf ;  pop %reg) or others to get folded into a call sequence. Probably not.

http://reviews.llvm.org/D6789

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list