[LLVMdev] Problem while using mem2reg Optimization

Eli Friedman eli.friedman at gmail.com
Wed Jul 2 16:56:17 PDT 2008


On Wed, Jul 2, 2008 at 10:07 AM, kapil anand <kapilanand2 at gmail.com> wrote:
> Hi,
>
> I am using various LLVM optimization passes and I noticed a strange
> behaviour in Mem2Reg Optimization. These pass is used for SSA construction
> and basically removed alloca of the corresponding pointers are just used in
> load/stores.
> So, is there any restriction that all the alloca should be put in first
> basic block?

Yes, there is exactly such a restriction;
http://llvm.org/docs/tutorial/LangImpl7.html has a good description of
using mem2reg for SSA construction.

-Eli



More information about the llvm-dev mailing list