[llvm-commits] [llvm] r123752 - /llvm/trunk/lib/Target/README.txt

Chris Lattner sabre at nondot.org
Mon Jan 17 23:47:48 PST 2011


Author: lattner
Date: Tue Jan 18 01:47:48 2011
New Revision: 123752

URL: http://llvm.org/viewvc/llvm-project?rev=123752&view=rev
Log:
add a note

Modified:
    llvm/trunk/lib/Target/README.txt

Modified: llvm/trunk/lib/Target/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/README.txt?rev=123752&r1=123751&r2=123752&view=diff
==============================================================================
--- llvm/trunk/lib/Target/README.txt (original)
+++ llvm/trunk/lib/Target/README.txt Tue Jan 18 01:47:48 2011
@@ -2295,3 +2295,23 @@
 
 //===---------------------------------------------------------------------===//
 
+We miss an optzn when lowering divide by some constants.  For example:
+  int test(int x) { return x/10; }
+
+We produce:
+
+_test:                                  ## @test
+## BB#0:                                ## %entry
+	movslq	%edi, %rax
+	imulq	$1717986919, %rax, %rax ## imm = 0x66666667
+	movq	%rax, %rcx
+	shrq	$63, %rcx
+**	shrq	$32, %rax
+**      sarl	$2, %eax
+	addl	%ecx, %eax
+	ret
+
+The two starred instructions could be replaced with a "sarl $34, %rax".  This
+occurs in 186.crafty very frequently.
+
+//===---------------------------------------------------------------------===//





More information about the llvm-commits mailing list