[llvm-commits] [llvm] r147954 - in /llvm/trunk: lib/Target/X86/X86FrameLowering.cpp test/CodeGen/X86/segmented-stacks.ll
Rafael Espindola
rafael.espindola at gmail.com
Wed Jan 11 10:23:35 PST 2012
Author: rafael
Date: Wed Jan 11 12:23:35 2012
New Revision: 147954
URL: http://llvm.org/viewvc/llvm-project?rev=147954&view=rev
Log:
Use unsigned comparison in segmented stack prologue.
This is a comparison of two addresses, and GCC does the comparison unsigned.
Patch by Brian Anderson.
Modified:
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
llvm/trunk/test/CodeGen/X86/segmented-stacks.ll
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=147954&r1=147953&r2=147954&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Wed Jan 11 12:23:35 2012
@@ -1405,7 +1405,7 @@
// This jump is taken if SP >= (Stacklet Limit + Stack Space required).
// It jumps to normal execution of the function body.
- BuildMI(checkMBB, DL, TII.get(X86::JG_4)).addMBB(&prologueMBB);
+ BuildMI(checkMBB, DL, TII.get(X86::JA_4)).addMBB(&prologueMBB);
// On 32 bit we first push the arguments size and then the frame size. On 64
// bit, we pass the stack frame size in r10 and the argument size in r11.
Modified: llvm/trunk/test/CodeGen/X86/segmented-stacks.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/segmented-stacks.ll?rev=147954&r1=147953&r2=147954&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/segmented-stacks.ll (original)
+++ llvm/trunk/test/CodeGen/X86/segmented-stacks.ll Wed Jan 11 12:23:35 2012
@@ -25,6 +25,7 @@
; X32: test_basic:
; X32: cmpl %gs:48, %esp
+; X32-NEXT: ja .LBB0_2
; X32: pushl $4
; X32-NEXT: pushl $12
@@ -45,6 +46,7 @@
; X64: test_basic:
; X64: cmpq %fs:112, %rsp
+; X64-NEXT: ja .LBB0_2
; X64: movabsq $24, %r10
; X64-NEXT: movabsq $0, %r11
@@ -69,6 +71,7 @@
ret i32 %result
; X32: cmpl %gs:48, %esp
+; X32-NEXT: ja .LBB1_2
; X32: pushl $4
; X32-NEXT: pushl $0
@@ -76,6 +79,7 @@
; X32-NEXT: ret
; X64: cmpq %fs:112, %rsp
+; X64-NEXT: ja .LBB1_2
; X64: movq %r10, %rax
; X64-NEXT: movabsq $0, %r10
@@ -93,6 +97,7 @@
; X32: leal -40012(%esp), %ecx
; X32-NEXT: cmpl %gs:48, %ecx
+; X32-NEXT: ja .LBB2_2
; X32: pushl $0
; X32-NEXT: pushl $40012
@@ -101,6 +106,7 @@
; X64: leaq -40008(%rsp), %r11
; X64-NEXT: cmpq %fs:112, %r11
+; X64-NEXT: ja .LBB2_2
; X64: movabsq $40008, %r10
; X64-NEXT: movabsq $0, %r11
More information about the llvm-commits
mailing list