diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-01-30 16:38:43 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-01-30 16:38:43 +0000 |
commit | 9b108a338d544a6baf2ff087055326e301e6815d (patch) | |
tree | 345e4c3631032d90ad172e06bc26fef3c0b3ebf3 /utils/FileCheck | |
parent | bb25e2c91b79fc31103510860e1817863a674bc5 (diff) | |
download | external_llvm-9b108a338d544a6baf2ff087055326e301e6815d.zip external_llvm-9b108a338d544a6baf2ff087055326e301e6815d.tar.gz external_llvm-9b108a338d544a6baf2ff087055326e301e6815d.tar.bz2 |
Teach DAGCombine to fold fold (sra (trunc (sr x, c1)), c2) -> (trunc (sra x, c1+c2) when c1 equals the amount of bits that are truncated off.
This happens all the time when a smul is promoted to a larger type.
On x86-64 we now compile "int test(int x) { return x/10; }" into
movslq %edi, %rax
imulq $1717986919, %rax, %rax
movq %rax, %rcx
shrq $63, %rcx
sarq $34, %rax <- used to be "shrq $32, %rax; sarl $2, %eax"
addl %ecx, %eax
This fires 96 times in gcc.c on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
0 files changed, 0 insertions, 0 deletions