summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2011-01-30 16:38:43 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2011-01-30 16:38:43 +0000
commit946e1522b6df5fb0eecd78913a98d310477f6a64 (patch)
tree84c6f180b05ceb4c2802dcdc95db7a6f68bb4021 /clang/lib/CodeGen/CodeGenModule.cpp
parent115f0fa39769f371e4cb218a0919d3109eaf9cca (diff)
downloadbcm5719-llvm-946e1522b6df5fb0eecd78913a98d310477f6a64.tar.gz
bcm5719-llvm-946e1522b6df5fb0eecd78913a98d310477f6a64.zip
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. llvm-svn: 124559
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud