Add a small missed optimization: turn X == C ? X : Y into X == C ? C : Y. This
commit98cd75027c3db009ffb64aebf613382299858c32
authorNick Lewycky <nicholas@mxc.ca>
Sun, 27 Mar 2011 07:30:57 +0000 (27 07:30 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Sun, 27 Mar 2011 07:30:57 +0000 (27 07:30 +0000)
tree3ee01543981f258d513adac670761dea5507c972
parentd645151ac680ae9d6b9c032b3de903d5ae5a22ac
Add a small missed optimization: turn X == C ? X : Y into X == C ? C : Y. This
removes one use of X which helps it pass the many hasOneUse() checks.

In my analysis, this turns up very often where X = A >>exact B and that can't be
simplified unless X has one use (except by increasing the lifetime of A which is
generally a performance loss).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128373 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/select.ll