<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 17, 2015 at 11:32 AM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">craig.topper added a subscriber: craig.topper.<br>
craig.topper added a comment.<br>
<br>
The summary of why this is ok is slightly misleading.</blockquote><div><br></div><div>I read this as reason why programs might try to use this, not why this change here is correct. (This change is ok as it has an explicit 0 check as you say, so it'll only be efficient once you target machines with BMI)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> The backend won't try to encode the TZCNT instruction when the BMI feature is not enabled. Notice this just maps the to the generic non-x86 specific __builtin_ctz. The backend will emit a regular BSF instruction if BMI is not supported. There will be a zero check around it unless the backend can prove that the input is not 0.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14748" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14748</a><br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div></div>