]> granicus.if.org Git - llvm/commit
[InstCombine] X | C == C --> (X & ~C) == 0
authorSanjay Patel <spatel@rotateright.com>
Wed, 6 Feb 2019 16:43:54 +0000 (16:43 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 6 Feb 2019 16:43:54 +0000 (16:43 +0000)
commit9cecbbb1baa72132a727a22a807fda8f9d40b81e
tree76831f15b9be48894d6352cf11ba1969d5b7dd8c
parent1dd69f9eb9398f8bdcf407e281a3b377b3689dc5
[InstCombine] X | C == C --> (X & ~C) == 0

We should canonicalize to one of these forms,
and compare-with-zero could be more conducive
to follow-on transforms. This also leads to
generally better codegen as shown in PR40611:
https://bugs.llvm.org/show_bug.cgi?id=40611

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