diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-13 08:39:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-13 08:39:01 +0000 |
commit | de1c3605a649239cf8a96ba31885c8fbef2bc838 (patch) | |
tree | 4b2933b6d4e162daba87f508642c62d0d6ed4d10 /lib/Transforms | |
parent | a9f6bbea62f42ab052eca423588e309ab67c3fa3 (diff) |
Add a couple dag combines to transform mulhi/mullo into a wider multiply
when the wider type is legal. This allows us to compile:
define zeroext i16 @test1(i16 zeroext %x) nounwind {
entry:
%div = udiv i16 %x, 33
ret i16 %div
}
into:
test1: # @test1
movzwl 4(%esp), %eax
imull $63551, %eax, %eax # imm = 0xF83F
shrl $21, %eax
ret
instead of:
test1: # @test1
movw $-1985, %ax # imm = 0xFFFFFFFFFFFFF83F
mulw 4(%esp)
andl $65504, %edx # imm = 0xFFE0
movl %edx, %eax
shrl $5, %eax
ret
Implementing rdar://8760399 and example #4 from:
http://blog.regehr.org/archives/320
We should implement the same thing for [su]mul_hilo, but I don't
have immediate plans to do this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
0 files changed, 0 insertions, 0 deletions