[PATCH] D18573: [X86] Enable call frame optimization ("mov to push") not only for optsize (PR26325)
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 30 16:17:08 PDT 2016
rnk accepted this revision.
rnk added a comment.
This revision is now accepted and ready to land.
lgtm I think this is production ready. We *mostly* build chromium with -Os, and we've fixed some bugs in this code.
================
Comment at: lib/Target/X86/X86CallFrameOptimization.cpp:176-178
@@ -175,5 +175,5 @@
ContextVector &CallSeqVector) {
// This transformation is always a win when we do not expect to have
// a reserved call frame. Under other circumstances, it may be either
// a win or a loss, and requires a heuristic.
bool CannotReserveFrame = MF.getFrameInfo()->hasVarSizedObjects();
----------------
Huh, so we're already doing this a lot due to inalloca.
================
Comment at: test/CodeGen/X86/win32-seh-nested-finally.ll:46
@@ -45,3 +45,3 @@
; CHECK: movl $1, -[[state]](%ebp)
-; CHECK: movl $1, (%esp)
+; CHECK: pushl $1
; CHECK: calll _f
----------------
Great, I was halfway through checking that before I got distracted...
================
Comment at: test/CodeGen/X86/zext-fold.ll:38-39
@@ -37,3 +37,4 @@
; CHECK: movzbl {{[0-9]+}}(%esp), [[REGISTER:%e[a-z]{2}]]
-; CHECK-NEXT: movl [[REGISTER]], 4(%esp)
+; CHECK: subl $8, %esp
+; CHECK-NEXT: pushl [[REGISTER]]
; CHECK-NEXT: andl $224, [[REGISTER]]
----------------
Actually, the sub probably won't be emitted on Mac and Windows, it will only appear on platforms with 16 byte stack alignment.
http://reviews.llvm.org/D18573
More information about the llvm-commits
mailing list