summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-02-21 00:22:02 +0000
committerCameron Zwarich <zwarich@apple.com>2011-02-21 00:22:02 +0000
commit8731d0cc836cc879f5a7d32248cdd9ccf4e3b69e (patch)
tree16ac2df9728120c9958f0a19137f97ec68dd87b8 /llvm/test/CodeGen
parent468b5cbd40259b97807afdcdaf49f59353fb667c (diff)
downloadbcm5719-llvm-8731d0cc836cc879f5a7d32248cdd9ccf4e3b69e.tar.gz
bcm5719-llvm-8731d0cc836cc879f5a7d32248cdd9ccf4e3b69e.zip
The signed version of our "magic number" computation for the integer approximation
of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. llvm-svn: 126097
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/X86/divide-by-constant.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/CodeGen/X86/divide-by-constant.ll b/llvm/test/CodeGen/X86/divide-by-constant.ll
index 7ceb972f61b..fe335b9369c 100644
--- a/llvm/test/CodeGen/X86/divide-by-constant.ll
+++ b/llvm/test/CodeGen/X86/divide-by-constant.ll
@@ -40,7 +40,7 @@ entry:
%div = sdiv i16 %x, 33 ; <i32> [#uses=1]
ret i16 %div
; CHECK: test4:
-; CHECK: imull $-1985, %ecx, %ecx
+; CHECK: imull $1986, %eax, %eax
}
define i32 @test5(i32 %A) nounwind {
OpenPOWER on IntegriCloud