summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2012-12-13 14:28:16 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2012-12-13 14:28:16 +0000
commit38d2b2442feaa777cf87c5f57939b158f04735fe (patch)
tree373d059509ecdc5908896b64d1102a05572a3d9d /llvm/lib/Transforms
parent18ec81b8547515e3163bd43a354782075a0a47bd (diff)
downloadbcm5719-llvm-38d2b2442feaa777cf87c5f57939b158f04735fe.tar.gz
bcm5719-llvm-38d2b2442feaa777cf87c5f57939b158f04735fe.zip
Revert r170020, "Simplify negated bit test", for now.
This assumes (1 << n) is always not zero. Consider n is greater than word size. Although I know it is undefined, this transforms undefined behavior hidden. This led clang unexpected behavior with some failures. I will investigate to fix undefined shl in clang. llvm-svn: 170128
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp18
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 00807a391a9..1b96c3cca4e 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -2034,15 +2034,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
CI->countTrailingZeros()));
}
- // Turn x&~y == 0 into x&y != 0 if x is a power of 2.
- Value *X = 0, *Y = 0;
- if (match(Op0, m_And(m_Value(X), m_Not(m_Value(Y)))) &&
- match(Op1, m_Zero()) && isKnownToBeAPowerOfTwo(X, TD)) {
- return new ICmpInst(ICmpInst::ICMP_NE,
- Builder->CreateAnd(X, Y),
- Op1);
- }
-
break;
}
case ICmpInst::ICMP_NE: {
@@ -2080,15 +2071,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) {
CI->countTrailingZeros()));
}
- // Turn x&~y != 0 into x&y == 0 if x is a power of 2.
- Value *X = 0, *Y = 0;
- if (match(Op0, m_And(m_Value(X), m_Not(m_Value(Y)))) &&
- match(Op1, m_Zero()) && isKnownToBeAPowerOfTwo(X, TD)) {
- return new ICmpInst(ICmpInst::ICMP_EQ,
- Builder->CreateAnd(X, Y),
- Op1);
- }
-
break;
}
case ICmpInst::ICMP_ULT:
OpenPOWER on IntegriCloud