diff options
author | Chris Lattner <sabre@nondot.org> | 2006-10-12 22:01:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-10-12 22:01:26 +0000 |
commit | 15bdc96c5b5473691b653e63ffea47a7c7b2c8c1 (patch) | |
tree | e78e3e1ec08d0d3afa5c450d38e61c11ac6220ac /lib/Target/X86 | |
parent | 26d2990e03e60adc66fc5232baac5855fe65c747 (diff) | |
download | external_llvm-15bdc96c5b5473691b653e63ffea47a7c7b2c8c1.zip external_llvm-15bdc96c5b5473691b653e63ffea47a7c7b2c8c1.tar.gz external_llvm-15bdc96c5b5473691b653e63ffea47a7c7b2c8c1.tar.bz2 |
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30921 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/README.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/Target/X86/README.txt b/lib/Target/X86/README.txt index 3ee32cc..84e1532 100644 --- a/lib/Target/X86/README.txt +++ b/lib/Target/X86/README.txt @@ -734,3 +734,30 @@ _foo: ret //===---------------------------------------------------------------------===// + +Consider the expansion of: + +uint %test3(uint %X) { + %tmp1 = rem uint %X, 255 + ret uint %tmp1 +} + +Currently it compiles to: + +... + movl $2155905153, %ecx + movl 8(%esp), %esi + movl %esi, %eax + mull %ecx +... + +This could be "reassociated" into: + + movl $2155905153, %eax + movl 8(%esp), %ecx + mull %ecx + +to avoid the copy. In fact, the existing two-address stuff would do this +except that mul isn't a commutative 2-addr instruction. I guess this has +to be done at isel time based on the #uses to mul? + |