<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 24, 2015 at 10:00 PM, Jingyue Wu <span dir="ltr"><<a href="mailto:jingyue@google.com" target="_blank">jingyue@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">And just to be clear, I agree with you that it's a potential issue that `ComputeSignBit` is unable to say "I don't have a context". But my concern is, even if we fix that issue, not passing the context instruction to `SimplifyICmpInst` at all in `InstCombine` may overkill some useful optimizations.<br></blockquote><div><br></div><div>I see these as two separable issues: a correctness issue and a performance issue.  My thinking was that we should solve the correctness issue by being conservative at the API boundary and regain lost performance by providing the context instruction.  My fear is not that your change to SimplifyICmpInst is incorrect but that all the other callers of the various SimplifyXYZInst API have latent bugs because they aren't passing in a context.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
Btw, I noticed that `SimplifyDemandedBits` indeed pass `UserI` as the context instruction (<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_doxygen_html_InstCombineSimplifyDemanded-5F8cpp-5Fsource.html-23l00075&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=Lwxgna_SwnZ2GOXvXrW-P01vgzipMJSyRwtnfnHS6e8&s=7WyUF27tFJR9xfkYQWGOLKPqmDdfnPESSJCXi3N2Rmo&e=" rel="noreferrer" target="_blank">http://llvm.org/docs/doxygen/html/InstCombineSimplifyDemanded_8cpp_source.html#l00075</a>), which seems aligned with the approach in my patch.<br>
<div class=""><div class="h5"><br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10695&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=Lwxgna_SwnZ2GOXvXrW-P01vgzipMJSyRwtnfnHS6e8&s=J8NPlut705zifAjm4CZLEfcZC1gIeqLZY-AcycZfKBc&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10695</a><br>
<br>
EMAIL PREFERENCES<br>
  <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_settings_panel_emailpreferences_&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=Lwxgna_SwnZ2GOXvXrW-P01vgzipMJSyRwtnfnHS6e8&s=DYzjgzgCYLNpqEhvHTZzhGKq2Lgg3IfMY3epTtQPNyU&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/settings/panel/emailpreferences/</a><br>
<br>
<br>
</div></div></blockquote></div><br></div></div>