summaryrefslogtreecommitdiff
path: root/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-08-17 19:31:49 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-08-17 19:31:49 +0000
commitf23d4adbfaf870d5fa67c6bff0da7891d3a98f9d (patch)
tree7f49b7f64ad2e2cdbac5154c659e8c89b544fb64 /lib/Analysis/InstructionSimplify.cpp
parent511961a44ce4f1947ebb1e476f5cb38c223d4833 (diff)
downloadllvm-f23d4adbfaf870d5fa67c6bff0da7891d3a98f9d.tar.gz
llvm-f23d4adbfaf870d5fa67c6bff0da7891d3a98f9d.tar.bz2
llvm-f23d4adbfaf870d5fa67c6bff0da7891d3a98f9d.tar.xz
Revert r137781; I agree with Duncan's comment that the situation in question is clearly impossible given the current structure of the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137853 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--lib/Analysis/InstructionSimplify.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp
index 89e55a4651..cfff9c03c8 100644
--- a/lib/Analysis/InstructionSimplify.cpp
+++ b/lib/Analysis/InstructionSimplify.cpp
@@ -1348,11 +1348,6 @@ static Value *SimplifyXorInst(Value *Op0, Value *Op1, const TargetData *TD,
std::swap(Op0, Op1);
}
- // A ^ A = 0
- // Do this first so that we catch the undef ^ undef "idiom".
- if (Op0 == Op1)
- return Constant::getNullValue(Op0->getType());
-
// A ^ undef -> undef
if (match(Op1, m_Undef()))
return Op1;
@@ -1361,6 +1356,10 @@ static Value *SimplifyXorInst(Value *Op0, Value *Op1, const TargetData *TD,
if (match(Op1, m_Zero()))
return Op0;
+ // A ^ A = 0
+ if (Op0 == Op1)
+ return Constant::getNullValue(Op0->getType());
+
// A ^ ~A = ~A ^ A = -1
if (match(Op0, m_Not(m_Specific(Op1))) ||
match(Op1, m_Not(m_Specific(Op0))))