From a47a692341bd108ad4188b6a868152d8d0f99b64 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 4 Apr 2016 21:02:46 +0000 Subject: Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)" The original commit miscompiled things on 32-bit Windows, e.g. a Clang boostrap. It turns out that mergeSPUpdates() was a bit too generous in what it interpreted as a stack adjustment, causing the following code: addl $12, %esp leal -4(%ebp), %esp To be "optimized" into simply: addl $8, %esp This commit tightens up mergeSPUpdates() and includes a new test (test14 in movtopush.ll) for this situation. llvm-svn: 265345 --- llvm/test/CodeGen/X86/fold-push.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test/CodeGen/X86/fold-push.ll') diff --git a/llvm/test/CodeGen/X86/fold-push.ll b/llvm/test/CodeGen/X86/fold-push.ll index eaf91351021..9d3afd1c449 100644 --- a/llvm/test/CodeGen/X86/fold-push.ll +++ b/llvm/test/CodeGen/X86/fold-push.ll @@ -14,7 +14,7 @@ define void @test(i32 %a, i32 %b) optsize nounwind { ; SLM: movl (%esp), [[RELOAD:%e..]] ; SLM-NEXT: pushl [[RELOAD]] ; CHECK: calll -; CHECK-NEXT: addl $4, %esp +; CHECK-NEXT: addl $8, %esp %c = add i32 %a, %b call void @foo(i32 %c) call void asm sideeffect "nop", "~{ax},~{bx},~{cx},~{dx},~{bp},~{si},~{di}"() -- cgit v1.2.3