summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-02-05 19:53:02 +0000
committerChris Lattner <sabre@nondot.org>2010-02-05 19:53:02 +0000
commit64ffd11d4909b002809a5fbcfd3efcc44e754ca7 (patch)
tree48e8321e16d1dbf0abf652f949d483f8b773a514 /llvm/lib/Transforms
parentd0bc7b9d136c964ad230160d7350c09d1c075381 (diff)
downloadbcm5719-llvm-64ffd11d4909b002809a5fbcfd3efcc44e754ca7.tar.gz
bcm5719-llvm-64ffd11d4909b002809a5fbcfd3efcc44e754ca7.zip
fix logical-select to invoke filecheck right, and fix hte instcombine
xform it is checking to actually pass. There is no need to match m_SelectCst<0, -1> since instcombine canonicalizes that into not(sext). Add matches for sext(not(x)) in addition to not(sext(x)). llvm-svn: 95420
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index f79e4fa371c..f0ddfe3fe1a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -1148,8 +1148,13 @@ static Instruction *MatchSelectFromAndOr(Value *A, Value *B,
// ((cond?-1:0)&C) | (B&(cond?0:-1)) -> cond ? C : B.
if (match(D, m_Not(m_SExt(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, B);
+ if (match(D, m_SExt(m_Not(m_Specific(Cond)))))
+ return SelectInst::Create(Cond, C, B);
+
// ((cond?-1:0)&C) | ((cond?0:-1)&D) -> cond ? C : D.
- if (match(B, m_SelectCst<0, -1>(m_Specific(Cond))))
+ if (match(B, m_Not(m_SExt(m_Specific(Cond)))))
+ return SelectInst::Create(Cond, C, D);
+ if (match(B, m_SExt(m_Not(m_Specific(Cond)))))
return SelectInst::Create(Cond, C, D);
return 0;
}
OpenPOWER on IntegriCloud