[llvm-commits] [llvm] r48356 - /llvm/trunk/lib/Target/X86/README.txt
Chris Lattner
sabre at nondot.org
Thu Mar 13 23:00:20 PDT 2008
Author: lattner
Date: Fri Mar 14 01:00:19 2008
New Revision: 48356
URL: http://llvm.org/viewvc/llvm-project?rev=48356&view=rev
Log:
Add an issue that is preventing instcombine from doing a simplification.
Modified:
llvm/trunk/lib/Target/X86/README.txt
Modified: llvm/trunk/lib/Target/X86/README.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/README.txt?rev=48356&r1=48355&r2=48356&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/README.txt (original)
+++ llvm/trunk/lib/Target/X86/README.txt Fri Mar 14 01:00:19 2008
@@ -2,11 +2,6 @@
// Random ideas for the X86 backend.
//===---------------------------------------------------------------------===//
-Missing features:
- - Support for SSE4: http://www.intel.com/software/penryn
-http://softwarecommunity.intel.com/isn/Downloads/Intel%20SSE4%20Programming%20Reference.pdf
- - support for 3DNow!
- - weird abis?
//===---------------------------------------------------------------------===//
@@ -1653,3 +1648,46 @@
//===---------------------------------------------------------------------===//
+These two functions perform identical operations:
+
+define i32 @test(i32 %f12) {
+ %tmp7.25 = lshr i32 %f12, 16
+ %tmp7.26 = trunc i32 %tmp7.25 to i8
+ %tmp78.2 = sext i8 %tmp7.26 to i32
+ ret i32 %tmp78.2
+}
+
+define i32 @test2(i32 %f12) {
+ %f11 = shl i32 %f12, 8
+ %tmp7.25 = ashr i32 %f11, 24
+ ret i32 %tmp7.25
+}
+
+but the first compiles into significantly better code on x86-32:
+
+_test:
+ movsbl 6(%esp), %eax
+ ret
+_test2:
+ movl 4(%esp), %eax
+ shll $8, %eax
+ sarl $24, %eax
+ ret
+
+and on x86-64:
+
+_test:
+ shrl $16, %edi
+ movsbl %dil, %eax
+ ret
+_test2:
+ shll $8, %edi
+ movl %edi, %eax
+ sarl $24, %eax
+ ret
+
+I would like instcombine to canonicalize the first into the second (since it is
+shorter and doesn't involve type width changes) but the x86 backend needs to do
+the right thing with the later sequence first.
+
+//===---------------------------------------------------------------------===//
More information about the llvm-commits
mailing list