diff options
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp | 8 | 
1 files changed, 2 insertions, 6 deletions
| diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp index fa7bb12ff21..806e7b54809 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp @@ -1142,19 +1142,15 @@ static Instruction *MatchSelectFromAndOr(Value *A, Value *B,                                           Value *C, Value *D) {    // If A is not a select of -1/0, this cannot match.    Value *Cond = 0; -  if (!match(A, m_SelectCst<-1, 0>(m_Value(Cond)))) +  if (!match(A, m_SExt(m_Value(Cond))))      return 0;    // ((cond?-1:0)&C) | (B&(cond?0:-1)) -> cond ? C : B. -  if (match(D, m_SelectCst<0, -1>(m_Specific(Cond)))) -    return SelectInst::Create(Cond, C, B); -  if (match(D, m_Not(m_SelectCst<-1, 0>(m_Specific(Cond))))) +  if (match(D, m_Not(m_SExt(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))))      return SelectInst::Create(Cond, C, D); -  if (match(B, m_Not(m_SelectCst<-1, 0>(m_Specific(Cond))))) -    return SelectInst::Create(Cond, C, D);    return 0;  } | 

