From f5daf8bb7ff9539f7a6e0113609b39e4b9b64ff5 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 17 Dec 2010 21:45:49 +0000 Subject: 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 --- test/CodeGen/X86/x86_64-mul-by-const.ll | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/CodeGen/X86/x86_64-mul-by-const.ll (limited to 'test/CodeGen/X86/x86_64-mul-by-const.ll') 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 ; [#uses=1] + ret i32 %tmp1 +} -- cgit v1.2.3