<div dir="ltr"><div>This sounds fragile and unlikely to behave as we want in general. InstCombine only tries to do target-independent (universally good) transforms. That's why it is included at all (some would say too many!) different points in the optimization pipeline.</div><div><br></div><div>If your transform only makes sense late in the pipeline, you might look at CodeGenPrepare or DAGCombiner instead of InstCombine. You would also have access to target features/costs in those passes, so the transform could be limited to the cases where it makes sense.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 17, 2020 at 2:57 PM Arnamoy Bhattacharyya via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US">
<div>
<p class="MsoNormal">Hello All;<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My goal is to do a specific peephole to the IR using the InstrCombine pass.  But I want to run the peephole at a particular point (at a late stage) of the compilation pipeline.  The InstCombine is run multiple times in the compilation pipeline. 
 Is there a way to identify where I am in the compilation pipeline from within the InstrCombine pass?  I guess one option will be to look for specific code patterns that can only happen at a late compilation stage, but is there a simpler way?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks a lot for your help.<u></u><u></u></p>
</div>
</div>

_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>