aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-05 01:23:24 +0000
committerChris Lattner <sabre@nondot.org>2010-12-05 01:23:24 +0000
commita2b5600e615feb71840cd66d2676a8938daf737e (patch)
tree247ba28bda16836745daaeb67a37d50b6248262f /lib/Transforms/Scalar/JumpThreading.cpp
parentbced6a1b8f10e5a3720e376d4ad0850c5165e45f (diff)
Improve an integer select optimization in two ways:
1. generalize (select (x == 0), -1, 0) -> (sign_bit (x - 1)) to: (select (x == 0), -1, y) -> (sign_bit (x - 1)) | y 2. Handle the identical pattern that happens with !=: (select (x != 0), y, -1) -> (sign_bit (x - 1)) | y cmov is often high latency and can't fold immediates or memory operands. For example for (x == 0) ? -1 : 1, before we got: < testb %sil, %sil < movl $-1, %ecx < movl $1, %eax < cmovel %ecx, %eax now we get: > cmpb $1, %sil > sbbl %eax, %eax > orl $1, %eax git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/JumpThreading.cpp')
0 files changed, 0 insertions, 0 deletions