diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-11-18 09:31:41 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-11-18 09:31:41 +0000 |
commit | 6fdb6b8fd4e18c0741a839a11d7dee7077bc7505 (patch) | |
tree | 4b0da2b648a372da566f751f72b95f112d689554 /llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | |
parent | 1a3327bb626c46c89400f3f03d39fb9bc6157d14 (diff) | |
download | bcm5719-llvm-6fdb6b8fd4e18c0741a839a11d7dee7077bc7505.tar.gz bcm5719-llvm-6fdb6b8fd4e18c0741a839a11d7dee7077bc7505.zip |
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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index 35f0586c914..55ebcedf944 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -776,7 +776,7 @@ static Value *foldLogOpOfMaskedICmps(ICmpInst *LHS, ICmpInst *RHS, bool IsAnd, // whole construct if (((BCst->getValue() & DCst->getValue()) & (CCst->getValue() ^ ECst->getValue())) != 0) - return nullptr; + return ConstantInt::get(LHS->getType(), !IsAnd); Value *newOr1 = Builder->CreateOr(B, D); Value *newOr2 = ConstantExpr::getOr(CCst, ECst); Value *newAnd = Builder->CreateAnd(A, newOr1); |