summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/x86_64-mul-by-const.ll
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-12-17 21:45:49 +0000
committerDale Johannesen <dalej@apple.com>2010-12-17 21:45:49 +0000
commitf5daf8bb7ff9539f7a6e0113609b39e4b9b64ff5 (patch)
tree52bc6d7ed0cc8f3aa9f1fe85783ca3761e60d854 /test/CodeGen/X86/x86_64-mul-by-const.ll
parent48c166bceb16e578131671ccfb96d35d6fe0db4e (diff)
downloadllvm-f5daf8bb7ff9539f7a6e0113609b39e4b9b64ff5.tar.gz
llvm-f5daf8bb7ff9539f7a6e0113609b39e4b9b64ff5.tar.bz2
llvm-f5daf8bb7ff9539f7a6e0113609b39e4b9b64ff5.tar.xz
Add a transform to DAG Combiner. This improves the
code for the case where 32-bit divide by constant is turned into 64-bit multiply by constant. 8771012. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/x86_64-mul-by-const.ll')
-rw-r--r--test/CodeGen/X86/x86_64-mul-by-const.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/X86/x86_64-mul-by-const.ll b/test/CodeGen/X86/x86_64-mul-by-const.ll
new file mode 100644
index 0000000000..9cda9ab192
--- /dev/null
+++ b/test/CodeGen/X86/x86_64-mul-by-const.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -mtriple=x86_64-apple-darwin | FileCheck %s
+; Formerly there were two shifts. 8771012.
+
+define i32 @f9188_mul365384439_shift27(i32 %A) nounwind {
+; CHECK: imulq $365384439,
+; CHECK: shrq $59, %rax
+ %tmp1 = udiv i32 %A, 1577682821 ; <i32> [#uses=1]
+ ret i32 %tmp1
+}