InstCombine: Fold away tautological masked compares
authorDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)
commit6fdb6b8fd4e18c0741a839a11d7dee7077bc7505
tree4b0da2b648a372da566f751f72b95f112d689554
parent1a3327bb626c46c89400f3f03d39fb9bc6157d14
InstCombine: Fold away tautological masked compares

It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.

While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.

llvm-svn: 222230
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/icmp-logical.ll