Generalize not and neg comparison testers to allow constant to be considered not...
authorChris Lattner <sabre@nondot.org>
Mon, 10 Mar 2003 23:06:50 +0000 (23:06 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 10 Mar 2003 23:06:50 +0000 (23:06 +0000)
commit8d96964e29e737b597e31af04db14570b87c6346
tree0e72338b831bc5b55880770dc08c0228ca8e6cc0
parent1b77300154ca8cbf1594475712811228f898149c
Generalize not and neg comparison testers to allow constant to be considered not'able and neg'able.  This
allows optimization of this:
int %test4(int %A, int %B) {
        %a = xor int %A, -1
        %c = and int %a, 5    ; 5 = ~c2
        %d = xor int %c, -1
        ret int %d
}

into this:
int %test4(int %A, int %B) {            ; No predecessors!
        %c.demorgan = or int %A, -6             ; <int> [#uses=1]
        ret int %c.demorgan
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5736 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp