diff options
author | Chris Lattner <sabre@nondot.org> | 2011-05-22 18:18:41 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-05-22 18:18:41 +0000 |
commit | 1add46ddfa38f23669cb02de342fdb59a8709245 (patch) | |
tree | 19ac31b2cf5eb88624f01757353c5b055f2b5920 /lib/Analysis/ValueTracking.cpp | |
parent | 75f4296c7c96499f4d8cdf90d5159f7965f94fd8 (diff) |
Carve out a place in instcombine to put transformations which work knowing that their
result is non-zero. Implement an example optimization (PR9814), which allows us to
transform:
A / ((1 << B) >>u 2)
into:
A >>u (B-2)
which we compile into:
_divu3: ## @divu3
leal -2(%rsi), %ecx
shrl %cl, %edi
movl %edi, %eax
ret
instead of:
_divu3: ## @divu3
movb %sil, %cl
movl $1, %esi
shll %cl, %esi
shrl $2, %esi
movl %edi, %eax
xorl %edx, %edx
divl %esi, %eax
ret
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
0 files changed, 0 insertions, 0 deletions