Displaying 2 results from an estimated 2 matches for "m_constant".
Did you mean:
g_constant
2014 Jul 01
2
[LLVMdev] Probable error in InstCombine
...gt; int main (void)
> {
> printf ("%d\n", foo(INT_MIN));
> }
This will print -1 or 1, depending on the optimization level.
This appears to be the relevant code:
InstCombineAddSub.cpp:1556
> // 0 - (X sdiv C) -> (X sdiv -C)
> if (match(Op1, m_SDiv(m_Value(X), m_Constant(C))) &&
> match(Op0, m_Zero()))
> return BinaryOperator::CreateSDiv(X, ConstantExpr::getNeg(C));
- David Menendez
2015 Apr 15
2
[LLVMdev] Instruction combiner multiplication canonicalization
...ase confirm my understanding.
<File: InstCombineMulDivRem.cpp >
168 Instruction *InstCombiner::visitMul(BinaryOperator &I) {
268 // Canonicalize (X+C1)*CI -> X*CI+C1*CI.
269 {
270 Value *X;
271 Constant *C1;
272 if (match(Op0, m_OneUse(m_Add(m_Value(X), m_Constant(C1))))) {
273 Value *Mul = Builder->CreateMul(C1, Op1);
274 // Only go forward with the transform if C1*CI simplifies to a tidier
275 // constant.
276 if (!match(Mul, m_Mul(m_Value(), m_Value())))
277 return BinaryOperator::CreateAdd(Builder->Cre...