aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit74529826a70546d71c6558e9a3917244a87acfe9 (patch)
tree40781a35873a4b901835fb705b958b974fc8c6f9 /lib/Transforms
parent82ed17eb472102cb6711b832183ee4816ad9a656 (diff)
downloadexternal_llvm-74529826a70546d71c6558e9a3917244a87acfe9.zip
external_llvm-74529826a70546d71c6558e9a3917244a87acfe9.tar.gz
external_llvm-74529826a70546d71c6558e9a3917244a87acfe9.tar.bz2
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)). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95420 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/InstCombine/InstCombineAndOrXor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index f79e4fa..f0ddfe3 100644
--- a/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/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;
}