[LLVMdev] Avoiding Constant Folding

Cuong Pham phamcuongbk at gmail.com
Wed Jun 15 11:31:33 PDT 2011


Thanks for your explanation and advice. It is very useful for me.

--Cuong

On Tue, Jun 14, 2011 at 10:38 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi Cuong,
>
> > I am trying to avoid using stack memory (or mutable variable is the term
> > used in the tutorial). I am also trying to optimize the code as much as I
> > can before using optimizer passes such as mem2reg (to reduce the compile
> > time as well).
>
> I don't think there is much point in avoiding stack variables (using them
> makes your life much simpler -> easier to have your front-end be correct;
> passes like mem2reg will turn your variables into registers if possible
> anyway).  And there's also not much point in trying to keep the bitcode
> small
> so as to speed up the optimizers: it will just make your front-end more
> complicated, while probably the gains (if any) are insignificant.  My
> advice
> is to keep your front-end as simple as possible.  You can run some
> per-function
> passes as you output each function, to clean it up and reduce the bitcode
> size,
> for example simplifycfg+scalarrepl+instcombine, if memory usage is a
> problem.
>
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110615/b0d7e293/attachment.html>


More information about the llvm-dev mailing list