[PATCH] D18573: [X86] Enable call frame optimization ("mov to push") not only for optsize (PR26325)

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 14:39:23 PDT 2016


joerg added a subscriber: joerg.

================
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
----------------
The changes here look suspicious, doesn't the code need to restore %esp before the final popl?

================
Comment at: test/CodeGen/X86/xmulo.ll:28
@@ -29,1 +27,3 @@
+; CHECK:  pushl $0
+; CHECK:  pushl $0
 
----------------
Each immediate push is two Bytes, materializing $0 as register is two Bytes as well, but a register push is one Byte. So for three pushes, a shorter sequence is actually:

```
xorl %eax, %eax
pushl %eax
pushl %eax
pushl %eax
```

================
Comment at: test/CodeGen/X86/zext-fold.ll:38
@@ -37,2 +37,3 @@
 ; CHECK: movzbl {{[0-9]+}}(%esp), [[REGISTER:%e[a-z]{2}]]
-; CHECK-NEXT: movl [[REGISTER]], 4(%esp)
+; CHECK: subl $8, %esp
+; CHECK-NEXT: pushl [[REGISTER]]
----------------
Two register pushes are smaller than one subl?


http://reviews.llvm.org/D18573





More information about the llvm-commits mailing list