search for: m_combineand

Displaying 2 results from an estimated 2 matches for "m_combineand".

2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
...ing is performed/allowed. This should match that *specific* pattern (other than verifying the correct equal binop types), although i have not tested it: ICmpInst::Predicate Pred; Value *A, *B, *Mul, *Sub, *Mul2; if (match(&SI, m_Select(m_ICmp(Pred, m_CombineAnd(m_BinOp(m_Value(A), m_Value(B)), m_Value(Mul)), m_AllOnes()), m_Deferred(Mul), m_CombineAnd( m_c_BinOp(m_CombineAnd(m_Sub(m_Zero(), m_Deferred (A)),...
2018 Dec 18
2
should we do this time-consuming transform in InstCombine?
Hi, There is an opportunity in instCombine for following instruction pattern: %mul = mul nsw i32 %b, %a %cmp = icmp sgt i32 %mul, -1 %sub = sub i32 0, %a %mul2 = mul nsw i32 %sub, %b %cond = select i1 %cmp, i32 %mul, i32 %mul2 Source code for above pattern: return (a*b) >=0 ? (a*b) : -a*b; Currently, llvm(-O3) can not recognize this as abs(a*b). I initially think we could do this in