<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="margin:0;">Hello,</div><div style="margin:0;"><br></div><div style="margin:0;">I have two APInt variables, which are got by ConstantSDNode::getAPIntValue().</div><div style="margin:0;"><br></div><div style="margin:0;">Is there a simple way to know if their multiplication overflows?</div><div style="margin:0;"><br></div><div style="margin:0;">For example, if both APInt vars contain a int32_t, </div><div style="margin:0;">APInt a, b;</div><div style="margin:0;">Then I think </div><div style="margin:0;"><br></div><div style="margin:0;">if (a.getMinSignedBits() + b.getMinSignedBits() > 32)</div><div style="margin:0;">   a*b must exceeds int32_t <=> overflow happens;</div><div style="margin:0;"><br></div><div style="margin:0;">Is my way OK?</div><div style="margin:0;"><br></div><div style="margin:0;">Ben Shi</div></div>