diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-17 20:39:14 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-03-17 20:39:14 +0000 |
commit | cfcea12fe25961ba7f8dba0e026b1b9b84006660 (patch) | |
tree | ad20e9912cb8619d6e495682800d9a7326f278b3 /llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp | |
parent | 09a51bab5d12e688f4145d6fb8654fc13c7ce4d9 (diff) | |
download | bcm5719-llvm-cfcea12fe25961ba7f8dba0e026b1b9b84006660.tar.gz bcm5719-llvm-cfcea12fe25961ba7f8dba0e026b1b9b84006660.zip |
BuildUDIV: If the divisor is even we can simplify the fixup of the multiplied value by introducing an early shift.
This allows us to compile "unsigned foo(unsigned x) { return x/28; }" into
shrl $2, %edi
imulq $613566757, %rdi, %rax
shrq $32, %rax
ret
instead of
movl %edi, %eax
imulq $613566757, %rax, %rcx
shrq $32, %rcx
subl %ecx, %eax
shrl %eax
addl %ecx, %eax
shrl $4, %eax
on x86_64
llvm-svn: 127829
Diffstat (limited to 'llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp')
0 files changed, 0 insertions, 0 deletions