[llvm-dev] Identify pass in the compilation pipeline

Sanjay Patel via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 17 15:04:11 PDT 2020


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.

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.

On Mon, Aug 17, 2020 at 2:57 PM Arnamoy Bhattacharyya via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hello All;
>
>
>
> 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?
>
>
>
> Thanks a lot for your help.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200817/03f0d527/attachment.html>


More information about the llvm-dev mailing list