From 6aab4910cd07b8b7105fc42cfd62bebe3d67ce79 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Tue, 2 Oct 2007 20:42:59 +0000 Subject: [PATCH] Another missed optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42546 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/README.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index aee90a23154..08e219c9b71 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -1239,3 +1239,31 @@ _test: //===---------------------------------------------------------------------===// +The following code: + +LBB3_5: # bb114.preheader + movswl -68(%ebp), %eax + movl $32, %ecx + movl %ecx, -80(%ebp) + subl %eax, -80(%ebp) + movswl -52(%ebp), %eax + movl %ecx, -84(%ebp) + subl %eax, -84(%ebp) + movswl -70(%ebp), %eax + movl %ecx, -88(%ebp) + subl %eax, -88(%ebp) + movswl -50(%ebp), %eax + subl %eax, %ecx + movl %ecx, -76(%ebp) + movswl -42(%ebp), %eax + movl %eax, -92(%ebp) + movswl -66(%ebp), %eax + movl %eax, -96(%ebp) + movw $0, -98(%ebp) + +has redundant subtractions of %eax from a stack slot. However, %ecx doesn't +change, so we could simply subtract %eax from %ecx first and then use %ecx (or +vice-versa). + +//===---------------------------------------------------------------------===// +