[llvm-commits] CVS: llvm/lib/Target/X86/README.txt
Evan Cheng
evan.cheng at apple.com
Tue May 30 00:37:50 PDT 2006
Changes in directory llvm/lib/Target/X86:
README.txt updated: 1.114 -> 1.115
---
Log message:
Add a note about integer multiplication by constants.
---
Diffs of the changes: (+27 -0)
README.txt | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+)
Index: llvm/lib/Target/X86/README.txt
diff -u llvm/lib/Target/X86/README.txt:1.114 llvm/lib/Target/X86/README.txt:1.115
--- llvm/lib/Target/X86/README.txt:1.114 Tue May 30 01:23:50 2006
+++ llvm/lib/Target/X86/README.txt Tue May 30 02:37:37 2006
@@ -622,3 +622,30 @@
operand? i.e. Print as 32-bit super-class register / 16-bit sub-class register.
Do this for the cases where a truncate / anyext is guaranteed to be eliminated.
For IA32 that is truncate from 32 to 16 and anyext from 16 to 32.
+
+//===---------------------------------------------------------------------===//
+
+For this:
+
+int test(int a)
+{
+ return a * 3;
+}
+
+We currently emits
+ imull $3, 4(%esp), %eax
+
+Perhaps this is what we really should generate is? Is imull three or four
+cycles? Note: ICC generates this:
+ movl 4(%esp), %eax
+ leal (%eax,%eax,2), %eax
+
+The current instruction priority is based on pattern complexity. The former is
+more "complex" because it folds a load so the latter will not be emitted.
+
+Perhaps we should use AddedComplexity to give LEA32r a higher priority? We
+should always try to match LEA first since the LEA matching code does some
+estimate to determine whether the match is profitable.
+
+However, if we care more about code size, then imull is better. It's two bytes
+shorter than movl + leal.
More information about the llvm-commits
mailing list