<div dir="ltr"><div>Phab shows the wrong context for my last comment, and I see that the inline comment before that one never hit the mailing list.<br><br></div>For the sake of the mailing list:<br><p>> "Not all value are true or false, so matching what is NOT true is not the same as matching false."</p><div class=""><div class=""><p>Sorry for still not seeing it...can you add test case to show the difference?</p>

<p>AFAICT, the undef param of these intrinsics must be an i1 true/false constant?</p>

<div class=""><pre class="">case Intrinsic::ctlz:  // llvm.ctlz
case Intrinsic::cttz:  // llvm.cttz
  Assert(isa<ConstantInt>(CS.getArgOperand(1)),
         "is_zero_undef argument of bit counting intrinsics must be a "
         "constant int",
         CS);</pre></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 8:19 AM, Sanjay Patel <span dir="ltr"><<a href="mailto:spatel@rotateright.com" target="_blank">spatel@rotateright.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">spatel added inline comments.<br>
<br>
================<br>
Comment at: lib/Transforms/InstCombine/<wbr>InstCombineCalls.cpp:1283-1296<br>
@@ -1268,16 +1282,16 @@<br>
<span class=""><br>
 /// CallInst simplification. This mostly only handles folding of intrinsic<br>
</span> /// instructions. For normal calls, it allows visitCallSite to do the heavy<br>
 /// lifting.<br>
 Instruction *InstCombiner::visitCallInst(<wbr>CallInst &CI) {<br>
   auto Args = CI.arg_operands();<br>
   if (Value *V = SimplifyCall(CI.<wbr>getCalledValue(), Args.begin(), Args.end(), DL,<br>
                               &TLI, &DT, &AC))<br>
     return replaceInstUsesWith(CI, V);<br>
<br>
   if (isFreeCall(&CI, &TLI))<br>
     return visitFree(CI);<br>
<br>
   // If the caller function is nounwind, mark the call as nounwind, even if the<br>
   // callee isn't.<br>
   if (CI.getParent()->getParent()-><wbr>doesNotThrow() &&<br>
----------------<br>
Sorry for still not seeing it...can you add test case to show the difference?<br>
<br>
AFAICT, the undef param of these intrinsics must be an i1 true/false constant?<br>
<br>
  case Intrinsic::ctlz:  // llvm.ctlz<br>
  case Intrinsic::cttz:  // llvm.cttz<br>
    Assert(isa<ConstantInt>(CS.<wbr>getArgOperand(1)),<br>
           "is_zero_undef argument of bit counting intrinsics must be a "<br>
           "constant int",<br>
           CS);<br>
<br>
<br>
<br>
<a href="https://reviews.llvm.org/D23134" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23134</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>