[PATCH] D38738: X86CallFrameOptimization: Recognize 'store 0/-1 using and/or' idioms

Ayman Musa via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 22 02:14:03 PDT 2017


aymanmus accepted this revision.
aymanmus added a comment.
This revision is now accepted and ready to land.

Minor comments but LGTM overall.



================
Comment at: lib/Target/X86/X86CallFrameOptimization.cpp:283
 
   // The instructions we actually care about are movs onto the stack
+  switch (MI->getOpcode()) {
----------------
The comment implies only movs are acceptable.
Please modify.


================
Comment at: lib/Target/X86/X86CallFrameOptimization.cpp:506
   for (int Idx = (Context.ExpectedDist >> Log2SlotSize) - 1; Idx >= 0; --Idx) {
     MachineBasicBlock::iterator MOV = *Context.MovVector[Idx];
     MachineOperand PushOp = MOV->getOperand(X86::AddrNumOperands);
----------------
Here also, the comments and variable names may be misleading.


================
Comment at: test/CodeGen/X86/movtopush.ll:395
 
-; Check that a stack restore (leal -4(%ebp), %esp) doesn't get merged with a
+; hat a stack restore (leal -4(%ebp), %esp) doesn't get merged with a
 ; stack adjustment (addl $12, %esp). Just because it's a lea doesn't mean it's
----------------
Deleted word by mistake I guess.


https://reviews.llvm.org/D38738





More information about the llvm-commits mailing list